mirror of
https://github.com/denoland/deno.git
synced 2024-11-24 15:19:26 -05:00
fix(ext/websocket): panic on no next ws message from an already closed stream (#16004)
This commit is contained in:
parent
225d516466
commit
9c7a5c0c61
1 changed files with 3 additions and 1 deletions
|
@ -489,7 +489,9 @@ pub async fn op_ws_next_event(
|
|||
Some(Ok(Message::Pong(_))) => NextEventResponse::Pong,
|
||||
Some(Err(e)) => NextEventResponse::Error(e.to_string()),
|
||||
None => {
|
||||
state.borrow_mut().resource_table.close(rid).unwrap();
|
||||
// No message was received, presumably the socket closed while we waited.
|
||||
// Try close the stream, ignoring any errors, and report closed status to JavaScript.
|
||||
let _ = state.borrow_mut().resource_table.close(rid);
|
||||
NextEventResponse::Closed
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue