http: don't parse any new requests from a client if m_req_busy = true

This commit is contained in:
Matthew Zipkin
2026-08-06 17:23:44 -04:00
parent c7db3ae1f9
commit 9954aa7728
2 changed files with 31 additions and 13 deletions

View File

@@ -1016,6 +1016,11 @@ void HTTPServer::ThreadSocketHandler()
void HTTPServer::MaybeDispatchRequestsFromClient(const std::shared_ptr<HTTPRemoteClient>& client) const
{
// If we are already handling a request from
// this client, do nothing. We'll check again on the next I/O
// loop iteration.
if (client->m_req_busy) return;
if (!client->m_req) {
client->m_req = std::make_unique<HTTPRequest>(client);
}
@@ -1048,12 +1053,7 @@ void HTTPServer::MaybeDispatchRequestsFromClient(const std::shared_ptr<HTTPRemot
return;
}
// If we are already handling a request from
// this client, do nothing. We'll check again on the next I/O
// loop iteration.
if (client->m_req_busy) return;
// Otherwise, if the request is ready, hand it to a worker.
// If the request is ready, hand it to a worker.
if (client->m_req->GetState() == HTTPRequest::State::Complete) {
LogDebug(
BCLog::HTTP,