mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-19 18:45:52 +00:00
Fix secured Websocket closing.
Websocketpp was incorrectly handling close before or during protocol negotiation. This issue addresses lingering CLOSE_WAIT file descriptors.
This commit is contained in:
committed by
Nik Bougalis
parent
d2071b7ea7
commit
d2a787805a
@@ -1404,6 +1404,8 @@ public:
|
||||
|
||||
log_close_result();
|
||||
}
|
||||
else
|
||||
m_state = session::state::CLOSED;
|
||||
|
||||
// finally remove this connection from the endpoint's list. This will
|
||||
// remove the last shared pointer to the connection held by WS++. If we
|
||||
|
||||
@@ -914,7 +914,8 @@ void server<endpoint>::connection<connection_type>::handle_write_response(
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_response.get_status_code() != http::status_code::SWITCHING_PROTOCOLS) {
|
||||
if (m_response.get_status_code() != http::status_code::SWITCHING_PROTOCOLS ||
|
||||
m_connection.m_state == session::state::CLOSED) {
|
||||
if (m_version == -1) {
|
||||
// if this was not a websocket connection, we have written
|
||||
// the expected response and the connection can be closed.
|
||||
|
||||
Reference in New Issue
Block a user