bneradt commented on PR #14013: URL: https://github.com/apache/trafficserver/pull/14013#issuecomment-6864470517
@bryancall Thanks for the careful review. Updated in d447f22ebf. **Line-boundary cut.** The check now uses this call's `bytes_used` instead of the running `server_response_hdr_bytes`, as you suggested, so an HTTP/1.1 header cut after `Content-Length: 5\r\n` logs again. **Test.** Added `tests/uranium_tests/h2/test_h2_origin_bodyless_eos_log.py` with a small origin (`bodyless_eos_origin.py`). An HTTP/2 origin answers HEAD (200, CL: 5), 204, 304 with and without CL: 5, an empty 200, a 302 with CL: 0, and a 103 followed by a 204, all ending on HEADERS with END_STREAM. The client checks each status. Two cases must still log, and they run last so their lines also act as a flush barrier: an HTTP/2 RST_STREAM before HEADERS, and an HTTP/1.1 header cut at a line boundary. The test waits for both lines, then fails if error.log has a "Server closed connection while reading response header" line for any other path. The 304 requests are conditional (`If-None-Match`). ATS's HTTP/2 payload-length check accepts a Content-Length with no body on a 304 only when it answers a conditional GET. An unconditional GET that gets a 304 with CL: 5 is reset as a bad payload length, returns a 502, and is logged, which is correct. **Comment.** Reworded. It now explains why EOS alone is not enough (an HTTP/2 stream reports EOS when HEADERS carries END_STREAM), and that the check fires on a parse failure or on an EOS with no new header bytes. **Verification.** - Base (HttpSM.cc before this PR): the test fails. All 7 bodyless paths are logged. - Previous revision (d56f6abfd0): the test fails. The `/header-cut-at-line` line is missing. - This revision: the test passes, 6 runs in a row. - Related urtests (`bodyless`, `h2origin`, `h2_origin`, `h2_to_origin`, `http2_origin`, `connect_down_policy`, `bad_http_fmt`, `origin_connection`, `tls_flow_control`, `chunked_h2`): 84 passed. - `cmake --build build -t format`: clean. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
