summaryrefslogtreecommitdiff
path: root/ext/websocket/01_websocket.js
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2023-04-14 22:17:39 +0530
committerGitHub <noreply@github.com>2023-04-14 22:17:39 +0530
commita4111442191fff300132259752e6d2d5613d1871 (patch)
treeea7cd7d3b897ace1ca29b1f0dd66e8e0d8b6a76a /ext/websocket/01_websocket.js
parentd01340dab0d686c7f2d6c6922239f5fee0bc4cef (diff)
fix(ext/websocket): Avoid write deadlock that requires read_frame to complete (#18705)
Fixes https://github.com/denoland/deno/issues/18700 Timeline of the events that lead to the bug. 1. WebSocket handshake complete 2. Server on `read_frame` holding an AsyncRefCell borrow of the WebSocket stream. 3. Client sends a TXT frame after a some time 4. Server recieves the frame and goes back to `read_frame`. 5. After some time, Server starts a `write_frame` but `read_frame` is still holding a borrow! ^--- Locked. read_frame needs to complete so we can resume the write. This commit changes all writes to directly borrow the `fastwebsocket::WebSocket` resource under the assumption that it won't affect ongoing reads.
Diffstat (limited to 'ext/websocket/01_websocket.js')
0 files changed, 0 insertions, 0 deletions