Reset connection state after finishing with it in http_handler

This commit is contained in:
2025-09-14 21:16:41 -04:00
parent 632113f792
commit 1f61f91bf5
7 changed files with 71 additions and 47 deletions

View File

@@ -55,21 +55,6 @@ public:
*/
virtual void on_write_progress(Connection &) {}
/**
* Called when the connection's outgoing write buffer becomes empty.
*
* This indicates all queued messages have been successfully written
* to the socket. Useful for:
* - Implementing keep-alive connection reuse
* - Closing connections after final response
* - Relieving backpressure conditions
*
* @param conn Connection with empty write buffer - server retains ownership
* @note Called from this connection's io thread.
* @note Only called on transitions from non-empty → empty buffer
*/
virtual void on_write_buffer_drained(Connection &) {}
/**
* Called when a new connection is established.
*
@@ -96,9 +81,9 @@ public:
/**
* @brief Called after a batch of connections has been processed.
*
* This hook is called after on_data_arrived, on_write_progress, or
* on_write_buffer_drained has been called for each connection in the batch.
* All connections remain server-owned.
* This hook is called after on_data_arrived or on_write_progress has been
* called for each connection in the batch. All connections remain
* server-owned.
*
* @param batch A span of connection references in the batch.
* @note Called from this connection's io thread.