Skip to content

Commit

Permalink
fix(backend): close connection even without handshake
Browse files Browse the repository at this point in the history
  • Loading branch information
ravenclaw900 committed Nov 14, 2021
1 parent 8c8b63c commit 630d38d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/backend/src/sockets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,10 @@ pub async fn socket_handler(socket: warp::ws::WebSocket) {
let mut first_message = true;
let mut req: types::Request;
loop {
let data = socket_recv.next().await.unwrap().unwrap();
let data = match socket_recv.next().await {
Some(Ok(data)) => data,
Some(Err(_)) | None => break,
};
if data.is_close() {
break;
}
Expand Down

0 comments on commit 630d38d

Please sign in to comment.