summaryrefslogtreecommitdiff
path: root/ext/http
diff options
context:
space:
mode:
Diffstat (limited to 'ext/http')
-rw-r--r--ext/http/01_http.js36
1 files changed, 11 insertions, 25 deletions
diff --git a/ext/http/01_http.js b/ext/http/01_http.js
index c9fe8220d..de546285d 100644
--- a/ext/http/01_http.js
+++ b/ext/http/01_http.js
@@ -357,32 +357,18 @@
httpConn.close();
- if (ws[_readyState] === WebSocket.CLOSING) {
- await core.opAsync("op_ws_close", wsRid);
-
- ws[_readyState] = WebSocket.CLOSED;
-
- const errEvent = new ErrorEvent("error");
- ws.dispatchEvent(errEvent);
-
- const event = new CloseEvent("close");
- ws.dispatchEvent(event);
-
- core.tryClose(wsRid);
- } else {
- ws[_readyState] = WebSocket.OPEN;
- const event = new Event("open");
- ws.dispatchEvent(event);
-
- ws[_eventLoop]();
- if (ws[_idleTimeoutDuration]) {
- ws.addEventListener(
- "close",
- () => clearTimeout(ws[_idleTimeoutTimeout]),
- );
- }
- ws[_serverHandleIdleTimeout]();
+ ws[_readyState] = WebSocket.OPEN;
+ const event = new Event("open");
+ ws.dispatchEvent(event);
+
+ ws[_eventLoop]();
+ if (ws[_idleTimeoutDuration]) {
+ ws.addEventListener(
+ "close",
+ () => clearTimeout(ws[_idleTimeoutTimeout]),
+ );
}
+ ws[_serverHandleIdleTimeout]();
}
} finally {
if (SetPrototypeDelete(httpConn.managedResources, streamRid)) {