Act nowcan affect a running system
libcurl ABI and Windows IOCP reliability are repaired
This batch repairs two production-facing network paths: libcurl’s C ABI, especially on AArch64, and the Windows IOCP accept lifecycle. It also changes several public callback and cryptographic context declarations, so Delphi and FPC applications with low-level integrations should recompile and check the named symbols. ISO-8601 fractional-second parsing and several pure-Pascal hot paths receive focused fixes and optimizations.
TL;DR
- Use build 2.4.17634 for the complete Windows IOCP accept and shutdown repair sequence.
- libcurl C long values and callback sizes now use ABI-correct types, with the largest impact on AArch64.
- TOnHttpProxyServerRequest gains a ProxyUrl argument and existing callback methods must be updated.
- AES, SHA-1/SHA-2 and SHA-3 context storage is now typed; three public size constants disappear.
- ISO-8601 fractions with one or two digits now map correctly to 100 ms and 10 ms units.
- TBigInt.Square, SynLZ and numeric formatting receive Delphi/FPC performance work without format changes.
Upgrade advice
Land on build 2.4.17634 rather than an intermediate IOCP or linger revision. Recompile libcurl callbacks and proxy handlers, replace AES_CONTEXT_SIZE, SHA_CONTEXT_SIZE and SHA3_CONTEXT_SIZE with SizeOf of their typed records, then exercise AArch64 libcurl, Windows IOCP overload/shutdown and ISO-8601 parsing on every Delphi/FPC target you ship.
23 of 23 entries · 23 commits upstream
1
High
libcurl bindings use ABI-correct scalar and callback widths
mormot.lib.curl adds TCurlLong, changes read/write callback sizes and results to PtrUInt, types global flags and timeouts as C long, and wraps varargs easy_setopt/share_setopt plus long-valued easy_getinfo calls.
Breaking changes
mormot.lib.curl+1
071b81b4+181-67
lib: fixed libcurl ABI especially on aarch64
Impact
AArch64 and other 64-bit POSIX builds stop truncating size_t and C long values at the libcurl boundary. Custom callbacks or direct TLibCurl field access may no longer compile until signatures are updated.
Migration required
Recompile every libcurl target; update custom read/write callbacks to PtrUInt sizes/results and use the typed TLibCurl wrappers instead of raw varargs fields.
Public API
TCurlLongadded — Represents C long as 32-bit on Windows and pointer-sized on POSIX.curl_write_callback/curl_read_callbacksignature-changed — size, count and result values now use PtrUInt to match size_t.TLibCurl.easy_setoptsignature-changed — Raw varargs storage is private-named and public calls use typed overloads.
2
High
Windows IOCP setup closes failed accept sockets deterministically
Windows SetLinger restores l_onoff for non-negative values, IOCP subscription resets linger, and failed IocpCreate or AcceptEx preparation paths release their subscription or accept socket.
Fixes
mormot.net.sock+1
b7312847+43-24
net: fixed Windows IOCP/linger calls
Impact
Windows services avoid stale linger settings and leaked accept resources during IOCP setup failures; this directly affects long-running asynchronous servers.
Upgrade recommended
Upgrade through build 2.4.17634 and test repeated bind, accept failure and shutdown cycles on Windows.
3
High
Socket close and linger now follow each platform’s failure rules
TNetSocketWrap.Close and SetLinger move into POSIX and Windows implementations: POSIX avoids retrying close after EINTR, Darwin uses its SO_LINGER value, and Windows retries WSAEWOULDBLOCK after disabling linger.
Fixes
mormot.net.sock+2
71d679fb+48-15
net: rewritten TNetSocketWrap.Close/SetLinger methods
Impact
Socket shutdown reports real POSIX close errors without risking a reused descriptor and can recover from a blocking Windows close; network behavior changes without an API signature change.
Upgrade recommended
Use build 2.4.17634 and rerun graceful and forced shutdown tests on Windows, Linux and Darwin.
Public API
TNetSocketWrap.Closebehaviour-changed — Close now returns platform errors and has platform-specific recovery rules.
4
High
Async server shutdown no longer tears down live IOCP state
TAsyncServer shutdown now terminates only the IOCP accept queue, and DoExecute separates overload rejection, termination and nil-client error paths before closing a socket.
Fixes
mormot.net.async
c35132cf+28-33
net: some async server logic fixes
Impact
Windows asynchronous servers avoid unsubscribing shared IOCP state during shutdown and avoid invalid client closes while overloaded; Delphi and FPC application APIs are unchanged.
Upgrade recommended
Use build 2.4.17634 and test shutdown while accept operations and connection limits are active.
Units
5
High
Failed IOCP re-arming no longer leaks an accepted connection
TAsyncServer.DoExecute always posts the next AcceptEx after a completion and closes the accepted socket when re-arming or MakeAsync fails; TLS setup remains blocking until initialized.
Fixes
mormot.net.async+1
83116892+37-13
net: fixed IOCP accept failure
Impact
Windows IOCP servers keep accepting after individual setup failures and release failed clients instead of leaking descriptors or stalling the accept pipeline.
Upgrade recommended
Upgrade through build 2.4.17634 and exercise failed TLS initialization and forced AcceptEx errors.
6
High
IOCP accept errors now release both the socket and queue lock
TWinIocp.GetNextAccept initializes its output socket to nil and routes invalid state, address extraction and SO_UPDATE_ACCEPT_CONTEXT failures through AcceptSocketCloseAndUnlock.
Fixes
mormot.net.sock.windows
19d3bcef+16-8
net: fixed TWinIocp.GetNextAccept against errors
Impact
Windows backends avoid descriptor leaks and a retained accept lock when completion data is invalid or the accepted socket cannot inherit its listener context.
Upgrade recommended
Use build 2.4.17634 and include forced SO_UPDATE_ACCEPT_CONTEXT failure in Windows network tests.
7
Medium
TAes now owns its typed key schedule and state directly
The hidden implementation-only TAesContext is folded into public TAes fields, AES_CONTEXT_SIZE is removed, block constants are renamed to AES_SHIFT and AES_MOD, and KeyBits becomes a field.
Breaking changes
mormot.crypt.core+1
e421a7ea+328-376
crypt: removed TAesContext confusing structure
Impact
Applications that used AES_CONTEXT_SIZE or depended on the binary layout must migrate and recompile; normal TAes method calls retain their source-level behavior.
Migration required
Replace AES_CONTEXT_SIZE with SizeOf(TAes), replace AesBlockShift/AesBlockMod if referenced, and rebuild all modules sharing TAes records.
Public API
AES_CONTEXT_SIZEremoved — Typed TAes storage replaces the opaque byte-size constant.AesBlockShift/AesBlockModrenamed — The constants are now AES_SHIFT and AES_MOD.
8
Medium
SHA-3’s raw Keccak context becomes a public typed record
mormot.crypt.core publishes TSha3Context, PSha3Context and Keccak size constants, stores TSha3 state in that record, and removes SHA3_CONTEXT_SIZE.
Breaking changes
mormot.crypt.core+1
c771bc8a+54-59
crypt: made TSha3Context public
Impact
Code that allocates buffers with SHA3_CONTEXT_SIZE no longer compiles; low-level users can now name and operate the SHA-3 context directly on Delphi and FPC.
Migration required
Replace SHA3_CONTEXT_SIZE with SizeOf(TSha3Context) and review any code that depended on opaque TSha3 storage.
Public API
TSha3Contextadded — The raw SHA-3/Keccak state and methods are now public.SHA3_CONTEXT_SIZEremoved — Use SizeOf(TSha3Context) for typed context storage.
9
Medium
SHA-1 and SHA-2 share a public typed context
mormot.crypt.core publishes TShaContext, replaces the opaque byte arrays inside TSha1 and TSha256 with that record, and removes SHA_CONTEXT_SIZE.
Breaking changes
mormot.crypt.core
e2cd4cb4+32-47
crypt: made TShaContext public
Impact
Code referring to SHA_CONTEXT_SIZE stops compiling; low-level Delphi/FPC integrations can now allocate or inspect the shared SHA state by type.
Migration required
Replace SHA_CONTEXT_SIZE with SizeOf(TShaContext); recompile code that embeds TSha1 or TSha256 in fixed layouts.
Public API
TShaContextadded — The shared SHA-1/SHA-2 state record is now public.SHA_CONTEXT_SIZEremoved — Use SizeOf(TShaContext) instead of the removed byte count.
Units
10
Medium
HTTP proxy callbacks receive their matched proxy configuration
TOnHttpProxyServerRequest gains a ProxyUrl: THttpProxyUrl parameter. Callback sources take precedence over Source configuration, and OnExecute passes the matched route object after method and reject checks.
Breaking changes
mormot.net.async
4cec12d3+16-17
net: enhanced THttpProxyServer callback support
Impact
Existing object methods assigned as proxy callbacks no longer match the declaration and must accept the fourth parameter; callbacks can now inspect their route configuration directly.
Migration required
Search for TOnHttpProxyServerRequest and OnRequest handlers, then add ProxyUrl: THttpProxyUrl to every method signature.
Public API
TOnHttpProxyServerRequestsignature-changed — A fourth ProxyUrl: THttpProxyUrl argument identifies the matched route.
Units
11
Medium
Short ISO-8601 fractions now scale to milliseconds correctly
A shared Iso8601FractionToMS helper makes .1 mean 100 ms, .13 mean 130 ms and truncates longer fractions to three digits in date-time and time-only parsers.
Fixes
mormot.core.datetime
fdb335f8+50-21
core: fixed millisecond time parsing
Impact
Backends parsing one- or two-digit fractional seconds no longer produce values ten or one hundred times too small; serialized input and function signatures are unchanged.
Upgrade recommended
Upgrade and add cases for .1, .13, .123 and longer fractions to ISO-8601 ingestion tests.
Units
12
Medium
SetLinger becomes a best-effort shutdown operation
TNetSocketWrap.SetLinger calls setsockopt directly, clamps negative values for the POSIX linger field and no longer raises during shutdown; POSIX still enables address/port reuse for positive linger.
Fixes
mormot.net.sock+2
eb342ae9+7-6
net: fixed TNetSocketWrap.SetLinger behavior
Impact
Socket cleanup no longer turns a failed linger option into an exception, changing failure handling on Windows and POSIX without requiring application source changes.
Upgrade recommended
Take the completed socket sequence in build 2.4.17634 and verify any code that previously caught SetLinger exceptions.
Public API
TNetSocketWrap.SetLingerbehaviour-changed — setsockopt failure is now ignored as best effort instead of raising.
13
Medium
libcurl form fields finish moving to C long widths
TCurlLong uses integer on Windows and PtrInt on POSIX, while TCurlHttpPost name, content, buffer lengths and flags all switch to TCurlLong; an extra TBigInt.Square ownership test is added.
Compiler & platform
mormot.lib.curl+1
bb92b883+17-8
lib: minor cleaning after previous commits
Impact
The libcurl record layout now matches C long on LLP64 Windows and LP64 POSIX, completing the preceding ABI repair for Delphi and FPC callers.
Upgrade recommended
Use at least build 2.4.17618 for the completed TCurlHttpPost layout, and prefer the edition endpoint 2.4.17634.
14
Low
SynLZ’s Pascal compression pass is split into a typed context
A TSynLzContext record and SynLZcompress1passub helper reorganize SynLZcompress1pas state so Delphi and FPC can generate tighter pure-Pascal code.
Performance
mormot.core.base
30287319+112-107
core: enhanced SynLZcompress1pas() pure pascal version
Impact
Compression format and APIs do not change; non-assembly targets may see faster compression after the internal state and loop refactor.
Units
15
Low
TBigInt.Square gets dedicated diagonal assembly helpers
ARM32, ARM64, x86 and x64 add _xasmsquarediagonal, and TBigInt.Square computes off-diagonal products before combining doubled terms with diagonal squares in one pass.
Performance
mormot.core.base+2
08ea9628+122-27
crypt: slightly optimized TBigInt.Square with proper asm
Impact
Large integer squaring used by RSA becomes faster across Delphi/FPC CPU targets; arithmetic results and public method signatures stay unchanged.
16
Low
Numeric and date formatting replace divisions with reciprocal math
Core numeric writers add reciprocal division-by-ten paths and wider stores across integer text conversion, Gregorian/ISO formatting, log timestamps and TBigInt.IntDivMod10.
Performance
mormot.core.base+2
f0a6942d+69-56
core: enhanced numbers to text conversion routine
Impact
Common formatting and big-integer decimal conversion can execute faster on Delphi/FPC targets; emitted text and public APIs are intended to remain identical.
17
Low
Pure-Pascal SynLZ copies larger chunks with less setup
The Pascal SynLZ compressor skips offset-table clearing for short inputs, while decompression introduces MoveByPtr and pointer-sized copy paths for matches.
Performance
mormot.core.base
9c55b5c6+53-67
core: optimized SynLZ compression/decompression in pure pascal
Impact
Delphi and FPC targets using the fallback implementation can compress and decompress faster; the SynLZ wire format and public functions remain unchanged.
Worth a look
Run existing SynLZ corpus and cross-version round-trip tests on targets that use pure Pascal.
Units
18
Low
Hash-table adjustment exposes a better Pascal code-generation shape
DynArrayHashTableAdjust stores the shifted hash value in a local variable before masking and writing it back, helping ARM-oriented Delphi/FPC code generation.
Performance
mormot.core.base
1b025768+27-21
core: optimized DynArrayHashTableAdjust() pure pascal code
Impact
Dynamic-array hash-table maintenance may compile to fewer instructions on pure-Pascal targets; application behavior and public APIs do not change.
Units
19
Low
ISO fraction parsing removes repeated digit-range checks
Iso8601FractionToMS reuses unsigned digit offsets while parsing the first three fractional digits, reducing comparisons after the preceding correctness fix.
Performance
mormot.core.datetime
e00d96b1+13-8
core: slightly optimized previous commit
Impact
Delphi/FPC ISO-8601 parsing keeps the corrected millisecond semantics with slightly less work; there is no public API change.
Units
20
Low
Internal records avoid forced packing where alignment is safe
Several internal records in interfaces, logging, task queues and ZIP handling drop packed, while TSynLogThreadInfo retains conditional packing and tests assert fundamental record sizes.
Compiler & platform
mormot.core.interfaces+3
995b4338+13-13
core: avoid "packed record" definition unless really needed
Impact
Compiler-native alignment is restored on affected Delphi/FPC targets; these records are used internally and application code should not require changes.
21
Low
SynLZ’s Pascal compressor uses exact-width length stores
SynLZcompress1pas replaces wider PInteger writes with PWord stores for two-byte length fields and consolidates the final pure-Pascal compressor cleanup.
Under the hood
mormot.core.base
2bae6951+14-15
core: final SynLZ code cleanup
Impact
Compressed stream format and public calls stay unchanged; Delphi and FPC builds receive narrower, clearer memory writes in the fallback implementation.
Units
22
Low
Big-integer squaring gains boundary and ownership tests
The crypto test suite compares TBigInt.Square with multiplication across empty, single-limb, multi-limb, random and shared/unshared storage cases, including RSA-related buffers.
Tests
mormot.crypt.core+1
85e4b8d6+97-5
tests: validate TBigInt.Square algorithm
Impact
No application code changes; the optimized square implementation receives broader regression coverage for Delphi/FPC ownership and arithmetic boundaries.
23
Low
Record alignment and support-tool cleanup follow the crypto refactor
TSynLogThreadInfo packing is restricted to Intel, TSynHasher stores TSha3 directly, Windows linger logic is adjusted, and mget simplifies its output-path initialization.
Housekeeping
mormot.core.log+2
ebaba4a4+8-9
all: small fixes and refactoring
Impact
This is mostly internal alignment and cleanup; the temporary Windows linger change is completed by the later IOCP/linger fix in build 2.4.17628.