denoland / fastwebsockets

A fast RFC6455 WebSocket implementation
https://docs.rs/fastwebsockets/
Apache License 2.0
845 stars 61 forks source link

`read_frame` may panic #77

Closed arBmind closed 4 months ago

arBmind commented 4 months ago

if read_frame() of Websocket cannot send ping response because of a socket error it will panic the whole server.

https://github.com/denoland/fastwebsockets/blob/bd38ea52537cd2851813525636a897d826e71ae0/src/lib.rs#L534

The read_frame() of WebSocketRead seems to try some error conversions, but then panics anyway?

https://github.com/denoland/fastwebsockets/blob/bd38ea52537cd2851813525636a897d826e71ae0/src/lib.rs#L302-L303

This came up in a production environment. I hope this behaviour might be fixed or we will have to use another implementation.

littledivy commented 4 months ago

Please provide the panic message or backtrace (with RUST_BACKTRACE=1).

arBmind commented 4 months ago

Oh, it seems I don't understand Rust. The question mark is just forwarding the error to the caller. Sorry for the inconvenience!