Provider fixes#709
Draft
bzeller wants to merge 3 commits into
Draft
Conversation
Replaces safe_strtonum to ensure protocol integrity and safe handling of non-null-terminated string views.
…e architecture to prevent crashes during asynchronous operations and ensure resource integrity. Lifecycle & Stability: - Fixed a potential use-after-free by migrating ProvideRequest to hold its owner as a WeakRef. This prevents ProvideQueue from dereferencing dangling pointers if an item is destroyed while its request is still active. - Refactored all callback sites in ProvideQueue to use a safe "lock-and-check" pattern when accessing the request owner. - Resolved a memory leak in _activeItems where cancelled requests were not properly dequeued because the lookup reference was cleared too early. The request object is now kept alive until the worker confirms cancellation. - Hardened immediateShutdown to explicitly clear all queues after notifying owners, ensuring a clean state after worker termination. Cache Implementation: - Corrected the inverted logic in the file cache death timer. Files are now properly evicted only after the 20-second timeout, rather than immediately. - Added logic to reset an entry's death timer if the file is re-accessed while still in the cache, preventing premature eviction. - Added a regression test case http_prov_cache_eviction to verify the timing-sensitive cache behavior.
…performance architecture using modern C++20 features. Protocol Engine Improvements: - Replaced macro-heavy switch-case parsing with a data-driven engine using SortedSchema definitions. - Implemented constexpr FNV-1a hashing for header names, enabling $O(\log F)$ binary search lookup via std::lower_bound. - Used consteval constructors to ensure all protocol schemas are sorted and checked for hash collisions strictly at compile time, with zero runtime overhead. - Consolidated parsing into a single-pass populate function that uses a stack-allocated std::bitset to track mandatory fields efficiently. - Improved diagnostic accuracy by linking error messages directly to the schema's typeName, ensuring protocol violations report the correct message context. Testing & Validation: - Added ProvideMessage_test.cc with 100% round-trip coverage for all 13 protocol message codes. - Verified correct handling of multi-value headers, extension headers (forward compatibility), and type-safe data conversion. - Implemented strict enforcement of complex protocol rules, such as the mandatory verification triplet in Attach messages.
bzeller
marked this pull request as draft
March 5, 2026 10:30
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.
No description provided.