Allow http workers to send data optimistically as an optimization

This commit is contained in:
Matthew Zipkin
2025-03-01 13:51:41 -05:00
parent a69bb9e1e6
commit 5ef1b80a09
2 changed files with 21 additions and 6 deletions

View File

@@ -573,9 +573,10 @@ public:
//! Initialized to true while server waits for first request from client.
//! Set to false after data is written to m_send_buffer and then that buffer is flushed to client.
//! Reset to true when we receive new request data from client.
//! Checked during DisconnectClients(). All of these operations take place in the HTTPServer I/O loop.
//! Checked during DisconnectClients() and set by read/write operations
//! called in either the HTTPServer I/O loop or by a worker thread during an "optimistic send".
//! `m_connection_busy=true` can be overridden by `m_disconnect=true` (we disconnect).
bool m_connection_busy{true};
std::atomic_bool m_connection_busy{true};
//! Client has requested to keep the connection open after all requests have been responded to.
//! Set by (potentially multiple) worker threads and checked in the HTTPServer I/O loop.