Close the connection after an early answer to Expect: 100-continue

When the final response came before 100 Continue, the body was never
sent but the connection was kept, so the server could read the next
request as that body. Close it after the response.
This commit is contained in:
yhirose committed 2026-10-16 16:39:00 -04:00
1 parent aaccde2122
commit 5d10305218
2 files changed
+63 -1

No files matched your search

+6 -1
View File
@@ -16596,8 +16596,13 @@ inline bool ClientImpl::process_request(Stream &strm, Request &req,
output_error_log(error, &req);
return false;
}
} else {
// A final response came first, so the body this request declared was
// never sent, and the server may still be waiting for it. The
// connection cannot carry another request.
std::lock_guard<std::mutex> guard(socket_mutex_);
socket_should_be_closed_when_request_is_done_ = true;
}
// If not 100 Continue, server returned an error; proceed with that response
}
// Body