Act nowcan affect a running system
HTTP decompression gains output limits and clearer rejection responses
HTTP decoders receive an output limit and the socket servers distinguish malformed bodies, oversized payloads and spool write errors. FastCGI gains an optional front controller, while high-level web server types move into mormot.net.proxy. Custom decoder callbacks and imports may need source changes.
TL;DR
- THttpSocketCompress callbacks must accept MaxSize and enforce it during decompression.
- Take the zlib flush fix with the initial stream output-cap change.
- High-level TWebServer types now come from mormot.net.proxy.
- FastCgiIndex opts a FastCGI route into static-file serving and index fallback.
Upgrade advice
Evaluate the complete historical 2.4.18198 batch rather than the first MaxSize commit alone. Update custom THttpSocketCompress callbacks, replace EHttpSocketOverflow catches and import mormot.net.proxy for moved types. The payload lists no superseded_by links; this build identifies the day's snapshot, not a guarantee against later fixes.
24 of 24 entries · 28 commits upstream
1
High
HTTP compression callbacks must accept an output limit
THttpSocketCompress gains MaxSize: PtrUInt; THttpRequestContext.UncompressData passes an in-memory limit to the registered decoder and checks the returned length too.
Breaking changes
mormot.net.http+1
22b53335+24-26
net: new THttpSocketCompress prototype definition
Impact
Custom Delphi/FPC callbacks must match the new type and honor the bound during decompression; a check after decoding cannot prevent peak allocation.
Migration required
Find custom THttpSocketCompress implementations and add MaxSize: PtrUInt; enforce nonzero limits in the decoder and test HTTP 413.
Public API
THttpSocketCompresssignature-changedCompressShaAessignature-changedTHttpRequestContext.UncompressDatabehaviour-changed
2
High
Async HTTP reports decompression and storage failures separately
The async request path rejects size overflows with 413, malformed compression with 400 and spool write failures with 507; the change also centralizes payload counters.
Fixes
mormot.net.async+2
4488f0d6+41-36
net: fixed async server error handling
Impact
Delphi/FPC backends can distinguish bad input from local storage trouble without routing a malformed body to the application handler.
Worth a look
3
High
Checked SynLZ decoding verifies data before returning it
CompressSynLZ validates encoded input, checks the decoded size against MaxSize before allocation and uses a bounded decode plus an output hash check.
Fixes
mormot.core.base
6dc27f25+45-30
core: rewritten CompressSynLZ()
Impact
Delphi/FPC callers gain controlled failure on invalid data or size overflow. The later ESynLZ commit changes the class used for malformed data.
Worth a look
Public API
ESizeOverflowaddedCompressSynLZsignature-changed
Units
4
High
The zlib stream limit is checked before output is written
TZLib.DoFlush counts actual emitted bytes and raises ESizeOverflow before writing a chunk that would exceed MaxSize, including the final flush.
Fixes
mormot.lib.z
beb1f0fd+10-10
lib: fixed MaxSize support in TZLib
Impact
Bounded decompression in Delphi/FPC no longer relies on the earlier zlib counter calculation; already written bytes are not rolled back.
Worth a look
Public API
TZLib.DoFlushsignature-changed
Units
5
Medium
High-level web server types move into the proxy unit
TWebServerGlobal, TWebServerLocal, their configuration types and associated declarations move from mormot.net.http to mormot.net.proxy.
Breaking changes
mormot.net.http+1
19300ad5+571-564
net: moved High Level Web Server Definitions to mormot.net.proxy
Impact
Delphi/FPC units that depended on the old import for these types must add mormot.net.proxy; lower-level HTTP types remain in mormot.net.http.
Migration required
Add mormot.net.proxy to uses where you reference TWebServerGlobal, TWebServerLocal or their configuration types, and update any unit-qualified references.
Public API
mormot.net.http.TWebServerGlobalremovedmormot.net.proxy.TWebServerGlobaladdedmormot.net.http.TWebServerLocalremovedmormot.net.proxy.TWebServerLocaladdedmormot.net.http.TWebServerBehaviorremovedmormot.net.proxy.TWebServerBehavioradded
6
Medium
HTTP overflow handling switches to the shared size exception
The HTTP unit removes EHttpSocketOverflow and raises ESizeOverflow for chunked size limits; server paths use it to identify oversized requests.
Breaking changes
mormot.net.http+1
7e1d8f43+29-36
net: replaced EHttpSocketOverflow by ESizeOverflow
Impact
Custom Delphi/FPC handlers naming the old class must update their catches; the server reports these request failures as HTTP 413.
Migration required
Replace catches of EHttpSocketOverflow with ESizeOverflow from mormot.core.base and verify your HTTP 413 handling.
Public API
EHttpSocketOverflowremovedTHttpSocket.GetBodybehaviour-changed
7
Medium
Accept throttling counts only work still queued
TAsyncServer.DoExecute uses Pending rather than PendingCount for its accept throttle, excluding events that read workers already consumed.
Fixes
mormot.net.async
cb118a65+120-1
net: TAsyncServer accept() should only count the pending events
Impact
The non-IOCP server avoids throttling new connections based on events that are no longer waiting.
Worth a look
Units
8
Medium
Blocking HTTP body failures clean up temporary streams
THttpServerSocket.DownloadBody consolidates memory and stream retrieval, calls ProcessDone on failure and reports a stream write failure as 507.
Fixes
mormot.net.server
3d9eaad2+21-46
net: simplified THttpServerSocket body retrieval
Impact
Blocking Delphi/FPC servers clean up failed body spools rather than keeping them through request processing.
Units
9
Medium
Gzip, deflate and zlib wrappers accept bounded decoding
CompressGZip, CompressDeflate and CompressZLib add optional MaxSize; gzip checks the declared size and TGZRead.ToMem can raise a caller-selected exception on invalid output.
Fixes
mormot.core.zip
d1463a9e+35-20
core: enhanced CompressGZip/CompressDeflate/CompressZLib
Impact
Delphi/FPC services can cap decoder output and should handle decoding exceptions for bad input rather than relying on the former failure result.
Worth a look
Public API
CompressGZipsignature-changedCompressDeflatesignature-changedCompressZLibsignature-changedTGZRead.ToMemsignature-changed
Units
10
Medium
Quoted include paths keep their hash character
TPreproc.DoInclude recognizes comment markers only for unquoted paths; DoRegister checks the character before a marker when registering values.
Fixes
mormot.core.fmt
a4225728+38-9
core: some TPreProc comments parsing fixes
Impact
Delphi/FPC configuration tooling can include filenames containing a quoted hash, and the regression cases preserve markers joined to macro values.
Worth a look
Units
11
Medium
The common HTTP rejection body recognizes size overflow
ComputeRejectBody takes an optional Exception, maps exact ESizeOverflow to 413 and includes exception-class context for other failures.
Fixes
mormot.net.server+1
8f3571e7+13-9
net: enhanced THttpServerSocketGeneric.ComputeRejectBody
Impact
Clients may see a more specific rejection status or a different HTML body; tests that match the exact body should account for it.
Worth a look
12
Medium
Async HTTP rejections share exception handling
THttpAsyncServerConnection.DoReject accepts an exception and passes it to ComputeRejectBody; decompression errors now use that common route.
Fixes
mormot.net.async
f4f43caa+7-12
net: refined THttpAsyncServer error handling
Impact
Async servers use the same rejection formatting and overflow classification as other socket HTTP paths.
Units
13
Medium
Invalid SynLZ data gets a dedicated exception class
CompressSynLZ now raises ESynLZ, an ExceptionWithProps subclass, for invalid input or output; ESizeOverflow still identifies a size limit.
Fixes
mormot.core.base+1
11be5249+9-7
core: new ESynLZ exception class
Impact
Delphi/FPC code catching EReadError specifically for CompressSynLZ must account for ESynLZ instead.
Worth a look
Public API
ESynLZaddedCompressSynLZbehaviour-changed
14
Medium
macOS async reads keep data reported with a close event
TPollAsyncSockets.ProcessRead takes the immediate close branch only when pseClosed is present without pseRead.
Fixes
mormot.net.async
9d39b366+4-3
net: fixed TPollAsyncSockets.ProcessRead for MacOS
Impact
macOS async servers can process readable bytes when the poller reports both readability and closure in one notification.
Worth a look
Units
15
Medium
Closing a FastCGI connection records its closed state
TFastCgiAsyncConnection.OnClose calls the inherited method before attempting its fallback HTTP error response.
Fixes
mormot.net.proxy
99870a6c+3-2
net: TFastCgiAsyncConnection.OnClose did not call inherited OnClose
Impact
The inherited close marks the connection so destruction no longer invokes OnClose a second time on that path.
Units
16
Medium
FastCGI routes gain an optional front controller
FastCgiIndex adds index-script fallback and static files for GET/HEAD. FastCgiAppendParams also accepts ScriptExt for matching script paths.
New features
mormot.net.proxy
29820f93+260-33
net: front controller support for fcgi:// Sources with THttpProxyUrlSettings.FastCgiIndex
Impact
Opt-in Delphi/FPC proxies can serve static assets or forward dynamic paths. The source directory must also be accessible to the proxy at the configured path.
Worth a look
Public API
THttpProxyUrlSettings.FastCgiIndexaddedFastCgiAppendParamssignature-changed
Units
17
Medium
Trusted in-process buffers get separate SynLZ helpers
SynLZComp and SynLZDecomp expose raw compression and decompression using the internal SynLZ representation without the wrapper hashes.
New features
mormot.core.base
d2777817+63-27
core: new SynLZDecomp/SynLZComp functions
Impact
Delphi/FPC code can use this pair for its own trusted buffers; SynLZDecomp does not validate hostile input and is not a replacement for checked decoding.
Worth a look
Public API
SynLZCompaddedSynLZDecompadded
Units
18
Medium
Stream and string zlib decompression gain an optional size cap
UncompressStream and the pointer overload of UncompressZipString add MaxSize; the POSIX caller separately clears invalid compressed info data on exception.
New features
mormot.lib.z+1
318bbaf8+18-11
lib: optional MaxSize parameter to stream decompression
Impact
Use the later TZLib.DoFlush correction with this new API so the bound is based on bytes actually produced.
Worth a look
Public API
UncompressStreamsignature-changedUncompressZipStringsignature-changed
19
Low
NCrypt length errors use correctly formatted diagnostics
TNCrypt.GetCardinal, GetBuffer and KeySign use integer format placeholders for unexpected lengths.
Fixes
mormot.lib.sspi
c3c8d04f+5-5
lib: fixed some SSPI exception defintions
Impact
Windows Delphi/FPC applications receive corrected failure messages; successful cryptographic operations are unchanged.
Units
20
Low
Windows socket peeking no longer overwrites the pending-byte count
TCrtSocket.SockReceivePending passes a dedicated byte to recv with MSG_PEEK instead of passing the address of the count variable.
Fixes
mormot.net.sock
d3941660+4-1
net: TCrtSocket.SockReceivePending on Windows peeks into a separate byte
Impact
On the Windows path the probe no longer writes into the byte-count variable it uses to report pending data.
Units
21
Low
Report pages use the lightweight in-memory SynLZ path
TGdiPages uses SynLZComp and SynLZDecomp for internal metafile storage rather than the hash-bearing wrapper.
Performance
mormot.ui.report
0bbba74d+5-8
ui: optimized TGdiPages in-memory compression
Impact
This removes hash work for trusted report pages in memory; it does not change HTTP or database compression.
Units
22
Low
FastCGI and local routes share static-file response logic
The front controller decodes paths in TSynTempAdder and uses ReturnLocalFile, shared with OnGetHeadLocalFolder, to build the filename and cache key.
Under the hood
mormot.net.proxy
a667f74e+71-49
net: front controller with TSynTempAdder, and ReturnLocalFile() shared with OnGetHeadLocalFolder
Impact
Pascal proxy deployments gain shared static-file handling without changing the FastCgiIndex setting introduced earlier.
Units
23
Low
Network slow-test names follow a consistent convention
The suite renames the IOCP unsubscribe test, adjusts slow-test scheduling and clarifies a queue-count comment.
Tests
mormot.net.async
8c932950+7-9
tests: minor TNetworkProtocols refactoring
Impact
This changes tests and comments, not runtime accept behavior.
Units
24
Low
Async response tests wait for cleanup once per group
DoHttpAsyncResponses shortens the test delay and waits for the GC grace period once during the reset iterations rather than on every iteration.
Tests
b9be94ee+6-4
test: refine HttpAsyncResponse timing
Impact
Only test timing changes, not the production async connection lifetime.