mORMot2 DailyDaily read of upstream commits

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.

Commits6
Lines+370 -28
Read2 min

3 of 3 entries · 6 commits upstream

Stories
# Entry Category Units
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.

Public API

  • THttpRequestContextState.hrsGetBodyChunkedDataLastLineadded — The public state enumeration now distinguishes trailer consumption after the zero-size chunk.

zen010101 · 05:52 UTC · view the commit on GitHub →

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.

zen010101 · 06:32 UTC · view the commit on GitHub →

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.

zen010101 · 06:35 UTC · view the commit on GitHub →

Upstream activity commits per day · last 60 days
Commits1007
Active days49/60
Busiest2026-09-30
Peak60
2026-09-30: 60 commits2026-10-01: 26 commits2026-10-02: 30 commits2026-10-03: 32 commits2026-10-04: 15 commits2026-10-05: 1 commit2026-10-06: 26 commits2026-10-07: 37 commits2026-10-08: 27 commits2026-10-09: 35 commits2026-10-10: 12 commits2026-10-11: 2 commits2026-10-12: 40 commits2026-10-13: 31 commits2026-10-14: 23 commits2026-10-15: 16 commits2026-10-16: 27 commits2026-10-17: 0 commits2026-10-18: 0 commits2026-10-19: 0 commits2026-10-20: 0 commits2026-10-21: 0 commits2026-10-22: 3 commits2026-10-23: 6 commits2026-10-24: 29 commits2026-10-25: 7 commits2026-10-26: 25 commits2026-10-27: 4 commits2026-10-28: 8 commits2026-10-29: 17 commits2026-10-30: 20 commits2026-10-31: 0 commits2026-11-01: 0 commits2026-11-02: 16 commits2026-11-03: 32 commits2026-11-04: 15 commits2026-11-05: 32 commits2026-11-06: 26 commits2026-11-07: 19 commits2026-11-08: 2 commits2026-11-09: 29 commits2026-11-10: 17 commits2026-11-11: 8 commits2026-11-12: 38 commits2026-11-13: 39 commits2026-11-14: 9 commits2026-11-15: 6 commits2026-11-16: 21 commits2026-11-17: 30 commits2026-11-18: 37 commits2026-11-19: 28 commits2026-11-20: 31 commits2026-11-21: 0 commits2026-11-22: 0 commits2026-11-23: 1 commit2026-11-24: 6 commits2026-11-25: 3 commits2026-11-26: 3 commits2026-11-27: 0 commits2026-11-28: 0 commits
2026-09-302026-11-28