Skip to content

Commit 2c40df6

Browse files
committed
fix: reset cURL header-accumulator state between transfers
1 parent 0e0b82d commit 2c40df6

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,11 @@ void CurlClient::PerformRequestWithMulti(
516516
// Initialize parser for new connection (last_event_id is tracked
517517
// separately)
518518
context->init_parser();
519+
// Reset header-accumulator state in case the previous transfer dropped
520+
// mid-headers, which would otherwise leave reading_headers=true and
521+
// cause the new response's HTTP/ status line to be skipped.
522+
context->current_response = http::response_header<>{};
523+
context->reading_headers = false;
519524

520525
std::shared_ptr<CURL> curl(curl_easy_init(), curl_easy_cleanup);
521526
if (!curl) {

0 commit comments

Comments
 (0)