Skip to content

Commit 96fd212

Browse files
beekldkinyoklion
andauthored
Apply suggestion from @kinyoklion
Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
1 parent aaff427 commit 96fd212

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

libs/server-sent-events/src/curl_client.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ class CurlClient final : public Client,
101101
// status line, emitted on the empty terminator line.
102102
http::response_header<> current_response;
103103

104+
// True while accumulating headers between an `HTTP/` status line and
105+
// the empty terminator. Gates `HeaderCallback` against chunked
106+
// trailers (which arrive without a fresh status line) and against
107+
// interior `HTTP/` lines that would otherwise wipe accumulated state.
108+
bool reading_headers = false;
109+
104110
// Mutated on the strand in do_run() before each transfer, and read by
105111
// libcurl via raw pointers (CURLOPT_URL, CURLOPT_POSTFIELDS) for the
106112
// duration of the transfer. Safe because the next do_run() only fires

0 commit comments

Comments
 (0)