Repository navigation
Added persistent server-sent event streams to the web server - #450
Merged
Merged
Conversation
Fixes eclipse-threadx#298 The web server closes responses without a content length and expires idle sessions, preventing applications from sending later events. Added explicit start and send APIs that keep only the selected event stream open. Ordinary HTTP connections retain their timeout. The web suite passed 56/56 in the default build and 56/56 without TLS. The new stream regression passed in both. Hardware was not tested. Assisted-by: Codex (GPT-6) <noreply@openai.com>
fdesbiens
force-pushed
the
fix/http-event-stream
branch
from
September 28, 2026 13:57
d99abfc to
9d77157
Compare
This was referenced Sep 28, 2026
The event stream branch could not merge because the web session files had concurrent disclosure-line edits. Keep the current header wording while retaining the event stream changes. The conflict resolution does not change runtime behavior. The GCC 14 CMake/Ninja web event stream regression passed 1/1 after the integration. The full web CI matrix will run on the updated branch. Assisted-by: Codex (gpt-6.1-sol) <noreply@openai.com>
fdesbiens
marked this pull request as draft
October 16, 2026 16:59
The event stream regression checked a successful delayed send but left argument validation, caller context, packet allocation, and send failures untested. Added focused API and state checks, plus failed allocation, failed TCP send, and oversized TLS record cases. The test restores live session state after each injected failure. GCC 14 CMake/Ninja web suites passed 56/56 with TLS and 56/56 without TLS. Changed production code reached 66/66 lines and 74/76 branches; the two uncovered packet append failure branches remain under review. Assisted-by: Codex (gpt-6.1-sol) <noreply@openai.com>
The event stream start and send APIs waited forever when an append needed another packet from an exhausted pool. This could stall the server callback or the application thread sending an event. Used NX_NO_WAIT for packet allocation and append in both APIs. A failed append releases its packet, leaves the stream state unchanged, and returns the NetX error. Added a one-packet pool regression for both paths. GCC 14 CMake/Ninja web suites passed 56/56 with TLS and 56/56 without TLS. Changed production code reached 66/66 lines and 76/76 branches. Not run on hardware. Assisted-by: Codex (gpt-6.1-sol) <noreply@openai.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.
Fixes #298
The web server closes responses without a content length and expires idle sessions, preventing applications from sending events later. Packet exhaustion during event stream setup or send could also leave a thread waiting indefinitely.
Added explicit Server-Sent Events start and send APIs for HTTP and HTTPS. Only the selected stream stays open while idle; ordinary HTTP connections retain their timeout. Packet allocation and append return immediately on exhaustion, releasing the allocated packet and leaving stream state unchanged. The API is documented in eclipse-threadx/rtos-docs-asciidoc#83, with the packet exhaustion behavior clarified in eclipse-threadx/rtos-docs-asciidoc#109.
GCC 14 CMake/Ninja web suites passed 56/56 with TLS and 56/56 without TLS. The regression received an event after the normal idle timeout in both builds and covered both packet append failures. Changed production code reached 66/66 lines and 76/76 branches. Not run on hardware.