Commit b8a37531 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

vbe: Check failures to send the request earlier

There's no point waiting for the backend to complain if we weren't able
to properly send the backend request.

Fixes #3556
parent 89769581
......@@ -300,7 +300,7 @@ vbe_dir_gethdrs(VRT_CTX, VCL_BACKEND d)
i = V1F_SendReq(wrk, bo, &bo->acct.bereq_hdrbytes,
&bo->acct.bereq_bodybytes);
if (PFD_State(pfd) != PFD_STATE_USED) {
if (i == 0 && PFD_State(pfd) != PFD_STATE_USED) {
if (VCP_Wait(wrk, pfd, VTIM_real() +
bo->htc->first_byte_timeout) != 0) {
bo->htc->doclose = SC_RX_TIMEOUT;
......
varnishtest "#3556"
server s1 {
rxreq
txresp
non_fatal
rxreq
} -start
varnish v1 -cliok "param.set first_byte_timeout 10"
varnish v1 -vcl+backend {} -start
client c1 {
txreq
rxresp
} -run
logexpect l2 -v v1 -q "ReqMethod eq POST" {
expect * * End
} -start
client c2 {
txreq -req POST \
-hdr "Content-Length: 10" \
-hdr "Content-Type: text/plain"
send incompl
} -run
logexpect l2 -wait
shell -expect POST {
exec varnishncsa -d -n ${v1_name} -q 'Timestamp:Process[2] < 10.0'
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment