Repository navigation
CI: move to Ubuntu 26.04 - #3118
Merged
Merged
Conversation
DockedFerret800
approved these changes
Nov 20, 2026
DockedFerret800
added a commit
to DockedFerret800/glaze
that referenced
this pull request
Nov 25, 2026
* Order http_stream_connection::disconnect() with the stream's reads and close (stephenberry#3031) * Order http_stream_connection::disconnect() with the stream's reads and close disconnect() called from a thread other than the one running a stream's handlers cancelled the socket with nothing ordering the cancel against the client's workers, which share one io_context with no strand per connection. A stop that landed between a chunk's delivery and the next read cancelled nothing, and the chunk loop started that read regardless, so the stream ended only when the peer sent more or closed. Nothing kept the cancel from running while a worker closed the socket either, which stephenberry#3021 shows crashing in asio's reactor once the chunk loop honours a stop. Each stream now has a strand, every one of its completion handlers is bound to it, and disconnect() sets should_stop and dispatches its cancel onto it: inline from a handler, on_data or on_progress, queued behind the running handler from any other thread. read_chunk_size tests should_stop before it starts a read, as start_stream_reading already does between reads of a Content-Length body. Fixes stephenberry#3021 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Order the stop with one lock rather than a strand A strand per stream hung glaze's Windows CI. On Windows asio's thread-local call stacks are win_tss_ptr class-template statics whose TLS index is taken in a constructor, and glaze's tests run inside static initialisers, so the strand's call stack still had index 0 while a stream ran and shared a slot with the thread's. A strand handler then made asio's recycling allocator use a strand context on the stack as the thread's cache, and free a pointer it never allocated. The same stream started from main() completes. The stop is now ordered with one mutex per stream. disconnect() cancels the pending operation and shuts the socket down under it; the client tests should_stop and starts each operation under it, and closes or pools the socket under it. The shutdown ends a composed read that asio continues between two of its steps, outside the lock. A socket a stop has shut down is closed rather than pooled, even when its response completed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * Stream timeout ends the stream once (stephenberry#3032) * Stream timeout ends the stream once * Order the timeout with the head and the stream's end * Committing clang-format changes * send Vary: Origin from create_cors_middleware (stephenberry#3030) * refuse float to integral get<T>() on lazy beve typed array elements (stephenberry#3029) * refuse float to integral get<T>() on lazy beve typed array elements read_numeric_from_tag cast a typed f32/f64 array element to an integral T with a bare static_cast, undefined behavior for a value outside the target's range and a truncated value otherwise, where from<BEVE, num_t> and the lazy scalar path refuse the conversion. Report syntax_error like the numeric reader; integer widening and floating point gets are unchanged. * Clarify lazy beve numeric conversion docs --------- Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * net: keep '+' in path captures, answer 405 for wrong method, HEAD via GET, client head/del/options (stephenberry#3027) * net: keep '+' in path captures, answer 405 for wrong method, add client del/options Closes stephenberry#2967 Co-authored-by: Jisan Halder <official.jisanhalder@gmail.com> * http_client: don't wait for a body on HEAD/1xx/204/304 replies; add head() * http_client: skip interim 1xx responses; never pool a 101 connection * http_smuggling_test: HEAD on a GET-only route is now 405 * url: add url_encode_path_segment * http_client: cap interim responses, unify connection reuse, add head_async * net: HEAD falls back to GET; 404/405/426 run middleware and hooks; single-walk allowed_methods --------- Co-authored-by: Jisan Halder <official.jisanhalder@gmail.com> * Committing clang-format changes * reject keys defined twice in toml struct reads (stephenberry#3034) * reject keys defined twice in toml struct reads * rename key_assignment_record, document duplicate keys, more tests --------- Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * reject invalid ~ escapes in runtime json pointer lookups (stephenberry#3033) * MSVC: a) Add MSVC CMake presets, b) Suppress MSVC secure CRT warnings, c) ut.hpp: work around MSVC aggregate-init bug with explicit constructors (stephenberry#3035) * Add MSVC CMake presets Add Windows-only MSVC Debug and Release configure and build presets, plus a Debug test preset with verbose failure output. * Suppress MSVC secure CRT warnings Propagate `_CRT_SECURE_NO_WARNINGS` to MSVC C++ consumers of `glaze_glaze`. * ut.hpp: work around MSVC aggregate-init bug with explicit constructors * Drop consumer-wide _CRT_SECURE_NO_WARNINGS, avoid getenv C4996 in ut, pin cl in MSVC presets --------- Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * write_float wrappers work with default opts (stephenberry#3038) * docs: update float_max_write_precision examples and options table for v9 (stephenberry#3013) * set_opt: handle allow_conversions; drop redundant options.md note (stephenberry#3039) * fix signed overflow of the slice index in jmespath handle_slice (stephenberry#3045) * jmespath: fix tuple slice index wrap near INT32_MAX (stephenberry#3046) * bson write: honor user to<BSON> specializations of variants and nullables (stephenberry#3044) (stephenberry#3047) * net: serialize streaming_connection writes with a write queue (stephenberry#3049) * net: serialize streaming_connection writes with a write queue streaming_connection started an asio::async_write for every send right away. async_write is a series of write_some calls, so two overlapping sends, from several threads or back to back from one, could interleave their bytes and corrupt the chunked framing and SSE events. Sends now go into a queue, as in websocket_connection: one async_write runs at a time and its completion starts the next. close() queues the terminating chunk and the socket still closes once the queue is empty. On a write error or a detected disconnect, the handlers of the sends still queued are called with the error. is_closed_ and is_headers_sent_ become atomics, since user threads and io threads share them. Adds http_stream_write_queue_test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * streaming_connection: report sends refused after close; drop extra fail on disconnect --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * http_server: fix start/stop data races (stephenberry#3050) * http_server: fix start/stop data races * http_server: one lifecycle mutex; notify under lock; more lifecycle tests * fix out-of-bounds write in eetf decode_sequence on truncated strings (stephenberry#3051) * check the string terminator in bson_to_json (stephenberry#3048) * version 9.1.0 bump * bson: support whole-type glz::meta value members (stephenberry#3052) (stephenberry#3053) * Reject C-string input for binary format reads (stephenberry#3054) * reject C-string input for binary format reads * trim comments and test case * Preserve custom error message in lazy read_into (stephenberry#3041) (stephenberry#3055) * Reflect local and anonymous-namespace types (stephenberry#3056) * Reflect local and anonymous-namespace types (stephenberry#3040) * Make strip_member_name constexpr for Clang 17/18 * Keep volatile in MSVC get_name; drop Clang 17 CI * Move Clang 16/18 CI to Clang 19 * Require Clang 19+ in installation docs * Update MSVC and endianness in installation docs * Drop duplicate clang-linux CI; simplify assume gate * fail compile-time get_view_json when the pointer does not resolve (stephenberry#3058) The numeric token dispatch only handled '{' and '[', and the string key loop ran out at the end of the input without an error, so an index into a scalar or an object ending after a ',' returned success with a null, empty view. write_at then erased at size_t(nullptr - data()) and threw, and on a bounded buffer the next token read one byte past the end. Report syntax_error and unexpected_end as the runtime overload does. * Fix count_members for non-default-initializable aggregates (stephenberry#3060) * fix: preserve capacity when writing to bounded C arrays (stephenberry#2961) (stephenberry#2973) * fix: preserve capacity when writing to bounded C arrays (stephenberry#2961) - Wrap bounded C arrays in std::span to preserve capacity during serialization and prevent decay to unchecked pointer - Ensure space before writing closing brace for bounded capacity buffers - Avoid writing closing brace if context already encountered an error - Add tests for bounded C array serialization and overflow handling * test: account for padding in bounded C-array partial writes Use a 512-byte C array for the successful partial-write test and assert that the former 32-byte buffer reports overflow. Document that C arrays use the same bounds checks and padding requirements as other fixed-size buffers. Signed-off-by: Alearner12 <siddharthtiwari155@yahoo.com> * fix: bound JSON tuple and metadata-array writes Signed-off-by: Alearner12 <siddharthtiwari155@yahoo.com> * fix: short-circuit reflection for registered serializers Reject specified types as a separate constraint before probing tuple_t. Empty std::tuple regression fixtures otherwise instantiate glz::get<0> under P2996 and fail to compile. Signed-off-by: Alearner12 <siddharthtiwari155@yahoo.com> * Report char[N] overflow from write_as, TOML/EETF, and ex::write * Treat char[N] as a bounded output buffer, not a raw pointer --------- Signed-off-by: Alearner12 <siddharthtiwari155@yahoo.com> Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Committing clang-format changes * Fix mutable generic at lookup (stephenberry#3006) * Fix mutable generic at lookup * Move mutable at() test to exceptions_test; update docs --------- Co-authored-by: Sean Li <sean0407@users.noreply.github.com> Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * yaml: append block sequence items to containers without resize() (stephenberry#3009) * yaml: append block sequence items to containers without resize() parse_block_sequence treated any non-resizable, non-emplaceable container as a fixed-size array and stopped once the index reached size(). A container that grows through emplace_back but has no resize() (a fixed-capacity vector) is empty after the clear, so the loop returned before the first item: a top-level block sequence failed with syntax_error, and a struct member silently stayed empty (stephenberry#2991). Flow sequences already appended to such containers. Skip the fixed-size check for emplace_backable containers too, which matches the element dispatch below it. * yaml: error on sequences longer than a std::array --------- Co-authored-by: ybai08 <271969568+ybai08@users.noreply.github.com> Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Keep const when wrapping a read_constraint member (stephenberry#3010) read_constraint_impl stripped cv-qualifiers from the object it wraps, so writing a const object tried to bind a non-const reference to it and failed to compile (stephenberry#2996). Keep the const, as self_constraint and cast already do; writing only reads the member, so nothing else needs to change. Co-authored-by: ybai08 <271969568+ybai08@users.noreply.github.com> * msgpack: read read_constraint, cast, as_array and manage members (stephenberry#3084) * CI: replace apt-key with signed-by keyring; pin noble LLVM jobs to ubuntu-24.04 (stephenberry#3087) * websocket_client: expose the TLS context through configure_ssl_context (stephenberry#3083) * websocket_client: expose the TLS context through configure_ssl_context The client's TLS context is private, so a caller can set the verify mode and add trust anchors but cannot require TLS 1.3, choose cipher suites, set ALPN or present a client certificate. http_client has configure_ssl_context for these and http_server gained it in stephenberry#2873. The new method runs its callable under ssl_ctx_mutex_ on the context connect() and the add_ca_* methods use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Update ssl_ctx_mutex_ comment --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * read beve numeric map keys at the width the header declares (stephenberry#3086) Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Isolate the YAML implicit-null literal from the document stream (stephenberry#3008) (stephenberry#3082) * Accept an empty TOML document (stephenberry#3079) * Accept an empty TOML document An empty buffer failed with no_read_input in the core read entry points, while "\n" or a lone comment read fine into a struct, so a struct of empty optionals could not read back the "" it writes. A TOML document with no keys is valid, so the TOML reader now decides by the target: a struct, a map or a generic takes it, and anything that cannot hold a document still returns no_read_input. * TOML: read an empty document into a meta value struct --------- Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * yaml: lay out glz::custom values by their getter's type (stephenberry#3088) * yaml: lay out glz::custom values by their getter's type (stephenberry#3057) Co-authored-by: Yunding Zhou <zhouyunding@users.noreply.github.com> * yaml: one block-value dispatch; honor custom_write; reject uninvocable getters in TOML * Resolve whole-type glz::custom metas; fix P2996 test build --------- Co-authored-by: Yunding Zhou <zhouyunding@users.noreply.github.com> * http_client: report request body progress with on_upload_progress (stephenberry#3061) stream_request_v2 gains on_upload_progress, the request-side twin of on_progress: it reports how much of the body the socket has taken against the body's size, (0, total) before the write, again between the socket's writes, and (total, total) once all of it has gone; returning false cancels the same way. It is driven by a completion condition on the existing async_write, so the request is written as before. A count that stops rising is how a caller tells a stalled upload from a slow one, since the timeout covers the whole exchange up to the response headers. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Compare generic numbers by value in JSON Patch test (stephenberry#3065) generic_i64 and generic_u64 store 1 and 1.0 as different variant alternatives, and glz::equal returned false on any index mismatch. RFC 6902 section 4.6 defines number equality numerically. The comparison is exact, so an integer that a double cannot represent does not match its rounded neighbor. Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Read TOML table headers at the root of a generic (stephenberry#3072) A document that opened with [table] or [[array of tables]] was taken for an array value and failed with syntax_error. The root now recognizes a header, and the map document reader learns arrays of tables, which it rejected outright. An array written as a value stays closed to [[header]] and to headers reaching into it. A bare array such as [1, 2, 3] still reads as an array; the text of a one element array, which is also a valid header, reads as an array only when nothing follows it. Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Judge TOML duplicate keys against the document, not the map (stephenberry#3071) A key a map held before the read was reported as a duplicate, so defaults, a merge or a second read into the same object made a well-formed document fail. The reader now records what the document has defined in a map, kept across [m] sections for a map member. A level that started out empty can still ask the map for its plain values, so a read into an empty map pays only for its tables. The record also knows how a table was defined, which fixes both directions of what the destination could not tell: [a.b] followed by [a] now reads, and extending a table written whole with a = {...} is now rejected. A dotted key into a map member, m.k = 1, failed even on an empty map and now reads. Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Support adjacent variant tagging in JSONB (stephenberry#3070) A variant whose glz::meta declares `content` was rejected at compile time for JSONB, so one meta could not serve JSON, BEVE and JSONB together. It now writes {tag: id, content: value} as in JSON and BEVE, and reads the two keys in either order, with the same errors for unknown, repeated and missing keys. Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Report out of range numbers from simple_float::from_chars (stephenberry#3064) * Report out of range numbers from simple_float::from_chars The value saturated to infinity or zero and the parse reported success, so opts_size read documents the default reader rejects. Return result_out_of_range and store the saturated value, as fast_float does. * Check opts_size float reads against the normal reader --------- Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Committing clang-format changes * Write no whole-range bounds on a double in a JSON schema (stephenberry#3095) * Write no whole-range bounds on a double in a JSON schema A double's schema carries +-1.7976931348623157E308 as its bounds, which exclude no number a JSON document can hold, which a generator writes out as a check of every value, and which glaze's own schema test notes it cannot read back into a schema type. to_json_schema writes a floating-point type's range only where it is narrower than a double's, comparing max_exponent: a float keeps +-3.4028234663852886E38, a double and a long double write none, and a bound a glz::json_schema declares is written as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Share the float schema bound rule and test long double * Take the long double schema title from name_v --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Name the int64 or uint64 format of a 64-bit integer in a JSON schema (stephenberry#3094) A reader that holds JSON numbers as doubles, which is every JavaScript one and most client generators built on one, rounds an integer past 2^53, and the bounds a 64-bit integer's schema carries are such numbers themselves. OpenAPI's format registry names int64 and uint64 for this, and generators type a member with that format as a 64-bit or big integer. defined_formats gains int64 and uint64, and to_json_schema writes the format on every 64-bit integer, beside the bounds, which stay, so a reader that recognises a wide integer by its bounds reads it as before. A glz::json_schema can also set the format, for an integer written as a quoted string. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Encode filesystem paths as UTF-8 on Windows (stephenberry#3092) * Encode filesystem paths as UTF-8 on Windows Fixes stephenberry#3085 * Move path UTF helpers into glz::detail --------- Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Enforce max_string_length on indefinite-length CBOR text strings (stephenberry#3106) * yaml: reject a collection where a string is expected (stephenberry#3104) Reading a string accepted a flow sequence or mapping, a block sequence entry, or an explicit key as a plain scalar. The collection's source text became the value ("name: [1, 2, 3]" read as "[1, 2, 3]"), and for a block sequence only the first entry was kept and the rest was dropped silently. A plain scalar cannot start with "[" or "{", nor with "-" or "?" followed by whitespace, so report a syntax error for these, as flow context already did. Quoted and block scalars are unaffected, and the writer already quotes strings that look like collections, so round trips are unchanged. * Fold "- " continuation lines into YAML plain scalars (stephenberry#3108) * Updating the Jsonifier URL. (stephenberry#3103) * enforce self_constraint in the binary and yaml object readers (stephenberry#3102) * Fix int8_t/int16_t to_chars where int32_t is not int (stephenberry#3109) * Fix int8_t/int16_t to_chars where int32_t is not int * Simplify small signed to_chars magnitude * Deprecate glz::raw_or_file (stephenberry#3110) * keep escapes in raw_or_file strings that do not name a file (stephenberry#3101) * Document that custom opts must provide every glz::opts field (stephenberry#3099) * Use the registry's options for REST endpoint JSON schemas (stephenberry#3098) * Use the registry's options for REST endpoint JSON schemas * Pin JSON format and null skipping in write_json_schema * Match schema required keys to the reader; simplify schema write opts and tests --------- Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Describe a filesystem path in a JSON schema as the string it is written as (stephenberry#3093) glaze writes a std::filesystem::path as its text, but array_t admits a path, since a path is also a range of paths, so to_json_schema describes it as an array whose items refer to the path's own definition, which nothing the JSON holds matches. readable_array_t and writable_array_t already leave filesystem_path out. The string specialization now takes filesystem_path and the array one leaves it out, so a path's schema is {"type":"string"}. Every other range is described as before. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * seed the speculation budget in read_into, read_jmespath, read_params (stephenberry#3091) glz::read seeds ctx.speculation_budget before it parses, and charge_speculation treats an unseeded budget as unlimited. The REPE read_params overloads, lazy_json_view::read_into, lazy_beve_view::read_into and both read_jmespath overloads parse caller input on a fresh context, so a nested ambiguous variant still cost branching^depth there: a 189 byte BEVE nest took 4 ms through read_beve and 32 s through lazy_beve read_into or a REPE registry call. Add seed_speculation_budget next to charge_speculation, use it in glz::read, and call it at those six sites. * reject unknown names in the json flags reader (stephenberry#3090) The flags reader set the member at the hashed index without checking that the string was that member's name. The hash only screens the length and a few bytes (for up to four names it is the first byte mod 4), so a string such as "exec" set execute on a read/write/execute flags type. Compare the name before setting the flag, as the object and enum readers do. * Reject reading JSON into a variant with indistinguishable alternatives (stephenberry#3078) * Reject reading JSON into a variant with indistinguishable alternatives Two alternatives with the same keys holding the same types and no discriminator cannot be told apart, so every read silently produced the first of them, whichever was written. That is now a static_assert in the JSON reader. Writing such a variant is unaffected, and so are alternatives that share keys but not their types. * fix: preserve capacity when writing to bounded C arrays (stephenberry#2961) (stephenberry#2973) * fix: preserve capacity when writing to bounded C arrays (stephenberry#2961) - Wrap bounded C arrays in std::span to preserve capacity during serialization and prevent decay to unchecked pointer - Ensure space before writing closing brace for bounded capacity buffers - Avoid writing closing brace if context already encountered an error - Add tests for bounded C array serialization and overflow handling * test: account for padding in bounded C-array partial writes Use a 512-byte C array for the successful partial-write test and assert that the former 32-byte buffer reports overflow. Document that C arrays use the same bounds checks and padding requirements as other fixed-size buffers. Signed-off-by: Alearner12 <siddharthtiwari155@yahoo.com> * fix: bound JSON tuple and metadata-array writes Signed-off-by: Alearner12 <siddharthtiwari155@yahoo.com> * fix: short-circuit reflection for registered serializers Reject specified types as a separate constraint before probing tuple_t. Empty std::tuple regression fixtures otherwise instantiate glz::get<0> under P2996 and fail to compile. Signed-off-by: Alearner12 <siddharthtiwari155@yahoo.com> * Report char[N] overflow from write_as, TOML/EETF, and ex::write * Treat char[N] as a bounded output buffer, not a raw pointer --------- Signed-off-by: Alearner12 <siddharthtiwari155@yahoo.com> Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Committing clang-format changes * Fix mutable generic at lookup (stephenberry#3006) * Fix mutable generic at lookup * Move mutable at() test to exceptions_test; update docs --------- Co-authored-by: Sean Li <sean0407@users.noreply.github.com> Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * yaml: append block sequence items to containers without resize() (stephenberry#3009) * yaml: append block sequence items to containers without resize() parse_block_sequence treated any non-resizable, non-emplaceable container as a fixed-size array and stopped once the index reached size(). A container that grows through emplace_back but has no resize() (a fixed-capacity vector) is empty after the clear, so the loop returned before the first item: a top-level block sequence failed with syntax_error, and a struct member silently stayed empty (stephenberry#2991). Flow sequences already appended to such containers. Skip the fixed-size check for emplace_backable containers too, which matches the element dispatch below it. * yaml: error on sequences longer than a std::array --------- Co-authored-by: ybai08 <271969568+ybai08@users.noreply.github.com> Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Keep const when wrapping a read_constraint member (stephenberry#3010) read_constraint_impl stripped cv-qualifiers from the object it wraps, so writing a const object tried to bind a non-const reference to it and failed to compile (stephenberry#2996). Keep the const, as self_constraint and cast already do; writing only reads the member, so nothing else needs to change. Co-authored-by: ybai08 <271969568+ybai08@users.noreply.github.com> * msgpack: read read_constraint, cast, as_array and manage members (stephenberry#3084) * CI: replace apt-key with signed-by keyring; pin noble LLVM jobs to ubuntu-24.04 (stephenberry#3087) * websocket_client: expose the TLS context through configure_ssl_context (stephenberry#3083) * websocket_client: expose the TLS context through configure_ssl_context The client's TLS context is private, so a caller can set the verify mode and add trust anchors but cannot require TLS 1.3, choose cipher suites, set ALPN or present a client certificate. http_client has configure_ssl_context for these and http_server gained it in stephenberry#2873. The new method runs its callable under ssl_ctx_mutex_ on the context connect() and the add_ca_* methods use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Update ssl_ctx_mutex_ comment --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * read beve numeric map keys at the width the header declares (stephenberry#3086) Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Isolate the YAML implicit-null literal from the document stream (stephenberry#3008) (stephenberry#3082) * Accept an empty TOML document (stephenberry#3079) * Accept an empty TOML document An empty buffer failed with no_read_input in the core read entry points, while "\n" or a lone comment read fine into a struct, so a struct of empty optionals could not read back the "" it writes. A TOML document with no keys is valid, so the TOML reader now decides by the target: a struct, a map or a generic takes it, and anything that cannot hold a document still returns no_read_input. * TOML: read an empty document into a meta value struct --------- Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Compare variant alternative shapes in linear time to stay under constexpr step limits * yaml: lay out glz::custom values by their getter's type (stephenberry#3088) * yaml: lay out glz::custom values by their getter's type (stephenberry#3057) Co-authored-by: Yunding Zhou <zhouyunding@users.noreply.github.com> * yaml: one block-value dispatch; honor custom_write; reject uninvocable getters in TOML * Resolve whole-type glz::custom metas; fix P2996 test build --------- Co-authored-by: Yunding Zhou <zhouyunding@users.noreply.github.com> * http_client: report request body progress with on_upload_progress (stephenberry#3061) stream_request_v2 gains on_upload_progress, the request-side twin of on_progress: it reports how much of the body the socket has taken against the body's size, (0, total) before the write, again between the socket's writes, and (total, total) once all of it has gone; returning false cancels the same way. It is driven by a completion condition on the existing async_write, so the request is written as before. A count that stops rising is how a caller tells a stalled upload from a slow one, since the timeout covers the whole exchange up to the response headers. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Compare generic numbers by value in JSON Patch test (stephenberry#3065) generic_i64 and generic_u64 store 1 and 1.0 as different variant alternatives, and glz::equal returned false on any index mismatch. RFC 6902 section 4.6 defines number equality numerically. The comparison is exact, so an integer that a double cannot represent does not match its rounded neighbor. Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Read TOML table headers at the root of a generic (stephenberry#3072) A document that opened with [table] or [[array of tables]] was taken for an array value and failed with syntax_error. The root now recognizes a header, and the map document reader learns arrays of tables, which it rejected outright. An array written as a value stays closed to [[header]] and to headers reaching into it. A bare array such as [1, 2, 3] still reads as an array; the text of a one element array, which is also a valid header, reads as an array only when nothing follows it. Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Judge TOML duplicate keys against the document, not the map (stephenberry#3071) A key a map held before the read was reported as a duplicate, so defaults, a merge or a second read into the same object made a well-formed document fail. The reader now records what the document has defined in a map, kept across [m] sections for a map member. A level that started out empty can still ask the map for its plain values, so a read into an empty map pays only for its tables. The record also knows how a table was defined, which fixes both directions of what the destination could not tell: [a.b] followed by [a] now reads, and extending a table written whole with a = {...} is now rejected. A dotted key into a map member, m.k = 1, failed even on an empty map and now reads. Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Support adjacent variant tagging in JSONB (stephenberry#3070) A variant whose glz::meta declares `content` was rejected at compile time for JSONB, so one meta could not serve JSON, BEVE and JSONB together. It now writes {tag: id, content: value} as in JSON and BEVE, and reads the two keys in either order, with the same errors for unknown, repeated and missing keys. Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Report out of range numbers from simple_float::from_chars (stephenberry#3064) * Report out of range numbers from simple_float::from_chars The value saturated to infinity or zero and the parse reported success, so opts_size read documents the default reader rejects. Return result_out_of_range and store the saturated value, as fast_float does. * Check opts_size float reads against the normal reader --------- Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Committing clang-format changes * Write no whole-range bounds on a double in a JSON schema (stephenberry#3095) * Write no whole-range bounds on a double in a JSON schema A double's schema carries +-1.7976931348623157E308 as its bounds, which exclude no number a JSON document can hold, which a generator writes out as a check of every value, and which glaze's own schema test notes it cannot read back into a schema type. to_json_schema writes a floating-point type's range only where it is narrower than a double's, comparing max_exponent: a float keeps +-3.4028234663852886E38, a double and a long double write none, and a bound a glz::json_schema declares is written as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Share the float schema bound rule and test long double * Take the long double schema title from name_v --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Name the int64 or uint64 format of a 64-bit integer in a JSON schema (stephenberry#3094) A reader that holds JSON numbers as doubles, which is every JavaScript one and most client generators built on one, rounds an integer past 2^53, and the bounds a 64-bit integer's schema carries are such numbers themselves. OpenAPI's format registry names int64 and uint64 for this, and generators type a member with that format as a 64-bit or big integer. defined_formats gains int64 and uint64, and to_json_schema writes the format on every 64-bit integer, beside the bounds, which stay, so a reader that recognises a wide integer by its bounds reads it as before. A glz::json_schema can also set the format, for an integer written as a quoted string. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Encode filesystem paths as UTF-8 on Windows (stephenberry#3092) * Encode filesystem paths as UTF-8 on Windows Fixes stephenberry#3085 * Move path UTF helpers into glz::detail --------- Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Enforce max_string_length on indefinite-length CBOR text strings (stephenberry#3106) * yaml: reject a collection where a string is expected (stephenberry#3104) Reading a string accepted a flow sequence or mapping, a block sequence entry, or an explicit key as a plain scalar. The collection's source text became the value ("name: [1, 2, 3]" read as "[1, 2, 3]"), and for a block sequence only the first entry was kept and the rest was dropped silently. A plain scalar cannot start with "[" or "{", nor with "-" or "?" followed by whitespace, so report a syntax error for these, as flow context already did. Quoted and block scalars are unaffected, and the writer already quotes strings that look like collections, so round trips are unchanged. * Fold "- " continuation lines into YAML plain scalars (stephenberry#3108) * Updating the Jsonifier URL. (stephenberry#3103) * enforce self_constraint in the binary and yaml object readers (stephenberry#3102) * Fix int8_t/int16_t to_chars where int32_t is not int (stephenberry#3109) * Fix int8_t/int16_t to_chars where int32_t is not int * Simplify small signed to_chars magnitude * Deprecate glz::raw_or_file (stephenberry#3110) * keep escapes in raw_or_file strings that do not name a file (stephenberry#3101) * Document that custom opts must provide every glz::opts field (stephenberry#3099) * Use the registry's options for REST endpoint JSON schemas (stephenberry#3098) * Use the registry's options for REST endpoint JSON schemas * Pin JSON format and null skipping in write_json_schema * Match schema required keys to the reader; simplify schema write opts and tests --------- Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Describe a filesystem path in a JSON schema as the string it is written as (stephenberry#3093) glaze writes a std::filesystem::path as its text, but array_t admits a path, since a path is also a range of paths, so to_json_schema describes it as an array whose items refer to the path's own definition, which nothing the JSON holds matches. readable_array_t and writable_array_t already leave filesystem_path out. The string specialization now takes filesystem_path and the array one leaves it out, so a path's schema is {"type":"string"}. Every other range is described as before. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * seed the speculation budget in read_into, read_jmespath, read_params (stephenberry#3091) glz::read seeds ctx.speculation_budget before it parses, and charge_speculation treats an unseeded budget as unlimited. The REPE read_params overloads, lazy_json_view::read_into, lazy_beve_view::read_into and both read_jmespath overloads parse caller input on a fresh context, so a nested ambiguous variant still cost branching^depth there: a 189 byte BEVE nest took 4 ms through read_beve and 32 s through lazy_beve read_into or a REPE registry call. Add seed_speculation_budget next to charge_speculation, use it in glz::read, and call it at those six sites. * reject unknown names in the json flags reader (stephenberry#3090) The flags reader set the member at the hashed index without checking that the string was that member's name. The hash only screens the length and a few bytes (for up to four names it is the first byte mod 4), so a string such as "exec" set execute on a read/write/execute flags type. Compare the name before setting the flag, as the object and enum readers do. --------- Signed-off-by: Alearner12 <siddharthtiwari155@yahoo.com> Co-authored-by: Sidhartha kumar <siddharthtiwari155@yahoo.com> Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> Co-authored-by: stephenberry <stephenberry@users.noreply.github.com> Co-authored-by: sean0407 <sean0407@gmail.com> Co-authored-by: Sean Li <sean0407@users.noreply.github.com> Co-authored-by: Yang Bai <yangbai2026@gmail.com> Co-authored-by: ybai08 <271969568+ybai08@users.noreply.github.com> Co-authored-by: Michael A. Eriksen <8325683+michaelaeriksen@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: uwezkhan <114483941+uwezkhan@users.noreply.github.com> Co-authored-by: Yunding Zhou <zhouyunding@users.noreply.github.com> Co-authored-by: Koi <helzky@proton.me> Co-authored-by: Kuri <163558705+Kuriyeatsuchi@users.noreply.github.com> Co-authored-by: RealTimeChris <40668522+RealTimeChris@users.noreply.github.com> Co-authored-by: Shu Chen <github@shuchen.ca> * Include base class members under P2996 reflection (stephenberry#3112) * Include base class members under P2996 reflection * Compute the reflected member list once per type * enforce max_string_length and max_array_size in msgpack readers (stephenberry#3113) * enforce max_string_length and max_array_size in msgpack readers * Apply max_array_size to fixed-size msgpack arrays --------- Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Report malformed containers during lazy_json iteration (stephenberry#3111) * CI: test Clang 21-23, pin ubuntu-latest jobs, add Dependabot for Actions (stephenberry#3114) * CI: cap P2996 build and test jobs at core count (stephenberry#3117) * Bump the github-actions group with 8 updates (stephenberry#3115) Bumps the github-actions group with 8 updates: | Package | From | To | | --- | --- | --- | | [actions/checkout](https://github.com/actions/checkout) | `6` | `7` | | [actions/upload-artifact](https://github.com/actions/upload-artifact) | `3` | `7` | | [EndBug/add-and-commit](https://github.com/endbug/add-and-commit) | `9` | `11` | | [actions/setup-python](https://github.com/actions/setup-python) | `4` | `7` | | [actions/configure-pages](https://github.com/actions/configure-pages) | `4` | `6` | | [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) | `3` | `5` | | [actions/deploy-pages](https://github.com/actions/deploy-pages) | `4` | `5` | | [erlef/setup-beam](https://github.com/erlef/setup-beam) | `1.24.0` | `1.24.1` | Updates `actions/checkout` from 6 to 7 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v6...v7) Updates `actions/upload-artifact` from 3 to 7 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](actions/upload-artifact@v3...v7) Updates `EndBug/add-and-commit` from 9 to 11 - [Release notes](https://github.com/endbug/add-and-commit/releases) - [Commits](EndBug/add-and-commit@v9...v11) Updates `actions/setup-python` from 4 to 7 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](actions/setup-python@v4...v7) Updates `actions/configure-pages` from 4 to 6 - [Release notes](https://github.com/actions/configure-pages/releases) - [Commits](actions/configure-pages@v4...v6) Updates `actions/upload-pages-artifact` from 3 to 5 - [Release notes](https://github.com/actions/upload-pages-artifact/releases) - [Commits](actions/upload-pages-artifact@v3...v5) Updates `actions/deploy-pages` from 4 to 5 - [Release notes](https://github.com/actions/deploy-pages/releases) - [Commits](actions/deploy-pages@v4...v5) Updates `erlef/setup-beam` from 1.24.0 to 1.24.1 - [Release notes](https://github.com/erlef/setup-beam/releases) - [Commits](erlef/setup-beam@v1.24.0...v1.24.1) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: actions/upload-artifact dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: EndBug/add-and-commit dependency-version: '11' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: actions/setup-python dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: actions/configure-pages dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: actions/upload-pages-artifact dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: actions/deploy-pages dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: erlef/setup-beam dependency-version: 1.24.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * CI: use Visual Studio's bundled clang-cl in build-direct-clang-cl (stephenberry#3124) * CI: move to Ubuntu 26.04 (stephenberry#3118) * CI: move to Ubuntu 26.04, drop Clang 19 and 20 * Keep Clang 19 and 20 via a shared install-clang action * skip the route handler when use() middleware rejects the request (stephenberry#3127) * skip the route handler when use() middleware rejects the request * Run use() middleware before streaming and WebSocket handlers --------- Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Committing clang-format changes * CI: run Packit Fedora builds on main only (stephenberry#3128) * Draw the websocket nonce and masking key from std::random_device (stephenberry#3123) * draw the websocket nonce and masking key from std::random_device A std::mt19937 seeded from one 32-bit draw is a deterministic function of that draw, so the 16-byte Sec-WebSocket-Key spanned 2^32 values rather than 2^128 and the per-frame masking key rested on a single draw. RFC 6455 4.1 asks for a freshly and randomly selected 16-byte nonce, and 5.3 requires the masking key to come from a strong source of entropy that does not make the next frame's key simple to predict. Draw both straight from std::random_device, held per thread so the masking path no longer constructs the entropy source per frame. * Take four bytes per random_device draw * Draw websocket random bytes from the OS CSPRNG * Use std::random_device, asking libstdc++ for /dev/urandom * Guard min/max from windows.h macros; prefer fd-free libstdc++ sources --------- Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> * Fix write_json_schema for non-aggregate meta types with json_schema (stephenberry#3129) * Fix build, improve header generation and upgrade to CMake 4.5 --------- Signed-off-by: Alearner12 <siddharthtiwari155@yahoo.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Michael A. Eriksen <8325683+michaelaeriksen@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Stephen Berry <stephenberry.developer@gmail.com> Co-authored-by: stephenberry <stephenberry@users.noreply.github.com> Co-authored-by: uwezkhan <114483941+uwezkhan@users.noreply.github.com> Co-authored-by: Jisan Halder <official.jisanhalder@gmail.com> Co-authored-by: MD@KuehneBSB <f.meier-doernberg@kuehne-bsb.de> Co-authored-by: hayt <2004297+hayt@users.noreply.github.com> Co-authored-by: Sidhartha kumar <siddharthtiwari155@yahoo.com> Co-authored-by: sean0407 <sean0407@gmail.com> Co-authored-by: Sean Li <sean0407@users.noreply.github.com> Co-authored-by: Yang Bai <yangbai2026@gmail.com> Co-authored-by: ybai08 <271969568+ybai08@users.noreply.github.com> Co-authored-by: kroplabeskidu <116884906+kroplabeskidu@users.noreply.github.com> Co-authored-by: Yunding Zhou <zhouyunding@users.noreply.github.com> Co-authored-by: Koi <helzky@proton.me> Co-authored-by: Kuri <163558705+Kuriyeatsuchi@users.noreply.github.com> Co-authored-by: RealTimeChris <40668522+RealTimeChris@users.noreply.github.com> Co-authored-by: Shu Chen <github@shuchen.ca> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ubuntu-24.04toubuntu-26.04(andubuntu-26.04-arm)..github/actions/install-clangcomposite action replaces the nine copies of the apt.llvm.org setup. It installs Clang and libc++ from the Ubuntu archive when the release is there (19 to 22 on 26.04), and only adds apt.llvm.org for newer ones (23), using the runner's own codename instead of a hardcodednoble.qemu-user(qemu-arm,qemu-s390x), since 26.04 no longer hasqemu-user-static.