Skip to content

Commit

Permalink
fix(ext/node): do not apply socket-init-workaround to ipc socket
Browse files Browse the repository at this point in the history
  • Loading branch information
kt3k committed Jan 22, 2025
1 parent b962b87 commit c30c349
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/node/polyfills/net.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,7 @@ export class Socket extends Duplex {

super(options);

// Note: If the socket is created from one of `pkgNeedsSockInitWorkaround`,
// Note: If the TCP/TLS socket is created from one of `pkgNeedsSockInitWorkaround`,
// the 'socket' event on ClientRequest object happens after 'connect' event on Socket object.
// That swaps the sequence of op_node_http_request_with_conn() call and
// initial socket read. That causes op_node_http_request_with_conn() not
Expand All @@ -1250,7 +1250,7 @@ export class Socket extends Duplex {
// TODO(kt3k): Remove this workaround
const errorStack = new Error().stack;
this._needsSockInitWorkaround = pkgsNeedsSockInitWorkaround.some((pkg) =>
errorStack?.includes(pkg)
errorStack?.includes(pkg) && options.handle?.ipc !== true
);
if (this._needsSockInitWorkaround) {
this.pause();
Expand Down

0 comments on commit c30c349

Please sign in to comment.