mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:37:46 +00:00
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:
parent
c5d7eb8618
commit
65f7e45a75
22 changed files with 295 additions and 51 deletions
|
@ -82,6 +82,7 @@ public:
|
|||
bool can_read_line() const;
|
||||
|
||||
bool can_read() const;
|
||||
bool can_read_only_from_buffer() const { return !m_buffered_data.is_empty() && !can_read_from_fd(); }
|
||||
|
||||
bool seek(i64, SeekMode = SeekMode::SetPosition, off_t* = nullptr);
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ NetworkJob::~NetworkJob()
|
|||
{
|
||||
}
|
||||
|
||||
void NetworkJob::start()
|
||||
void NetworkJob::start(NonnullRefPtr<Core::Socket>)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue