Skip to content

First integration of kawa in H1 state - #904

Merged
Wonshtrum merged 15 commits into
mainfrom
htx
Jun 16, 2023
Merged

Wonshtrum merged 15 commits into
mainfrom
htx

Conversation

@Wonshtrum

@Wonshtrum Wonshtrum commented Mar 27, 2023 •

Copy link
Copy Markdown
Member

This is the first step in the HTX integration for Sozu. The goal of this branch is to swap the Http parsers and state machines of the Http State with the Htx pipeline. The new State should take an HTTP/1.1 stream in input, convert it into Htx, edit this intermediary form, and convert it back to HTTP/1.1 before forwarding it.

  • Htx parse
  • Htx edit
  • Htx convert
  • handle connect/upgrade
  • handle expect-100
  • handle keep-alive
  • handle sticky sessions

These modifications are shortlived as Htx will only reveal its true potential when the Http State is replaced with a MixedHttp State (mixing H1 and H2 endpoints). This branch proves a point and accelerates the development of the Htx crate by pointing out its flaws. The following issues immediately arise:

  • Htx::h1::parser hooks
  • stricter Htx::h1::parser
  • StatusLine storing
  • Cookies storing

@Wonshtrum Wonshtrum added the h1 label Mar 27, 2023
@Wonshtrum Wonshtrum added this to the HTTP2 milestone Mar 27, 2023
@Wonshtrum Wonshtrum self-assigned this Mar 27, 2023
@Keksoj

Keksoj commented Apr 24, 2023 •

Copy link
Copy Markdown

We'll have to rebase the main branch since #905 has been merged.

edit: done

@Wonshtrum
Wonshtrum force-pushed the htx branch 3 times, most recently from 5edcb07 to e9ed02c Compare April 28, 2023 15:35

@Keksoj Keksoj left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! I nitpicked some wording and demanded some comments for clarity.

Comment thread e2e/src/tests/tests.rs Resolved
Comment thread lib/src/protocol/kawa_h1/editor.rs Resolved
Comment thread lib/src/protocol/kawa_h1/editor.rs Resolved
Comment thread lib/src/protocol/kawa_h1/editor.rs Resolved
Comment thread lib/src/protocol/kawa_h1/mod.rs Resolved
Comment thread lib/src/protocol/kawa_h1/mod.rs Resolved
Comment thread lib/src/protocol/kawa_h1/mod.rs Resolved
Comment thread lib/src/protocol/kawa_h1/mod.rs Resolved
Comment thread lib/src/protocol/kawa_h1/mod.rs Resolved
Comment thread lib/src/tcp.rs Resolved
@FlorentinDUBOIS FlorentinDUBOIS changed the title First integration of HTX in H1 state First integration of kawa in H1 state May 4, 2023
@Keksoj

Keksoj commented May 13, 2023

Copy link
Copy Markdown

please rebase, we risk having a harder time resolving conflicts as time goes by.

Wonshtrum added 12 commits June 5, 2023 15:00
- Change Ready::readable() and alike function to scoped constant
  (Ready::READABLE...)
- Merge RequestContet and ResponseContext in HttpContext
- Move HttpContext in Http State (to pass a mutable reference to the
  BlockConverter instead of a copy)
- Reworked the HTTP flow (through Readiness interest/event)
- Implement vectored_write for Rustls Front

Signed-off-by: Eloi DEMOLIS <[email protected]>
Signed-off-by: Eloi DEMOLIS <[email protected]>
- Update from HTX 0.4.1 to Kawa 0.5.0!
- Fix http mi test (better handling of backend hup/error)
- Rename http/tcp mi test in http/tcp round_trip
- Properly get front/back keep-alive from request/response
- Add keep-alive e2e test

Signed-off-by: Eloi DEMOLIS <[email protected]>
- Update to Kawa 0.5.1
- Support sticky_session
- Add sticky_session configuration for e2e
- Add sticky_session e2e test
- Fix backend_keep_alive reset

Signed-off-by: Eloi DEMOLIS <[email protected]>
- Update to Kawa 0.5.2
- Cargo update
- Add From<RequestType> for Request
- Add e2e helper functions: send_proxy_request_type, soft_close,
  hard_close
- Fix dropped early data in HTTP upgrades (add sync on Checkout,
  update e2e)
- Fix "Cookies" header name (replace by "Cookie")
- Fix semicolon after last cookie crumb in e2e tests
- Add documenting comments on: HttpContext, callbacks, reset,
  ready_inner...

Signed-off-by: Eloi DEMOLIS <[email protected]>
Signed-off-by: Eloi DEMOLIS <[email protected]>
- Use CachedTags in listeners to avoid tags contatenation
- Add get_concatenated_tags on ListenerHandler
- Create logs module to mutualise access logs structs and methods
- Use new logs primitive to refactor:
  - Http::log_request_success
  - Http::log_default_answer_success
  - Http::log_request_error
  - Pipe::log_request_success
  - Pipe::log_request_error
  - TcpSession::log_request
- Capture method, authority, path, status and reason in the HttpContext
  to avoid Kawa elision
- Remove get_response_line and get_request_line (use HttpContext
  instead)
- Capture user_agent in HttpContext for potential use in access logs
- Remove unneeded metrics.service_stop calls
- Remove Pipe::log_ctx in favor of LogContext and log_context()
- Add socket_info to get rtt from a socket (for unix and special case
  for mac)

Signed-off-by: Eloi DEMOLIS <[email protected]>
Signed-off-by: Eloi DEMOLIS <[email protected]>
- Bump Kawa to 0.6.2
- Add 103 support in HTTP State
- Add 103 e2e test in http_behaviors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants