Worth a looka fix or feature you may want
Chunked HTTP trailers no longer desynchronize persistent connections
The HTTP readers now consume chunk trailers through their terminating empty line, preserving pipelined input and rejecting malformed chunk delimiters. This matters to Delphi and FPC services receiving chunked requests, and to clients reading chunked responses on persistent connections. Two smaller API additions let network code accept informational responses explicitly and write without automatic connection closure.
TL;DR
- THttpRequestContext.ProcessRead and THttpSocket.GetBody now consume all chunk trailers before completing a body.
- THttpRequestContext.ParseResponse can opt into HTTP 100–199 status codes while its default behaviour remains unchanged.
- TAsyncConnectionsSockets.WriteNoClose is now public for callers that must own connection cleanup after a failed write.
Upgrade advice
For services that accept chunked traffic, land on merge revision ead6470c0c4abba78c11ca8bc157e5cfee804972 at build 18232 rather than stopping before the trailer fix. No non-merge commit in the raw payload has a superseded_by successor, so no later same-routine correction or build range to avoid is identified.
3 of 3 entries · 6 commits upstream
1
Medium
Chunk trailers are fully drained before the next HTTP message
In mormot.net.http, THttpRequestContext.ProcessRead gains hrsGetBodyChunkedDataLastLine and remains in that state until the empty line after all trailer fields. It counts discarded trailer lines and CRLF bytes against MaxHttpHeaderLineSize, rejects non-empty chunk delimiters, and leaves pipelined input untouched. THttpSocket.GetBody applies the same delimiter validation and drains every trailer line without adding it to headers or body content. Tests cover THttpServer, THttpAsyncServer, keep-alive, async pipelining, split CRLF input, malformed delimiters and the size boundary.
Fixes
mormot.net.http
028f7dec+141-7
net: consume chunk trailers before completing HTTP bodies
Impact
Before this fix, a chunked request or response carrying trailer fields could finish at the first trailer line, leaving bytes to interfere with the next message on a persistent or pipelined connection. Delphi and FPC backends using THttpServer or THttpAsyncServer, and clients using THttpSocket.GetBody, now preserve message boundaries and reject malformed delimiters. Application code and legitimate body content do not need to change.
Upgrade recommended
Upgrade to build 18232 at ead6470c0c4abba78c11ca8bc157e5cfee804972 if the service accepts chunked requests, uses keep-alive or pipelining, or reads chunked responses with THttpSocket.GetBody. Retest any proxy or client that emits trailer fields.
Public API
THttpRequestContextState.hrsGetBodyChunkedDataLastLineadded — The public state enumeration now distinguishes trailer consumption after the zero-size chunk.
Units
2
Low
Response parsing can explicitly accept informational HTTP statuses
In mormot.net.http, THttpRequestContext.ParseResponse adds the optional AllowInformational parameter. Its default false value keeps the accepted range at 200 through 599; true lowers the minimum to 100 so callers can parse 100 Continue, 101 Switching Protocols, 103 Early Hints and other 1xx responses. Boundary tests cover 99, 100, 101, 103, 200, 599 and 600.
New features
mormot.net.http
b0266a64+31-4
net: allow informational status codes in THttpRequestContext.ParseResponse
Impact
Existing Delphi and FPC callers retain the previous behaviour because the new argument defaults to false. Proxy, gateway or protocol code that needs to forward informational responses can pass true instead of implementing a separate status-line parser. No migration is required.
Public API
THttpRequestContext.ParseResponsesignature-changed — The signature is now ParseResponse(out RespStatus: integer; AllowInformational: boolean = false): boolean.
Units
3
Low
Asynchronous writers can retain ownership after a failed send
In mormot.net.async, the existing TAsyncConnectionsSockets.WriteNoClose method moves from protected to public visibility. It writes or queues data under the connection write lock and, unlike Write, does not close the connection when the operation fails. The documentation states that the caller owns cleanup and that AfterWrite may run synchronously while the lock is held; a WebSocket test calls the public method on a live connection.
New features
mormot.net.async
4cf3de92+13-3
net: make TAsyncConnectionsSockets.WriteNoClose public
Impact
Existing asynchronous servers keep their current behaviour because no implementation changed. New Delphi and FPC code can use WriteNoClose when another connection or higher-level owner must decide how to close after failure. Callers must avoid assuming that failure performs cleanup, and callbacks must tolerate running inside the write lock.
Public API
TAsyncConnectionsSockets.WriteNoCloseadded — The existing method is newly public; its implementation and failure semantics are unchanged.