Commit 40ec4a6b authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

The chunk-counter is http/1 specific

parent db403d95
...@@ -582,6 +582,7 @@ struct req { ...@@ -582,6 +582,7 @@ struct req {
struct { struct {
ssize_t bytes_done; ssize_t bytes_done;
ssize_t bytes_yet; ssize_t bytes_yet;
intptr_t chunk_ctr;
} h1; /* HTTP1 specific */ } h1; /* HTTP1 specific */
/* The busy objhead we sleep on */ /* The busy objhead we sleep on */
...@@ -599,7 +600,6 @@ struct req { ...@@ -599,7 +600,6 @@ struct req {
unsigned char wantbody; unsigned char wantbody;
uint64_t req_bodybytes; /* Parsed req bodybytes */ uint64_t req_bodybytes; /* Parsed req bodybytes */
intptr_t chunk_ctr; /* Parsed req bodybytes */
uint64_t resp_hdrbytes; /* Scheduled resp hdrbytes */ uint64_t resp_hdrbytes; /* Scheduled resp hdrbytes */
uint64_t resp_bodybytes; /* Scheduled resp bodybytes */ uint64_t resp_bodybytes; /* Scheduled resp bodybytes */
......
...@@ -286,7 +286,7 @@ http1_req_body_status(struct req *req) ...@@ -286,7 +286,7 @@ http1_req_body_status(struct req *req)
return (REQ_BODY_PRESENT); return (REQ_BODY_PRESENT);
} }
if (http_HdrIs(req->http, H_Transfer_Encoding, "chunked")) { if (http_HdrIs(req->http, H_Transfer_Encoding, "chunked")) {
req->chunk_ctr = -1; req->h1.chunk_ctr = -1;
return (REQ_BODY_CHUNKED); return (REQ_BODY_CHUNKED);
} }
if (http_GetHdr(req->http, H_Transfer_Encoding, NULL)) if (http_GetHdr(req->http, H_Transfer_Encoding, NULL))
...@@ -511,7 +511,7 @@ http1_iter_req_body(struct req *req, enum req_body_state_e bs, ...@@ -511,7 +511,7 @@ http1_iter_req_body(struct req *req, enum req_body_state_e bs,
req->acct.req_bodybytes += len; req->acct.req_bodybytes += len;
return (len); return (len);
} else if (bs == REQ_BODY_CHUNKED) { } else if (bs == REQ_BODY_CHUNKED) {
switch (HTTP1_Chunked(req->htc, &req->chunk_ctr, &err, switch (HTTP1_Chunked(req->htc, &req->h1.chunk_ctr, &err,
&req->acct.req_bodybytes, buf, &len)) { &req->acct.req_bodybytes, buf, &len)) {
case H1CR_ERROR: case H1CR_ERROR:
VSLb(req->vsl, SLT_Debug, "CHUNKERR: %s", err); VSLb(req->vsl, SLT_Debug, "CHUNKERR: %s", err);
......
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