set body length+offset to 0 when populating data.

otherwise this isn't properly picked up by http_body_read() later
if dealing with in-memory HTTP bodies and you get inconsistent behaviour.
This commit is contained in:
Joris Vink 2019-04-02 22:26:44 +02:00
parent 5d16a7a123
commit a191445f76
1 changed files with 2 additions and 0 deletions

View File

@ -1106,6 +1106,8 @@ http_populate_post(struct http_request *req)
body = NULL;
req->http_body->offset = req->content_length;
string = kore_buf_stringify(req->http_body, NULL);
req->http_body_length = 0;
req->http_body_offset = 0;
} else {
body = kore_buf_alloc(128);
for (;;) {