Commit 70ba8e03 authored by Nils Goroll's avatar Nils Goroll

Send 100-continue after vcl_recv or when caching the request body

whichever comes first
parent 5a0817d1
......@@ -37,6 +37,7 @@
#include "vtim.h"
#include "hash/hash_slinger.h"
#include "storage/storage.h"
#include "cache_transport.h"
/*----------------------------------------------------------------------
* Pull the req.body in via/into a objcore
......@@ -84,6 +85,10 @@ vrb_pull(struct req *req, ssize_t maxsize, objiterate_f *func, void *priv)
AZ(req->req_bodybytes);
AN(req->htc);
yet = req->htc->content_length;
if (yet != 0 && req->want100cont) {
req->want100cont = 0;
(void) req->transport->minimal_response(req, 100);
}
if (yet < 0)
yet = 0;
do {
......
......@@ -747,6 +747,12 @@ cnt_recv(struct worker *wrk, struct req *req)
VCL_recv_method(req->vcl, wrk, req, NULL, NULL);
}
if (req->want100cont) {
req->want100cont = 0;
if (req->transport->minimal_response(req, 100))
return (-1);
}
/* Attempts to cache req.body may fail */
if (req->req_body_status == REQ_BODY_FAIL) {
req->doclose = SC_RX_BODY;
......
......@@ -328,9 +328,7 @@ http1_dissect(struct worker *wrk, struct req *req)
wrk->stats->client_req_417++;
return (-1);
}
http1_simple_response(req, R_100);
if (req->doclose)
return (-1);
req->want100cont = 1;
http_Unset(req->http, H_Expect);
}
......
......@@ -35,6 +35,7 @@ REQ_FLAG(hash_ignore_busy, 1, 1, "")
REQ_FLAG(hash_always_miss, 1, 1, "")
REQ_FLAG(is_hit, 0, 0, "")
REQ_FLAG(waitinglist, 0, 0, "")
REQ_FLAG(want100cont, 0, 0, "")
#undef REQ_FLAG
/*lint -restore */
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