1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-27 01:29:14 -05:00
denoland-deno/ext/websocket
Divy Srivastava a411144219
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.
2023-04-14 22:17:39 +05:30
..
01_websocket.js refactor(ext/webidl): remove object from 'requiredArguments' (#18674) 2023-04-12 19:58:57 +00:00
02_websocketstream.js refactor(ext/webidl): remove object from 'requiredArguments' (#18674) 2023-04-12 19:58:57 +00:00
Cargo.toml chore: bump fastwebsockets to 0.1.3 (#18684) 2023-04-13 13:16:19 +00:00
lib.deno_websocket.d.ts chore: update copyright year to 2023 (#17247) 2023-01-02 21:00:42 +00:00
lib.rs perf(ext/websocket): replace tokio_tungstenite server with fastwebsockets (#18587) 2023-04-06 18:44:31 +05:30
README.md Rename extensions/ directory to ext/ (#11643) 2021-08-11 12:27:05 +02:00
server.rs fix(ext/websocket): Avoid write deadlock that requires read_frame to complete (#18705) 2023-04-14 22:17:39 +05:30

deno_websocket

This op crate implements the websocket functions of Deno.

Spec: https://html.spec.whatwg.org/multipage/web-sockets.html