diff options
author | Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> | 2024-10-16 20:56:57 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-17 03:56:57 +0000 |
commit | a61ba3c6995bef58f508a34e537932284692c294 (patch) | |
tree | 75e3e3dbba7b648ef6787da8e1f4989286d4583d /ext/node/polyfills/internal_binding/tcp_wrap.ts | |
parent | 167f674c7cbb9632000c1feb0b747ba098b01c12 (diff) |
fix(net): don't try to set nodelay on upgrade streams (#26342)
Fixes https://github.com/denoland/deno/issues/26341.
We try to call `op_set_nodelay` on an `UpgradeStream`, which doesn't
support that operation.
Diffstat (limited to 'ext/node/polyfills/internal_binding/tcp_wrap.ts')
-rw-r--r-- | ext/node/polyfills/internal_binding/tcp_wrap.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/node/polyfills/internal_binding/tcp_wrap.ts b/ext/node/polyfills/internal_binding/tcp_wrap.ts index 1321cc627..2856f808a 100644 --- a/ext/node/polyfills/internal_binding/tcp_wrap.ts +++ b/ext/node/polyfills/internal_binding/tcp_wrap.ts @@ -300,7 +300,9 @@ export class TCP extends ConnectionWrap { * @return An error status code. */ setNoDelay(noDelay: boolean): number { - this[kStreamBaseField].setNoDelay(noDelay); + if ("setNoDelay" in this[kStreamBaseField]) { + this[kStreamBaseField].setNoDelay(noDelay); + } return 0; } |