]> git.kaiwu.me - njs.git/commit
Modules: fix shared dict state JSON separators
authorDmitry Volyntsev <xeioex@nginx.com>
Sat, 10 Oct 2026 01:40:28 +0000 (18:40 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Thu, 15 Oct 2026 01:49:05 +0000 (18:49 -0700)
commitaeef0bfe283032d0a66d5299472c75407b9a6073
treebc69b7a2422a35bb22edecb58b513f1aaabc6b21
parent1fdfec8ecfe89b6ed852f9c18a859d3e8bec4b4b
Modules: fix shared dict state JSON separators

When saving a shared dict zone with timeout=, expired entries are
skipped.  A comma is appended whenever another tree node follows a live
entry, even if all remaining nodes are expired.  This can leave a
trailing comma in the state file, making it invalid JSON.

Insert commas before live entries only when a previous entry has been
rendered, so skipped entries do not affect the separators.
nginx/ngx_js_shared_dict.c