Merge branch 'worktree-agent-a05bb30b35711bbf4'

This commit is contained in:
2026-10-25 20:28:07 +01:00
3 changed files with 82 additions and 0 deletions
+10
View File
@@ -87,6 +87,13 @@ class H2Connection : public std::enable_shared_from_this<H2Connection> {
void EnqueueControl(uint32_t stream_id, const std::string& frame_bytes);
void EnqueueData(uint32_t stream_id, std::string payload, bool end_stream);
// Backpressure floor: a peer that stops draining (e.g. a PING flood that
// never reads the socket) must not be allowed to grow out_queue_ without
// bound. Checked after every append to out_queued_bytes_; trips Fatal()
// once `ceiling` is crossed. Callers pass caps::kH2MaxPendingControlBytes
// for control output or caps::kWriteBufferCeiling (shared with the H1
// path in runtime/http/connection.cpp) for DATA/response output.
void EnforceWriteCap(std::size_t ceiling);
void KickWriter();
void WakeWriter();
void SendSettingsAck();
@@ -127,6 +134,9 @@ class H2Connection : public std::enable_shared_from_this<H2Connection> {
std::deque<OutItem> out_queue_;
// Payload bytes currently queued; bounds file-body streaming.
std::size_t out_queued_bytes_ = 0;
// Lifetime count of control frames queued to send; see
// caps::kH2MaxControlFramesPerConnection.
std::size_t control_frames_sent_ = 0;
void UnqueueBytes(std::size_t n) {
out_queued_bytes_ -=
n > out_queued_bytes_ ? out_queued_bytes_ : n;