Skip to content

http: Skip req and beresp trailers #4125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
dfd259c
v1f: Read end-of-chunk as part of the chunk
nigoroll May 30, 2022
53e5ebf
v1f: pull chunk header parsing into an own function
nigoroll May 30, 2022
c9cf501
v1f: Send VFP_END with last data for v1f chunked
nigoroll May 30, 2022
1abb0fa
Stabilize partial write -sdeprecated_persistent test
nigoroll May 30, 2022
785df1a
htc: Handle workspace overflow in WS_Pipeline()
walid-git Apr 30, 2024
58c0ca3
vrt: New .gettrls() callback in struct vdi_methods
walid-git Apr 25, 2024
49ce4a9
http1: Rename HTTP1_Complete() to HTTP1_Headers()
dridi Jun 17, 2024
16f13e0
http1: Introduce HTTP1_Trailers()
walid-git Apr 25, 2024
b4cab11
vdi: New VDI_GetTrl() function
walid-git Apr 25, 2024
1117c0a
body: New BS_TRAILERS body status
dridi Jun 17, 2024
e002a8a
http1: Learn how to dissect trailers
dridi Jun 17, 2024
818c8bb
http1: Extract reusable logic from V1F_FetchRespHdr()
dridi Jun 17, 2024
739b4a1
http1: Introduce HTTP1_RxTrailers()
dridi Apr 25, 2024
9e827c5
vbe: Implement the gettrls() method
dridi Jun 17, 2024
fe060fe
fetch: Parse final (CR)?LF outside of v1f_chunked
walid-git Apr 25, 2024
f1be56e
vrb: Process req trailers
walid-git May 3, 2024
caf39cd
hpack: Keep track of seeing any pseudo-header
walid-git Jun 18, 2024
29a53a5
http2_proto: Guard HEADERS setup for the IDLE state
walid-git Jun 18, 2024
05fbea9
hpack: Pass the request being decoded
walid-git Jun 18, 2024
5424456
http2: Add minimal support for trailers
walid-git Jun 14, 2024
2776798
http1_fsm: Homework for later
dridi Jun 18, 2024
e6adb44
vtc_http2: Avoid argv overflow
dridi Jun 24, 2024
9364f3b
vtc_http2: content-encoding is not a pseudo header
dridi Jun 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bin/varnishd/cache/cache_fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,9 @@ vbf_stp_fetchbody(struct worker *wrk, struct busyobj *bo)
}
} while (vfps == VFP_OK);

if (!vfc->failed && bo->htc->body_status == BS_TRAILERS)
vfc->failed = VDI_GetTrl(bo);
Comment on lines +620 to +621

Choose a reason for hiding this comment

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

Should this be squashed into the commit that causes connection pooling to break with backend chunked responses?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't have time to look closer, because this change is awaiting other h2-related work, but we'll look at this when it's time to rebase the branch.


if (vfc->failed) {
(void)VFP_Error(vfc, "Fetch pipeline failed to process");
bo->htc->doclose = SC_RX_BODY;
Expand Down
4 changes: 2 additions & 2 deletions bin/varnishd/http1/cache_http1_vfp.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,9 @@ v1f_chunked_pull(struct vfp_ctx *vc, struct vfp_entry *vfe, void *ptr,
if (vfe->priv2 != 0)
return (VFP_OK);
}
htc->body_status = BS_TRAILERS;
AZ(vfe->priv2);
vfps = v1f_chunk_end(vc, htc);
return (vfps == VFP_OK ? VFP_END : vfps);
return (VFP_END);
}

static const struct vfp v1f_chunked = {
Expand Down
24 changes: 24 additions & 0 deletions bin/varnishtest/tests/b00085.vtc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
varnishtest "Chunked response with trailers"

server s0 {
rxreq
txresp -nolen \
-hdr "Transfer-Encoding: chunked"
chunked chunk
chunked another
send "0\r\n"
send "Trailer: test\r\n"
send "\r\n"
} -start

varnish v1 -vcl+backend {
sub vcl_backend_response {
set beresp.do_stream = false;
}
} -start

client c1 {
txreq
rxresp
expect resp.status == 200
} -run
6 changes: 4 additions & 2 deletions bin/varnishtest/tests/r02645.vtc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ varnish v1 -vcl+backend {

client c1 -repeat 100 {
txreq -url "/"
# some responses will fail (503), some won't. All we care
# about here is the fact that we don't panic
# Some responses will fail (503), some won't. The server may not
# have enough space to process empty trailers. All we care about
# here is the fact that we don't panic
non_fatal
rxresp
} -run