Repository navigation
refactor(kawa_h1): introduce Origin struct for backend connection management - #1206
Closed
FlorentinDUBOIS wants to merge 2 commits into
Closed
FlorentinDUBOIS wants to merge 2 commits into
FlorentinDUBOIS wants to merge 2 commits into
Conversation
…agement Replace inline backend connection fields (backend, backend_socket, backend_token, backend_connection_status) on the Http struct with a single `Option<Origin>` that encapsulates all backend state. Add `ResponseStream::DefaultAnswerKA` variant for keep-alive during default answers and `ResponseStream::Swaping` for mem::replace pattern. Update answers::get() to return (u16, bool, DefaultAnswerStream) tuple in preparation for template-level keep-alive detection. Signed-off-by: Florentin Dubois <[email protected]>
This was referenced Mar 9, 2026
- Fix typo: rename ResponseStream::Swaping to Swapping - Fix backend_writable missing DefaultAnswerKA check that could cause writes to backend socket during default answer delivery - Replace unreachable!() in connect_to_backend with proper error handling when cluster_id is missing on reconnection attempt Signed-off-by: Florentin Dubois <[email protected]>
llenotre
approved these changes
Mar 11, 2026
5 tasks done
FlorentinDUBOIS
added a commit
that referenced
this pull request
Apr 28, 2026
…chema Lay the wire schema for the bundled feature work that brings PR #1206..#1210 onto current main. Wave 1 of a multi-wave implementation; subsequent waves land the runtime engine, mux integration, auth helper, e2e tests, and docs. Cluster gains four fields: per-cluster `answers` (status code → template body) at field 9, `https_redirect_port` at 10, `authorized_hashes` at 11, and `www_authenticate` realm at 12. RequestHttpFrontend gains eight: `redirect` policy at 8, `required_auth` at 9, `redirect_scheme` at 10, `redirect_template` at 11, `rewrite_host`/`rewrite_path`/`rewrite_port` at 12-14, and a repeated `headers` list at 15. Listener configs gain a parallel `answers` map at 31 (HttpListenerConfig) and 43 (HttpsListenerConfig); the legacy `CustomHttpAnswers http_answers` field is preserved on the wire so existing state files round-trip — the runtime will read both for one minor. New top-level enums RedirectPolicy / RedirectScheme / HeaderPosition and a Header message land alongside. An empty `Header.val` deletes the named header (HAProxy `del-header` parity). prost stops auto-deriving Hash/Eq once a message holds a map field, so the build script gains explicit `#[derive(Hash, Eq)]` for Cluster, HttpListenerConfig, HttpsListenerConfig, UpdateHttpListenerConfig, and UpdateHttpsListenerConfig. Existing initializers grow a `..Default::default()` fallthrough so this commit is a pure additive scaffolding step — no runtime behaviour changes yet. Signed-off-by: Florentin Dubois <[email protected]>
jrcribb
pushed a commit
to jrcribb/sozu
that referenced
this pull request
Aug 10, 2026
…chema Lay the wire schema for the bundled feature work that brings PR sozu-proxy#1206..sozu-proxy#1210 onto current main. Wave 1 of a multi-wave implementation; subsequent waves land the runtime engine, mux integration, auth helper, e2e tests, and docs. Cluster gains four fields: per-cluster `answers` (status code → template body) at field 9, `https_redirect_port` at 10, `authorized_hashes` at 11, and `www_authenticate` realm at 12. RequestHttpFrontend gains eight: `redirect` policy at 8, `required_auth` at 9, `redirect_scheme` at 10, `redirect_template` at 11, `rewrite_host`/`rewrite_path`/`rewrite_port` at 12-14, and a repeated `headers` list at 15. Listener configs gain a parallel `answers` map at 31 (HttpListenerConfig) and 43 (HttpsListenerConfig); the legacy `CustomHttpAnswers http_answers` field is preserved on the wire so existing state files round-trip — the runtime will read both for one minor. New top-level enums RedirectPolicy / RedirectScheme / HeaderPosition and a Header message land alongside. An empty `Header.val` deletes the named header (HAProxy `del-header` parity). prost stops auto-deriving Hash/Eq once a message holds a map field, so the build script gains explicit `#[derive(Hash, Eq)]` for Cluster, HttpListenerConfig, HttpsListenerConfig, UpdateHttpListenerConfig, and UpdateHttpsListenerConfig. Existing initializers grow a `..Default::default()` fallthrough so this commit is a pure additive scaffolding step — no runtime behaviour changes yet. Signed-off-by: Florentin Dubois <[email protected]>
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.
Summary
Originstruct to encapsulate all backend connection state (cluster_id,backend_id,backend,token,connected,socket) replacing 4 separate fields (backend,backend_socket,backend_token,backend_connection_status) on theHttpstructResponseStream::DefaultAnswerKAvariant (boxed) for keep-alive during default answers andResponseStream::Swapingformem::replacepatternanswers::get()return type fromDefaultAnswerStreamto(u16, bool, DefaultAnswerStream)tuple (keep_alive always false for now, PR B will add template-level detection)upgrade_httpin bothhttp.rsandhttps.rsto destructureOriginwhen upgrading to WebSocketContext
This is PR A in a series of 4 PRs splitting PR #1162 (rewrite/redirect feature):
Test plan
cargo check --workspacepassescargo clippy --workspace-- no new warningscargo +nightly fmt-- all files formattedcargo test --workspace-- all 69 tests pass