mORMot2 DailyDaily read of upstream commits

Proxy and command-line APIs move while process and preprocessor fixes settle

THttpProxyServer moves from mormot.net.async to mormot.net.proxy, and ParseCommandArgs replaces its Boolean mode with TParseCommandOptions. ParamUtf8 standardizes startup arguments across Delphi and FPC, while later commits repair Windows compatibility and intermediate mistakes. Proxy shutdown, POSIX child cleanup, PDF/A-1 output and the JOP preprocessor also receive correctness fixes.

TL;DR

  • Applications using THttpProxyServer must add mormot.net.proxy to their uses clause.
  • Calls that pass the old Boolean mode to ParseCommandArgs or its wrappers must migrate to TParseCommandOptions.
  • Take the ParamUtf8 and TExternalProcess sequences through builds 18038 and 18043 respectively, not their intermediate revisions.
  • Build 18067 closes the day's remaining JOP preprocessor errors, including invalid JSON and unterminated verbatim input.

Upgrade advice

Land on build 2.4.18067. Do not cherry-pick the initial ParamUtf8, TExternalProcess or JOP commits without their same-day repairs. Update uses clauses for THttpProxyServer and replace Boolean ParseCommandArgs modes before rebuilding Delphi or FPC applications.

Build2.4.18026 → 2.4.18067
Commits39
Lines+5461 -3814
Read7 min

30 of 30 entries · 39 commits upstream

Stories
# Entry Category Units
1 High THttpProxyServer moves into mormot.net.proxy The complete proxy and cache implementation is removed from mormot.net.async and placed in the new mormot.net.proxy unit. Lazarus packages, tests, examples and documentation add that unit; THttpAsyncServer.IdleEverySecond becomes public. Breaking changes mormot.net.async+1 f5b3e8cc+1660-1593

net: new mormot.net.proxy unit extracted from mormot.net.async - see #392

Impact

Delphi and FPC applications that instantiate THttpProxyServer from mormot.net.async will fail to compile until mormot.net.proxy is added to uses. Runtime behavior is intended to be a pure move.

Migration required

Search uses clauses for mormot.net.async where THttpProxyServer or its cache types are referenced and add mormot.net.proxy.

Public API

  • mormot.net.async.THttpProxyServerremoved — The type now lives in mormot.net.proxy.
  • mormot.net.proxy.THttpProxyServeradded — The existing proxy API is exposed from the new unit.
  • THttpAsyncServer.IdleEverySecondbehaviour-changed — Its visibility changes to public for proxy integration.

zen010101 · 02:52 UTC · PR #392 · view the commit on GitHub →

2 High Command parsing replaces its Boolean mode with an option set mormot.core.os adds TParseCommandOptions with pcoPosix and pcoNoCaretEscape. ParseCommandArgs, ExtractExecutableName and ExtractCommandArgs replace their final Boolean parameter with this set. Breaking changes mormot.core.os 4ba4120e+35-33

core: introducing TParseCommandOptions argument

Impact

Calls relying on defaults keep platform behavior, but Delphi or FPC code passing true or false explicitly no longer matches the signature and must use [pcoPosix] or [].

Migration required

Search for ParseCommandArgs, ExtractExecutableName and ExtractCommandArgs calls with a final Boolean argument; replace true with [pcoPosix] and false with [].

Public API

  • TParseCommandOptionsadded — Adds pcoPosix and pcoNoCaretEscape.
  • ParseCommandArgssignature-changed — The posix Boolean becomes TParseCommandOptions.
  • ExtractExecutableNamesignature-changed — The posix Boolean becomes TParseCommandOptions.
  • ExtractCommandArgssignature-changed — The posix Boolean becomes TParseCommandOptions.

Arnaud Bouchez · 17:05 UTC · view the commit on GitHub →

3 High TExternalProcess state flags become lock-protected TExternalProcess replaces direct cross-thread flag access with SetFlag and IsSet under fSafe, corrects retained stderr selection, and synchronizes EOF, termination and zombie state across POSIX and Windows. Fixes mormot.core.os+2 5849944c+60-46

core: hardened TExternalProcess thread-safety

Impact

Delphi and FPC services that redirect child output avoid races between worker, wait and destruction paths, including hangs or stale state during shutdown.

Arnaud Bouchez · 13:11 UTC · view the commit on GitHub →

4 High Proxy shutdown waits for detached cache workers THttpProxyServer counts detached downloads and cache-clean workers, decrements through completion callbacks, waits in Stop, and only then frees fPartials and URL state. Fixes mormot.net.proxy dbd646e4+54-10

net: fixed THttpProxyServer shutdown after #780

Impact

Delphi and FPC proxy servers avoid random access violations and leaked partial-download objects when stopping or restarting during an active remote download.

Arnaud Bouchez · 10:48 UTC · PR #780 · view the commit on GitHub →

5 High JOP rejects malformed input and handles empty conditions correctly mormot.core.fmt makes $ifdef require a non-empty variable, stops unterminated $$$ blocks at end of input, returns an empty result when JsonBufferReformat fails, and simplifies recursive text processing. Fixes mormot.core.fmt b266d8bd+28-17

core: some other TPreprocText fixes

Impact

Backends using JsonPreprocess or TextPreprocess no longer keep invalid partial JSON, loop past unterminated verbatim input, or treat an empty definition as present. Delphi and FPC behavior is aligned.

Arnaud Bouchez · 17:40 UTC · view the commit on GitHub →

6 High ParamUtf8 follow-up fixes bounds and console behavior The ParamUtf8 rollout fixes TCommandLine.CreateAsArray bounds, guards daemon and ECC arguments, copies the full array into TExecutableCommandLine, and corrects the no-prompt console condition. Fixes mormot.app.console+3 5c2aea31+18-15

core: some fixes after ParamUtf8[] introduction

Impact

Intermediate builds could skip arguments, index beyond the available array, or invert console pause behavior. Delphi and FPC applications should take this correction with the original rollout.

Arnaud Bouchez · 10:13 UTC · view the commit on GitHub →

7 High Linux fpwaitid passes the siginfo buffer correctly mormot.core.os.posix changes the raw Linux waitid syscall argument from the address of the pointer variable to the siginfo buffer pointer itself. Fixes mormot.core.os.posix 215b674f+4-4

core: fixed fpwaitid() syscall definition

Impact

FPC Linux backends using TExternalProcess with roWinJobCloseChildren avoid corrupted or unread exit information in the new no-reap path. Other platforms are unchanged.

Arnaud Bouchez · 13:23 UTC · view the commit on GitHub →

8 Medium JOP escaping and include edge cases are corrected mormot.core.fmt preserves stored value markers during expansion and uses JSON string scanning for quoted definitions. Tests cover escaping, comments, absolute includes and trailing spaces. Fixes mormot.core.fmt aafda09f+136-8

test: cover JOP pre-processor new fixes

Impact

Generated JSON no longer double-escapes stored strings or loses quotes and backslashes in expanded values. No caller signature changes are introduced.

Arnaud Bouchez · 17:09 UTC · view the commit on GitHub →

9 Medium Framework command-line consumers switch to ParamUtf8 Application, service, test and SOA command handlers replace ParamCount and ParamStr with ParamUtf8, and TExecutableCommandLine keeps empty raw arguments instead of dropping them. Fixes mormot.app.agl+5 5a52987f+42-47

core: fixed command line parameter usage

Impact

Command-line behavior becomes consistent between Delphi and FPC, including empty arguments. This intermediate commit has follow-up fixes in build 18035 and should not be isolated.

Arnaud Bouchez · 09:49 UTC · view the commit on GitHub →

10 Medium Text preprocessing supports recursive include files mormot.core.fmt advances the include filename scanner correctly and routes included text back through TPreprocText.ProcessText instead of appending it verbatim. Fixes mormot.core.fmt bee1685e+48-31

core: fixed TPreprocText $include

Impact

Nested includes and variables or conditions inside included text now execute as intended. Existing Delphi and FPC call sites do not change.

Arnaud Bouchez · 14:41 UTC · view the commit on GitHub →

11 Medium JOP emits valid escaped JSON and optional debug comments mormot.core.fmt escapes raw expanded text, preserves typed markers, fixes comment trimming, and only emits parser diagnostics when jppDebugComment is enabled. Fixes mormot.core.fmt 437474c1+58-20

core: several fixes to JOP pre-processor

Impact

Template values containing quotes, control characters or backslashes now remain valid JSON, while normal output is no longer polluted by debug comments. Application APIs are unchanged.

Arnaud Bouchez · 16:54 UTC · view the commit on GitHub →

12 Medium PDF/A-1 always writes a compliant xref table TPdfDocument.SaveToStreamDirectEnd suppresses xref and object streams for pdfa1A and pdfa1B even when the requested header is PDF 1.5 or later. Fixes mormot.ui.pdf 85ced2a7+62-3

ui: pdf - PDF/A-1 gets an xref table, whatever version its features ask for

Impact

PDF/A-1 documents using GeneratePdf15File, print scaling or optional content can pass validators such as veraPDF instead of violating the profile.

Sven Harazim · 06:04 UTC · view the commit on GitHub →

13 Medium Required positional arguments report the correct error TExecutableCommandLine.DetectUnknown distinguishes an unexpected supplied argument from a missing required argument and generates argN when no description is available. Fixes mormot.core.os 2649f948+53-5

core: fix missing argument detection in TExecutableCommandLine

Impact

Command-line tools now produce accurate validation messages instead of indexing the wrong array or mislabeling missing input. No caller migration is needed.

Arnaud Bouchez · 14:31 UTC · view the commit on GitHub →

14 Medium JOP definitions preserve HTTP and HTTPS addresses mormot.core.fmt now treats // or # as a comment only at a token boundary, preserves URLs in plain, quoted and object definitions, and fixes template endpoint and right-trim bounds. Fixes mormot.core.fmt 4f3fa4f5+47-9

core: allow https://... URIs in JOP pre-processor

Impact

Configuration templates containing https:// values or fragments are no longer truncated as comments. Existing Delphi and FPC code needs no API change.

Arnaud Bouchez · 17:29 UTC · view the commit on GitHub →

15 Medium Malformed switches no longer disappear silently TExecutableCommandLine.Parse clears prior unknown errors and records empty switch names or name-less assignments such as -- and --=v in fUnknown. Fixes mormot.core.os 3b185959+23-21

core: detect void values with no silent drop

Impact

CLI validation now reports malformed user input instead of accepting it by omission. Existing application code compiles unchanged.

Worth a look

Arnaud Bouchez · 13:56 UTC · view the commit on GitHub →

16 Medium Windows command parsing and legacy Delphi constants are corrected mormot.core.os.windows declares CommandLineToArgvW as a function variable for delayed loading. DuckDB tests replace High(QWord) with QWord(-1) for Delphi 7 and 2007 compatibility. Fixes mormot.core.os.windows caba2fcd+6-6

core: some Windows fixes

Impact

Windows startup can resolve CommandLineToArgvW through the intended delayed loader, and legacy Delphi test builds avoid an invalid QWord expression.

Arnaud Bouchez · 11:15 UTC · view the commit on GitHub →

17 Medium Local proxy files ignore URL query strings THttpProxyServer copies only Uri.Path into a terminated RawUtf8 before UrlDecodeVar, so the query component can no longer become part of the local filename. Fixes mormot.net.proxy 997f4b77+9-2

net: fixed THttpProxyServer local folder URI with a query string

Impact

Static assets requested with cache-busting queries such as ?v=2 return the underlying file instead of a false 404, while path safety checks remain active.

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

18 Medium ETag-only proxy resources can return 304 THttpProxyUrl.ReturnFile now identifies remote resources by fSource rather than Last-Modified, allowing origin ETags to participate in If-None-Match validation. Fixes mormot.net.proxy a4876b98+8-2

net: fixed THttpProxyServer 304 on a remote resource with only an ETag

Impact

Cached remote content without Last-Modified can produce HTTP 304 instead of resending the full body. Existing proxy configuration needs no change.

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

19 Medium Proxy source paths receive a missing separator THttpProxyServer.OnGetHeadRemoteUri appends a slash to a non-empty remote Source before joining the requested path when the configured Source lacks a trailing slash. Fixes mormot.net.proxy 7e27852d+7-0

net: fixed THttpProxyServer remote Source with no trailing /

Impact

Documented proxy sources such as http://host/folder now request /folder/file rather than /folderfile and avoid origin 404 responses.

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

20 Medium Command-line value arrays can retain empty entries Array-returning TExecutableCommandLine.Get overloads gain an includeempty Boolean, defaulting to false, for both TRawUtf8DynArray and TStringDynArray outputs. New features mormot.core.os cfefdb66+68-12

core: new includeempty option to TExecutableCommandLine.Get()

Impact

Default behavior remains unchanged. Backends where an empty option value is meaningful can opt in without losing ordering on Delphi or FPC.

Worth a look

Public API

  • TExecutableCommandLine.Getsignature-changed — Array overloads add includeempty with a false default.

Arnaud Bouchez · 14:10 UTC · view the commit on GitHub →

21 Medium ParamUtf8 exposes startup arguments consistently mormot.core.os adds the global ParamUtf8 array. POSIX reads argv directly, while Windows uses CommandLineToArgvW so Delphi and FPC receive the same UTF-8 arguments. New features mormot.core.os+2 ca7d9ea9+35-3

core: introducing ParamUtf8[] global variable

Impact

Applications can consume predecoded UTF-8 arguments and avoid ParamStr differences. The initial Windows implementation requires the same-day compatibility fixes before deployment.

Worth a look

Public API

  • ParamUtf8added — Global TRawUtf8DynArray equivalent to ParamStr, populated at startup.

Arnaud Bouchez · 08:28 UTC · view the commit on GitHub →

22 Medium POSIX process owners can close surviving child groups On Linux, FreeBSD and macOS, TExternalProcess with roWinJobCloseChildren uses waitid with WNOWAIT to retain an exited parent as a zombie until DoClose kills its process group and reaps it. Compiler & platform mormot.core.os+2 32a1058d+133-3

core: TExternalProcess roWinJobCloseChildren also closes the children on POSIX

Impact

POSIX services can now request Windows-like cleanup of children left after the direct process exits. RunRedirect still intentionally ignores this option on POSIX.

Worth a look

Public API

  • roWinJobCloseChildrenbehaviour-changed — The option now also closes surviving children on supported POSIX systems.

zen010101 · 17:03 UTC · view the commit on GitHub →

23 Medium WinPE no longer requires shell32 for startup arguments mormot.core.os.windows resolves CommandLineToArgvW dynamically and falls back to ParamStr when shell32 is unavailable, while retaining the standard parser on normal Windows. Compiler & platform mormot.core.os.windows b8243fce+29-14

core: restore WinPE compatibility without shell32.dll

Impact

WinPE and similarly reduced Windows images can initialize ParamUtf8 instead of failing to load the executable because shell32.dll is absent.

Arnaud Bouchez · 10:21 UTC · view the commit on GitHub →

24 Low A public helper appends JSON-escaped UTF-8 text mormot.core.json adds AdderJsonEscape, which appends a pointer range into TSynTempAdder while escaping JSON control characters and embedded #0 bytes. New features mormot.core.json 042a0243+41-3

core: new AdderJsonEscape() wrapper function

Impact

Existing backends are unaffected. Delphi and FPC code that builds JSON into TSynTempAdder can use the new helper instead of implementing its own escaping loop.

Public API

  • AdderJsonEscapeadded — Appends JSON-escaped UTF-8 from P through PEnd to TSynTempAdder.

Arnaud Bouchez · 16:48 UTC · view the commit on GitHub →

25 Low TExternalProcess consolidates internal state flags mormot.core.os packs TExternalProcess booleans into an internal flag set and normalizes POSIX handle initialization and waitid wrappers across compiler branches. Under the hood mormot.core.os+2 79a8e409+61-64

core: refactored TExternalProcess

Impact

No public API changes. This intermediate refactor is superseded in practice by the following locking and fpwaitid fixes and should not be taken alone.

Arnaud Bouchez · 12:47 UTC · view the commit on GitHub →

26 Low Internal command-line code adopts the UTF-8 argument array mormot.app, mormot.core and mormot.soa code read ParamUtf8 instead of repeatedly converting ParamStr, including Windows service command matching. Under the hood mormot.app.agl+5 8b172724+15-22

all: use the new ParamUtf8[] whenever possible

Impact

No direct caller change. Framework tools gain consistent Unicode argument handling across Delphi and FPC, subject to the later fixes in the sequence.

Arnaud Bouchez · 08:42 UTC · view the commit on GitHub →

27 Low JOP behavior moves into a dedicated regression test test.core.data adds TTestCoreProcess.TestJopProcess and moves text, JSON, conditional, include and insert preprocessing checks into that standalone method. Tests fefbbbe9+316-203

test: new clean stand-alone TTestCoreProcess.TestJopProcess method

Impact

There is no runtime or public API change. The dedicated test makes later JOP fixes easier to verify on Delphi and FPC.

Arnaud Bouchez · 14:41 UTC · view the commit on GitHub →

28 Low Malformed command switches receive regression tests test.core.base covers empty positional arguments, empty parameter values, malformed switches and parser reset behavior, and runs TExternalProcess tests through the command-line suite. Tests 645eae24+81-6

test: cover command line parsing as reported by #761

Impact

There is no independent production change. The tests document that malformed switches must remain visible to DetectUnknown rather than disappear silently.

Arnaud Bouchez · 13:57 UTC · PR #761 · view the commit on GitHub →

29 Low Caret parsing modes gain regression coverage test.core.base covers legacy Windows caret escaping, pcoNoCaretEscape, POSIX parsing and ExtractExecutableName forwarding; mormot.core.os adds explanatory comments only. Tests mormot.core.os 672d88a8+24-2

test: cover regression for #764

Impact

There is no additional application-code change in this commit. It verifies the TParseCommandOptions behavior for Delphi and FPC builds.

Arnaud Bouchez · 17:13 UTC · PR #764 · view the commit on GitHub →

30 Low PDF/A-1 cross-reference behavior is documented mormot.ui.pdf documents that GeneratePdf15File changes the header under PDF/A-1 but still writes a classic xref table because that profile forbids xref streams. Docs mormot.ui.pdf 3073fd90+2-0

ui: pdf - GeneratePdf15File documented for PDF/A-1

Impact

There is no runtime change. The documentation clarifies the behavior introduced by the preceding PDF/A-1 fix for Delphi and FPC callers.

Sven Harazim · 06:06 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