Commit 6e58e283 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Don't send both c-l and chunked to backend for h2.

Fixes #2247
parent a575331d
......@@ -473,6 +473,7 @@ h2_do_req(struct worker *wrk, void *priv)
{
struct req *req;
struct h2_req *r2;
const char *b;
CAST_OBJ_NOTNULL(req, priv, REQ_MAGIC);
CAST_OBJ_NOTNULL(r2, req->transport_priv, H2_REQ_MAGIC);
......@@ -483,6 +484,15 @@ h2_do_req(struct worker *wrk, void *priv)
// XXX: Have I mentioned H/2 Is hodge-podge ?
http_CollectHdrSep(req->http, H_Cookie, "; "); // rfc7540,l,3114,3120
if (req->req_body_status == REQ_BODY_INIT) {
if (!http_GetHdr(req->http, H_Content_Length, &b))
req->req_body_status = REQ_BODY_WITHOUT_LEN;
else
req->req_body_status = REQ_BODY_WITH_LEN;
} else {
assert (req->req_body_status == REQ_BODY_NONE);
}
req->http->conds = 1;
if (CNT_Request(wrk, req) != REQ_FSM_DISEMBARK) {
AZ(req->ws->r);
......@@ -517,8 +527,6 @@ h2_end_headers(struct worker *wrk, const struct h2_sess *h2,
if (h2->rxf_flags & H2FF_HEADERS_END_STREAM)
req->req_body_status = REQ_BODY_NONE;
else
req->req_body_status = REQ_BODY_WITHOUT_LEN;
req->req_step = R_STP_TRANSPORT;
req->task.func = h2_do_req;
......
......@@ -4,6 +4,8 @@ barrier b1 cond 2
server s1 {
rxreq
expect req.http.content-length == 7
expect req.http.transfer-encoding == <undef>
barrier b1 sync
txresp -hdr "Content-Type: text/plain" -body response
} -start
......
......@@ -4,6 +4,8 @@ barrier b1 cond 2
server s1 {
rxreq
expect req.http.content-length == <undef>
expect req.http.transfer-encoding == chunked
expect req.proto == HTTP/1.1
barrier b1 sync
txresp -hdr "Content-Type: text/plain" -body response
......@@ -21,7 +23,6 @@ client c1 {
-nohdrend
txcont \
-hdr expect 100-continue \
-hdr content-length 7 \
-nostrend
rxhdrs
......
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