Act nowcan affect a running systemAll 14 non-merge commits are covered; three merge commits need no separate entries. The raw payload contains no superseded_by data, so upgrade.still_moving is empty. Version include bookkeeping was ignored. The embedded unified diffs and the exact upstream declarations were used to verify the public HTTP, TLS and tunnel contracts.
Windows socket shutdowns stop touching reused handles
This edition fixes a high-risk Windows socket shutdown race, two tunnel concurrency and payload-limit problems, HTTP request-state initialization, Windows file-version decoding, and PDF clipping of empty EMF regions. Two public contracts need attention: custom INetTls implementations gain SocketClosed, and THttpRequestContext.ProcessInit is replaced by ResetZero.
TL;DR
- TCrtSocket.Abort and Close now coordinate on Windows so TLS teardown cannot use a closed SOCKET value that the OS has already reassigned.
- Tunnel handshake draining is serialized to remove a potential deadlock, while OpenDirect payloads may now reach 16 MB; threaded TCP frames remain capped at 64 KB.
- THttpRequestContext.ProcessInit is replaced by ResetZero, and THttpServerSocket.Create now initializes the new -1 sentinels.
- Windows file-version strings are decoded within their resource-entry length and without a trailing terminator.
- Empty EMF clip regions now emit a zero-area PDF path so following graphics stay clipped.
Upgrade advice
Land on the edition head e1158d2b7c9eab28a7b565f44812fec0d41e3679 (2.4.17982). Rebuild Delphi and FPC targets, add SocketClosed to any custom INetTls implementation, replace direct ProcessInit calls with ResetZero plus the appropriate State assignment, and stress Windows server shutdown, tunnel handshakes and OpenDirect large payloads.
14 of 14 entries · 17 commits upstream
1
High
HTTP request reset no longer chooses a state machine
THttpRequestContext.ProcessInit is removed and replaced by ResetZero, which only sets RangeLength and ContentLength to -1. Async client and server callers now assign hrsConnect or hrsGetCommand explicitly after resetting.
Breaking changes
mormot.net.async
128e2886+16-16
net: defined ResetZero to replace ProcessInit for HTTP state machine
Impact
Delphi/FPC code that directly calls ProcessInit will fail to compile. Replacement code must call ResetZero and set State to the correct client, server or custom state; framework-owned paths are updated in this edition.
Migration required
Search for THttpRequestContext.ProcessInit, replace each call with ResetZero, and assign State explicitly before processing input.
Public API
THttpRequestContext.ProcessInitremoved — Removed; callers must use ResetZero and select State themselves.THttpRequestContext.ResetZeroadded — Initializes RangeLength and ContentLength to -1 without changing State.
Units
2
High
Windows abort and TLS shutdown no longer reuse a closed SOCKET
TCrtSocket.Abort marks that Windows already called closesocket; Close then skips a second close and calls the new INetTls.SocketClosed hook. SChannel clears its socket and OpenSSL disables SSL_shutdown so neither sends close_notify through a stale, possibly reassigned handle.
Fixes
mormot.net.sock+2
38231157+248-2
net: TCrtSocket.Close won't reuse a socket handle closed by Abort on Windows
Impact
Stopping a Windows HTTP server with idle keep-alive TLS connections no longer risks WSAENOTSOCK or closing an unrelated connection after rapid SOCKET-value reuse. Delphi and FPC Windows backends benefit; custom INetTls implementations must add the new method.
Migration required
Upgrade Windows network servers. If you implement INetTls, add SocketClosed and make it suppress every later access to the OS socket; then test aborting blocked receives and TLS server shutdown.
Public API
INetTls.SocketClosedadded — Implementations must stop using the OS socket after this notification.TNetTlsContext.SocketClosedadded — Forwards the already-closed notification to the active TLS implementation.
3
High
Tunnel handshake draining no longer races socket workers
TTunnelLocal serializes handshake inspection under fSafe, lets TTunnelLocalThread drain queued frames after its handshake, and avoids a second OpenInternal drain for socket-bound workers. This removes competing drain paths.
Fixes
mormot.net.tunnel
7f646e33+15-9
net: fixed Tunnel potential deadlock when draining frames
Impact
Tunnel connections that buffer frames during handshake no longer risk a lock-order deadlock. The fix applies to Delphi and FPC tunnel servers and clients; public method signatures are unchanged.
Upgrade recommended
Upgrade tunnel deployments and stress simultaneous handshake completion, queued frames, disconnects and shutdown under load.
Units
4
Medium
Empty EMF regions now clip all following PDF content
TPdfEnum.ExtSelectClipRgn represents an empty EMF region as one zero-size PdfBox. PDF output now emits a real zero-area rectangle before the clip operator instead of a clip operator with no path.
Fixes
mormot.ui.pdf
ae4f9372+78-0
ui: pdf - an empty EMF clip region clips everything, with a valid path
Impact
PDFs generated from EMF input no longer leave bitmaps or text visible after an empty SelectClipRgn. Delphi and FPC PDF users get corrected rendering without source changes; the commit notes an unrelated existing FPC 3.2.2 Win32 test failure.
Worth a look
Regenerate representative EMF-based PDFs and compare empty or disjoint clip regions in the viewers you support.
Units
5
Medium
HTTP server sockets initialize request sentinels at construction
THttpServerSocket.Create now calls Http.ResetZero after constructing the socket. RangeLength and ContentLength therefore start at -1 while State remains hrsNoStateMachine until the owning server selects a processing path.
Fixes
mormot.net.server
1aeaa636+3-2
net: fixed THttpServerSocket.Create
Impact
Fresh Delphi/FPC HTTP server sockets no longer carry zero values where the request parser expects -1 sentinels. No source migration is needed unless application code inspects an unprocessed socket context.
Upgrade recommended
Take this with the ResetZero introduction and run HTTP startup, first-request, range and empty-body tests.
Units
6
Medium
Windows file-version reads stay inside each resource entry
The Windows version-resource path replaces a NUL-terminated Win32PWideCharToUtf8 read with Unicode_ToUtf8 using the length returned by VerQueryValue. A later same-day commit removes the included final terminator.
Fixes
mormot.core.os
4c535155+1-1
Fileversion reads behind end of an entry
Impact
Malformed or tightly packed version resources no longer let conversion scan behind the selected entry. Delphi and FPC Windows backends should take the edition head so the terminator follow-up is included.
Worth a look
Take this together with f957274521da5e82107d6384e0407bb14162e164 and test FileVersion on the application binaries you ship.
Units
7
Medium
Direct tunnels accept payloads up to 16 MB
mormot.net.tunnel splits frame limits by mode: OpenDirect application data may reach 16 MB plus authentication overhead, while handshake frames keep the 72 KB cap and threaded TCP application data remains limited to 64 KB.
New features
mormot.net.tunnel
74cfe56d+32-24
net: allow 16MB JPEG/KVM payload after TTunnelLocal.OpenDirect
Impact
Delphi/FPC applications using OpenDirect can send larger JPEG, KVM or other binary messages without chunking up to the new limit. TCP forwarding behavior does not change; oversized direct messages above 16 MB are still rejected.
Worth a look
Exercise boundary sizes around 64 KB and 16 MB in OpenDirect integrations, and keep chunking for threaded TCP mode.
Public API
TTunnelLocal.SendDatabehaviour-changed — Accepts application payloads up to 16 MB in direct mode; TCP mode remains capped at 64 KB.
Units
8
Low
File-version decoding drops the resource terminator
The Windows file-version reader treats the reported size as WideChar units including a possible final #0, subtracts that terminator, then passes the bounded length to Unicode_ToUtf8.
Fixes
mormot.core.os
f9572745+6-1
sz is in WideChars and includes the #0 terminator, if any
Impact
Delphi and FPC Windows callers receive the same version text without an embedded trailing NUL. No API or build change is required.
Units
9
Low
i386 SynLZ decompression removes one branch
The i386 assembly decompressor replaces a compare-and-branch cap with a CMOVA instruction when limiting the copy length. No data format or Pascal declaration changes.
Performance
mormot.core.compress
f3ebf1bf+17-18
core: minor SynLZ decompression optimization on i386 asm
Impact
Only 32-bit x86 SynLZ decompression may become marginally faster. Delphi/FPC applications need no source change, and other architectures are unaffected.
Units
10
Low
WebSocket broadcast tests wait for slow connection registration
The WebSocket broadcast regression test records the connected handle and waits up to five seconds for ConnectionFind to see it before broadcasting. This closes a test race observed on slow Raspberry Pi systems.
Tests
c1ea434d+14-2
tests: fixed WS broadcast logic on slow RPi (LUTI)
Impact
Production WebSocket behavior and public APIs do not change. CI and local Delphi/FPC test runs on slower hardware should become less flaky.
11
Low
SSSE3 numeric tests now check the right CPU feature
test.core.base changes the guard for SSSE3 numeric routines from cfSSE3 to cfSSSE3. The accompanying tunnel edits are comments and shutdown-order clarification only.
Tests
mormot.net.tunnel
e1158d2b+7-8
tests: fixed SSE3/SSSE3 confusion
Impact
Application code is unchanged. Test runs no longer invoke SSSE3-only instructions on CPUs that expose SSE3 but not SSSE3; Delphi and FPC runtime paths are unaffected.
Units
12
Low
PDF empty-clip failures now report formatted context
TTestUiPdf.EmfEmptyClip replaces Check plus a preformatted string with CheckUtf8 and its format arguments. Test conditions and production PDF code are unchanged.
Tests
fc00e4c8+5-5
tests: EmfEmptyClip reports through CheckUtf8()
Impact
Only diagnostic output from the test suite changes. Delphi/FPC application behavior is unaffected.
13
Low
Tunnel documentation now describes direct endpoints and ownership
The security guide and Pascal comments are reorganized around OpenDirect, SendData, TTunnelSocketTransmit ownership, plaintext-versus-relay frames, and the lifetime of the TCP worker and cryptographic state. Executable statements are unchanged.
Docs
mormot.net.tunnel
a668f1d2+115-102
net: fixed Tunnel documentation after OpenDirect() introduction
Impact
There is no runtime or source impact for Delphi/FPC applications. Maintainers of custom ITunnelTransmit adapters gain clearer ownership and frame-format guidance.
Units
14
Low
File-version result casing is normalized
A local result identifier in the Windows file-version code changes from res to Res. Pascal is case-insensitive, so emitted code and behavior remain identical.
Housekeeping
mormot.core.os
b60e0a8c+1-1
Uppercase writing correction
Impact
There is no application impact for Delphi or FPC and no action is needed.