Merge pull request #159 from uqbar-dao/hf/fix-http-deadlock

http-server: fix deadlock
This commit is contained in:
hosted-fornet 2024-01-16 10:37:34 -08:00 committed by GitHub
commit 9ddbebd1eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -320,6 +320,9 @@ async fn ws_handler(
}
let app = bound_path.app.clone();
drop(ws_path_bindings);
Ok(ws_connection.on_upgrade(move |ws: WebSocket| async move {
maintain_websocket(
ws,
@ -502,6 +505,9 @@ async fn http_handler(
}
};
// unlock to avoid deadlock with .write()s
drop(path_bindings);
let (response_sender, response_receiver) = tokio::sync::oneshot::channel();
http_response_senders.insert(id, (original_path, response_sender));