RequestServer+LibHTTP+LibGemini: Cache connections to the same host

This makes connections (particularly TLS-based ones) do the handshaking
stuff only once.
Currently the cache is configured to keep at most two connections evenly
balanced in queue size, and with a grace period of 10s after the last
queued job has finished (after which the connection will be dropped).
This commit is contained in:
Ali Mohammad Pur 2021-09-18 03:48:22 +04:30 committed by Ali Mohammad Pur
commit 65f7e45a75
Notes: sideshowbarker 2024-07-18 03:40:01 +09:00
22 changed files with 295 additions and 51 deletions

View file

@ -35,7 +35,7 @@ public:
NetworkResponse* response() { return m_response.ptr(); }
const NetworkResponse* response() const { return m_response.ptr(); }
virtual void start() = 0;
virtual void start(NonnullRefPtr<Core::Socket>) = 0;
virtual void shutdown() = 0;
void cancel()