mORMot2 Daily每日上游提交速读

代理与命令行 API 调整,同时外部进程和预处理器修复趋于稳定

THttpProxyServer 从 mormot.net.async 移至 mormot.net.proxy,ParseCommandArgs 的布尔模式改为 TParseCommandOptions。ParamUtf8 统一 Delphi 与 FPC 的启动参数,后续提交修复 Windows 兼容性和中间错误。代理关闭、POSIX 子进程清理、PDF/A-1 输出和 JOP 预处理器也获得正确性修复。

要点

  • 使用 THttpProxyServer 的应用必须在 uses 中加入 mormot.net.proxy。
  • 向 ParseCommandArgs 或其包装函数传入旧布尔模式的调用必须迁移到 TParseCommandOptions。
  • ParamUtf8 与 TExternalProcess 序列应分别更新到 build 18038 和 18043,不要停在中间版本。
  • Build 18067 修复当天剩余的 JOP 预处理错误,包括无效 JSON 与未终止的 verbatim 块。

升级建议

请落在 build 2.4.18067。不要只挑选最初的 ParamUtf8、TExternalProcess 或 JOP 提交而遗漏同日修复。重新构建 Delphi 或 FPC 应用前,更新 THttpProxyServer 的 uses,并替换 ParseCommandArgs 的布尔模式。

版本号2.4.18026 → 2.4.18067
提交39
行数+5461 -3814
阅读2 分钟

30 条中的 30 条 · 上游 39 次提交

主题
# 条目 类别 单元
1 高 THttpProxyServer 移至 mormot.net.proxy 完整代理与缓存实现从 mormot.net.async 移至新单元 mormot.net.proxy。Lazarus 包、测试、示例和文档加入该单元;THttpAsyncServer.IdleEverySecond 变为 public。 破坏性变更 mormot.net.async+1 f5b3e8cc+1660-1593

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

影响

从 mormot.net.async 实例化 THttpProxyServer 的 Delphi/FPC 应用会编译失败,直到 uses 加入 mormot.net.proxy。运行时行为预期仅为代码移动。

需要迁移

搜索引用 THttpProxyServer 或其缓存类型且仅含 mormot.net.async 的 uses,并加入 mormot.net.proxy。

公开 API

  • mormot.net.async.THttpProxyServerremoved — 该类型现位于 mormot.net.proxy。
  • mormot.net.proxy.THttpProxyServeradded — 现有代理 API 从新单元公开。
  • THttpAsyncServer.IdleEverySecondbehaviour-changed — 为代理集成,其可见性改为 public。

zen010101 · 02:52 UTC · PR #392 · 在 GitHub 上查看该提交 →

2 高 命令解析以选项集合取代布尔模式 mormot.core.os 新增含 pcoPosix 与 pcoNoCaretEscape 的 TParseCommandOptions。ParseCommandArgs、ExtractExecutableName 和 ExtractCommandArgs 的末尾布尔参数改为该集合。 破坏性变更 mormot.core.os 4ba4120e+35-33

core: introducing TParseCommandOptions argument

影响

使用默认值的调用保持平台行为,但显式传入 true 或 false 的 Delphi/FPC 代码必须改为 [pcoPosix] 或 []。

需要迁移

搜索这三个函数中带末尾布尔参数的调用;把 true 改为 [pcoPosix],false 改为 []。

公开 API

  • TParseCommandOptionsadded — 新增 pcoPosix 与 pcoNoCaretEscape。
  • ParseCommandArgssignature-changed — posix 布尔参数改为 TParseCommandOptions。
  • ExtractExecutableNamesignature-changed — posix 布尔参数改为 TParseCommandOptions。
  • ExtractCommandArgssignature-changed — posix 布尔参数改为 TParseCommandOptions。

Arnaud Bouchez · 17:05 UTC · 在 GitHub 上查看该提交 →

3 高 TExternalProcess 状态标志由锁保护 TExternalProcess 用 fSafe 下的 SetFlag 与 IsSet 取代跨线程直接标志访问,修正 stderr 保留判断,并同步 EOF、终止与 zombie 状态。 修复 mormot.core.os+2 5849944c+60-46

core: hardened TExternalProcess thread-safety

影响

重定向子进程输出的 Delphi/FPC 服务可避免工作线程、等待与析构路径间的竞态,包括关闭时卡死或状态陈旧。

Arnaud Bouchez · 13:11 UTC · 在 GitHub 上查看该提交 →

4 高 代理关闭会等待分离的缓存工作线程 THttpProxyServer 统计分离下载与缓存清理线程,通过完成回调递减,在 Stop 中等待后才释放 fPartials 与 URL 状态。 修复 mormot.net.proxy dbd646e4+54-10

net: fixed THttpProxyServer shutdown after #780

影响

Delphi/FPC 代理服务器在远程下载进行中停止或重启时,可避免随机访问违规与部分下载对象泄漏。

Arnaud Bouchez · 10:48 UTC · PR #780 · 在 GitHub 上查看该提交 →

5 高 JOP 拒绝格式错误输入并正确处理空条件 mormot.core.fmt 要求 $ifdef 变量非空,在输入结束时停止未终止的 $$$ 块,JsonBufferReformat 失败时返回空结果,并简化递归文本处理。 修复 mormot.core.fmt b266d8bd+28-17

core: some other TPreprocText fixes

影响

使用 JsonPreprocess 或 TextPreprocess 的后端不再保留无效部分 JSON、越过未终止 verbatim 输入或把空定义视为已存在。Delphi 与 FPC 行为一致。

Arnaud Bouchez · 17:40 UTC · 在 GitHub 上查看该提交 →

6 高 ParamUtf8 后续修复边界与控制台行为 ParamUtf8 推广修复 TCommandLine.CreateAsArray 边界、保护 daemon/ECC 参数、复制完整数组,并修正控制台免提示条件。 修复 mormot.app.console+3 5c2aea31+18-15

core: some fixes after ParamUtf8[] introduction

影响

中间版本可能跳过参数、越过数组或反转控制台暂停行为。Delphi/FPC 应用应与初始推广一同采用此修复。

Arnaud Bouchez · 10:13 UTC · 在 GitHub 上查看该提交 →

7 高 Linux fpwaitid 正确传递 siginfo 缓冲区 mormot.core.os.posix 将 Linux waitid 原始系统调用参数从指针变量地址改为 siginfo 缓冲区指针本身。 修复 mormot.core.os.posix 215b674f+4-4

core: fixed fpwaitid() syscall definition

影响

使用 TExternalProcess 与 roWinJobCloseChildren 的 FPC Linux 后端可避免新无回收路径中的退出信息损坏。其他平台不变。

Arnaud Bouchez · 13:23 UTC · 在 GitHub 上查看该提交 →

8 中 JOP 转义与 include 边界情况得到修复 mormot.core.fmt 在展开时保留值标记,并用 JSON 字符串扫描处理引号定义。测试覆盖转义、注释、绝对 include 和尾随空格。 修复 mormot.core.fmt aafda09f+136-8

test: cover JOP pre-processor new fixes

影响

生成的 JSON 不再重复转义已存字符串,也不会丢失展开值中的引号和反斜杠。调用签名不变。

Arnaud Bouchez · 17:09 UTC · 在 GitHub 上查看该提交 →

9 中 框架命令行使用方切换到 ParamUtf8 应用、服务、测试与 SOA 命令处理器用 ParamUtf8 取代 ParamCount/ParamStr,TExecutableCommandLine 不再丢弃空原始参数。 修复 mormot.app.agl+5 5a52987f+42-47

core: fixed command line parameter usage

影响

Delphi 与 FPC 的命令行行为更一致,包括空参数。此中间提交需要 build 18035 的后续修复。

Arnaud Bouchez · 09:49 UTC · 在 GitHub 上查看该提交 →

10 中 文本预处理支持递归 include 文件 mormot.core.fmt 正确推进 include 文件名扫描,并把包含文本重新送入 TPreprocText.ProcessText,而非原样追加。 修复 mormot.core.fmt bee1685e+48-31

core: fixed TPreprocText $include

影响

嵌套 include 以及被包含文本中的变量或条件现在按预期执行。Delphi/FPC 调用点不变。

Arnaud Bouchez · 14:41 UTC · 在 GitHub 上查看该提交 →

11 中 JOP 输出有效转义 JSON 与可选调试注释 mormot.core.fmt 转义展开的原始文本、保留类型标记、修复注释裁剪,并仅在启用 jppDebugComment 时输出解析诊断。 修复 mormot.core.fmt 437474c1+58-20

core: several fixes to JOP pre-processor

影响

含引号、控制字符或反斜杠的模板值保持有效 JSON,普通输出也不再混入调试注释。应用 API 不变。

Arnaud Bouchez · 16:54 UTC · 在 GitHub 上查看该提交 →

12 中 PDF/A-1 始终写入合规 xref 表 即使请求 PDF 1.5 或更高头部,TPdfDocument.SaveToStreamDirectEnd 也会为 pdfa1A 与 pdfa1B 禁用 xref 与对象流。 修复 mormot.ui.pdf 85ced2a7+62-3

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

影响

使用 GeneratePdf15File、打印缩放或可选内容的 PDF/A-1 文档可通过 veraPDF 等验证器,不再违反规范。

Sven Harazim · 06:04 UTC · 在 GitHub 上查看该提交 →

13 中 必需位置参数可报告正确错误 TExecutableCommandLine.DetectUnknown 区分意外提供的参数与缺失的必需参数,并在无描述时生成 argN。 修复 mormot.core.os 2649f948+53-5

core: fix missing argument detection in TExecutableCommandLine

影响

命令行工具现在给出准确验证消息,不再索引错误数组或误报缺失输入。无需迁移调用者。

Arnaud Bouchez · 14:31 UTC · 在 GitHub 上查看该提交 →

14 中 JOP 定义可保留 HTTP 与 HTTPS 地址 mormot.core.fmt 仅在词元边界把 // 或 # 视为注释,保留普通、引号与对象定义中的 URL,并修复模板终点和右侧裁剪边界。 修复 mormot.core.fmt 4f3fa4f5+47-9

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

影响

包含 https:// 值或片段的配置模板不再被当作注释截断。现有 Delphi 与 FPC 代码无需 API 更改。

Arnaud Bouchez · 17:29 UTC · 在 GitHub 上查看该提交 →

15 中 格式错误的开关不再静默消失 TExecutableCommandLine.Parse 清除先前未知错误,并把空开关名或 --、--=v 等无名赋值记录到 fUnknown。 修复 mormot.core.os 3b185959+23-21

core: detect void values with no silent drop

影响

CLI 验证现在会报告格式错误输入,不再因遗漏而接受。现有应用代码无需修改即可编译。

值得一看

Arnaud Bouchez · 13:56 UTC · 在 GitHub 上查看该提交 →

16 中 修正 Windows 命令解析与旧版 Delphi 常量 mormot.core.os.windows 将 CommandLineToArgvW 声明为延迟加载函数变量。DuckDB 测试使用 QWord(-1) 兼容 Delphi 7/2007。 修复 mormot.core.os.windows caba2fcd+6-6

core: some Windows fixes

影响

Windows 启动可通过预期延迟加载器解析 CommandLineToArgvW,旧版 Delphi 测试构建也避免无效 QWord 表达式。

Arnaud Bouchez · 11:15 UTC · 在 GitHub 上查看该提交 →

17 中 代理本地文件忽略 URL 查询字符串 THttpProxyServer 在 UrlDecodeVar 前仅把 Uri.Path 复制到终止的 RawUtf8,因此查询部分不再成为本地文件名的一部分。 修复 mormot.net.proxy 997f4b77+9-2

net: fixed THttpProxyServer local folder URI with a query string

影响

带 ?v=2 等缓存清除查询的静态资源会返回实际文件,而非错误 404,路径安全检查仍有效。

zen010101 · 05:45 UTC · 在 GitHub 上查看该提交 →

18 中 仅有 ETag 的代理资源可返回 304 THttpProxyUrl.ReturnFile 现在按 fSource 而非 Last-Modified 识别远程资源,使源站 ETag 可参与 If-None-Match 验证。 修复 mormot.net.proxy a4876b98+8-2

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

影响

没有 Last-Modified 的缓存远程内容可返回 HTTP 304,而不是重发完整正文。现有代理配置无需更改。

zen010101 · 05:16 UTC · 在 GitHub 上查看该提交 →

19 中 代理源路径自动补充分隔符 当配置的 Source 没有尾随斜杠时,THttpProxyServer.OnGetHeadRemoteUri 会先追加斜杠再拼接请求路径。 修复 mormot.net.proxy 7e27852d+7-0

net: fixed THttpProxyServer remote Source with no trailing /

影响

http://host/folder 等代理源现在请求 /folder/file 而非 /folderfile,从而避免源站 404。

zen010101 · 05:00 UTC · 在 GitHub 上查看该提交 →

20 中 命令行值数组可保留空项 返回数组的 TExecutableCommandLine.Get 重载新增默认 false 的 includeempty 布尔参数,适用于 TRawUtf8DynArray 与 TStringDynArray。 新功能 mormot.core.os cfefdb66+68-12

core: new includeempty option to TExecutableCommandLine.Get()

影响

默认行为不变。空选项值有意义的后端可选择启用,并在 Delphi/FPC 上保持顺序。

值得一看

公开 API

  • TExecutableCommandLine.Getsignature-changed — 数组重载新增默认 false 的 includeempty。

Arnaud Bouchez · 14:10 UTC · 在 GitHub 上查看该提交 →

21 中 ParamUtf8 一致公开启动参数 mormot.core.os 新增全局 ParamUtf8 数组。POSIX 直接读取 argv,Windows 使用 CommandLineToArgvW,使 Delphi 与 FPC 获得相同 UTF-8 参数。 新功能 mormot.core.os+2 ca7d9ea9+35-3

core: introducing ParamUtf8[] global variable

影响

应用可使用预解码 UTF-8 参数并避免 ParamStr 差异。初始 Windows 实现需包含同日兼容修复后再部署。

值得一看

公开 API

  • ParamUtf8added — 全局 TRawUtf8DynArray,等价于 ParamStr,在启动时填充。

Arnaud Bouchez · 08:28 UTC · 在 GitHub 上查看该提交 →

22 中 POSIX 进程所有者可关闭残留子进程组 在 Linux、FreeBSD 与 macOS 上,带 roWinJobCloseChildren 的 TExternalProcess 用 waitid/WNOWAIT 保留已退出父进程为 zombie,直到 DoClose 杀死其进程组并回收。 编译器与平台 mormot.core.os+2 32a1058d+133-3

core: TExternalProcess roWinJobCloseChildren also closes the children on POSIX

影响

POSIX 服务现在可请求类似 Windows 的清理,关闭直接进程退出后留下的子进程。RunRedirect 在 POSIX 上仍有意忽略此选项。

值得一看

公开 API

  • roWinJobCloseChildrenbehaviour-changed — 该选项现在也会在受支持 POSIX 系统上关闭残留子进程。

zen010101 · 17:03 UTC · 在 GitHub 上查看该提交 →

23 中 WinPE 启动参数不再要求 shell32 mormot.core.os.windows 动态解析 CommandLineToArgvW,shell32 不可用时回退到 ParamStr,普通 Windows 仍使用标准解析器。 编译器与平台 mormot.core.os.windows b8243fce+29-14

core: restore WinPE compatibility without shell32.dll

影响

WinPE 与类似精简 Windows 映像可初始化 ParamUtf8,不会因缺少 shell32.dll 而加载失败。

Arnaud Bouchez · 10:21 UTC · 在 GitHub 上查看该提交 →

24 低 新增公开辅助函数以追加 JSON 转义 UTF-8 文本 mormot.core.json 新增 AdderJsonEscape,将指针范围追加到 TSynTempAdder,并转义 JSON 控制字符与嵌入的 #0。 新功能 mormot.core.json 042a0243+41-3

core: new AdderJsonEscape() wrapper function

影响

现有后端不受影响。向 TSynTempAdder 构建 JSON 的 Delphi/FPC 代码可使用该辅助函数。

公开 API

  • AdderJsonEscapeadded — 把 P 到 PEnd 的 JSON 转义 UTF-8 追加到 TSynTempAdder。

Arnaud Bouchez · 16:48 UTC · 在 GitHub 上查看该提交 →

25 低 TExternalProcess 合并内部状态标志 mormot.core.os 将 TExternalProcess 布尔值打包到内部标志集合,并统一不同编译器分支的 POSIX 句柄初始化和 waitid 包装。 内部重构 mormot.core.os+2 79a8e409+61-64

core: refactored TExternalProcess

影响

无公共 API 变化。此中间重构应与后续锁和 fpwaitid 修复一起采用,不应单独选择。

Arnaud Bouchez · 12:47 UTC · 在 GitHub 上查看该提交 →

26 低 内部命令行代码采用 UTF-8 参数数组 mormot.app、mormot.core 与 mormot.soa 改读 ParamUtf8,不再反复转换 ParamStr,包括 Windows 服务命令匹配。 内部重构 mormot.app.agl+5 8b172724+15-22

all: use the new ParamUtf8[] whenever possible

影响

调用方无需直接更改。框架工具在 Delphi 与 FPC 上获得一致 Unicode 参数处理,但需包含后续修复。

Arnaud Bouchez · 08:42 UTC · 在 GitHub 上查看该提交 →

27 低 JOP 行为移入独立回归测试 test.core.data 新增 TTestCoreProcess.TestJopProcess,将文本、JSON、条件、include 与 insert 检查集中到独立方法。 测试 fefbbbe9+316-203

test: new clean stand-alone TTestCoreProcess.TestJopProcess method

影响

没有运行时或公共 API 变化。独立测试便于在 Delphi 与 FPC 上验证后续 JOP 修复。

Arnaud Bouchez · 14:41 UTC · 在 GitHub 上查看该提交 →

28 低 格式错误的命令开关增加回归测试 test.core.base 覆盖空位置参数、空参数值、格式错误开关与解析器重置,并通过命令行测试套件运行 TExternalProcess 测试。 测试 645eae24+81-6

test: cover command line parsing as reported by #761

影响

没有独立生产代码变化。测试规定格式错误开关必须保留给 DetectUnknown,而不是静默消失。

Arnaud Bouchez · 13:57 UTC · PR #761 · 在 GitHub 上查看该提交 →

29 低 插入符解析模式增加回归测试 test.core.base 覆盖旧版 Windows 插入符转义、pcoNoCaretEscape、POSIX 解析和 ExtractExecutableName 转发;mormot.core.os 仅增加说明。 测试 mormot.core.os 672d88a8+24-2

test: cover regression for #764

影响

此提交不再改变应用代码,仅验证 Delphi 与 FPC 构建中的 TParseCommandOptions 行为。

Arnaud Bouchez · 17:13 UTC · PR #764 · 在 GitHub 上查看该提交 →

30 低 记录 PDF/A-1 交叉引用行为 mormot.ui.pdf 说明 GeneratePdf15File 在 PDF/A-1 下会改变头部,但仍写经典 xref 表,因为该规范禁止 xref 流。 文档 mormot.ui.pdf 3073fd90+2-0

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

影响

无运行时变化。文档澄清前一 PDF/A-1 修复对 Delphi/FPC 调用者的行为。

Sven Harazim · 06:06 UTC · 在 GitHub 上查看该提交 →

上游活动 每日提交数 · 最近 60 天
提交1007
活跃天数49/60
最忙一天2026-09-30
峰值60
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