LibProtocol+RequestServer: Add IPC to dump RequestServer connection info

This was available on Serenity by sending SIGINFO to RequestServer. Add
an IPC so we may see this info while running the browser.
This commit is contained in:
Timothy Flynn 2024-08-03 13:24:56 -04:00 committed by Tim Flynn
commit e75ba44f37
Notes: github-actions[bot] 2024-08-03 19:54:14 +00:00
5 changed files with 16 additions and 0 deletions

View file

@ -146,4 +146,9 @@ void RequestClient::websocket_certificate_requested(i32 connection_id)
maybe_connection.value()->did_request_certificates({});
}
void RequestClient::dump_connection_info()
{
async_dump_connection_info();
}
}

View file

@ -36,6 +36,8 @@ public:
bool stop_request(Badge<Request>, Request&);
bool set_certificate(Badge<Request>, Request&, ByteString, ByteString);
void dump_connection_info();
private:
virtual void die() override;

View file

@ -384,4 +384,9 @@ Messages::RequestServer::WebsocketSetCertificateResponse ConnectionFromClient::w
return success;
}
void ConnectionFromClient::dump_connection_info()
{
ConnectionCache::dump_jobs();
}
}

View file

@ -66,6 +66,8 @@ private:
virtual void websocket_close(i32, u16, ByteString const&) override;
virtual Messages::RequestServer::WebsocketSetCertificateResponse websocket_set_certificate(i32, ByteString const&, ByteString const&) override;
virtual void dump_connection_info() override;
Threading::MutexProtected<HashMap<i32, OwnPtr<Request>>> m_requests;
HashMap<i32, RefPtr<WebSocket::WebSocket>> m_websockets;

View file

@ -22,4 +22,6 @@ endpoint RequestServer
websocket_send(i32 connection_id, bool is_text, ByteBuffer data) =|
websocket_close(i32 connection_id, u16 code, ByteString reason) =|
websocket_set_certificate(i32 request_id, ByteString certificate, ByteString key) => (bool success)
dump_connection_info() =|
}