Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Http refactor: move backend logic from Session to State
In order to fit HTTP2 modifications later: Mux sessions, generic HTTP Traits: trait L7ListenerHandler (impl by listeners) proxy trait L7Proxy (impl by proxies) state trait SessionState (impl by Http, Pipe, Expect) state machines of HTTP, HTTPS and TCP sessions: handle backend connection, passthrough, closing integrate https logic into new http state Replace State::Invalid by State::FailedUpgrade(marker) add the Invalid variant to Http state, extract it from the Option StateMachineBuilder macro to merge all State related boilerplate default behavior for SessionState::shutting_down() pass container_frontend_timeout to the State instead of the Session Session: clean closing of all sessions (add has_been_closed field) rewrite all session upgrades remove unused SessionResult::ReconnectBackend, remove HttpSession::back_token() and HttpsSession::back_token() make ProxySession::print_session() call SessionState::print_state() remove listener token and request timeout from HTTP and HTTPS Session Narrowing scopes: StateResult > SessionResult > SessionIsToBeClosed replace ProxySession::tokens() with ProxySession::frontend_token() Server rewrite: only the server calls ProxySession::close() generic session shutdown for the zombie_check and shutdown() change ProxySession::tokens() to frontend_tokens(), fix the zombie checker shut_down_sessions_by_frontend_tokens() the zombie checker has to be repaired to use only the frontend token end-to-end tests: test_http_behaviors replaces /lib/tests/http.rs test_tls_endpoint remove try_issue_810_panic_variant, no longer relevant Init logger with loglevel error is RUST_LOG is not found Use localhost instead of lolcatho.st for e2e test in pipeline renaming: config::HttpListener -> HttpListenerconfig (same for TCP and HTTPS) Session/Listener/Proxy -> add Tcp/Http/Https prefixes process_events -> update_readiness ProxySession::print_state -> ProxySession::print_session Fixed gauges: all "protocol.*" gauges are modified by the Sessions only "*.active_requests" are explicit Code cleanliness: sort alphabetically the field structs and function arguments relevant to this commit Replace if lets with exhaustive pattern matching documenting comments in relevant places Co-authored-by: Emmanuel Bosquet <bjokac@gmail.com>
- Loading branch information