Details
-
Task
-
Resolution: Fixed
-
P1: Critical
-
6.9, 6.10
-
None
-
21
-
7c6ff5fab (dev), 2db3fbb5f (6.9), 242fe6c9c (6.8), 807b0f34f (dev), 8abc9a4ec (dev), fdc52d19a (dev), f242e8b11 (dev)
-
Foundation Sprint 125, Foundation Sprint 126, Foundation Sprint 127, Foundation Sprint 128, Foundation Sprint 129
Description
The QHttpServerRequest object is not copyable because it serves as both the parser and the request class. However, using QConcurrent::run() for route handlers that return QFuture<QHttpServerResponse> introduces a race condition. The afterRequestHandlers must retain the previous request state, but since only one request object is instantiated (in QHttpServerHttp[12]ProtocolHandler classes), it may be overwritten by other requests before afterRequestHandlersare executed.
Making QHttpServerRequest copyable would allow passing copies of request objects instead of duplicating individual components during QConcurrent::run() invocations. To achieve this, extract the parser state into a private QHttpServerParser class and make QHttpServerRequest copyable.