mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Correctly count req->body_size on http usage without Content-Length
There was a dumb bug where we would look at the length of the input buffer immediately _after_ we drained it.
This commit is contained in:
parent
58a1cc6bc8
commit
8e342e5630
2
http.c
2
http.c
@ -874,8 +874,8 @@ evhttp_read_body(struct evhttp_connection *evcon, struct evhttp_request *req)
|
||||
}
|
||||
} else if (req->ntoread < 0) {
|
||||
/* Read until connection close. */
|
||||
evbuffer_add_buffer(req->input_buffer, buf);
|
||||
req->body_size += evbuffer_get_length(buf);
|
||||
evbuffer_add_buffer(req->input_buffer, buf);
|
||||
} else if (req->chunk_cb != NULL ||
|
||||
evbuffer_get_length(buf) >= (size_t)req->ntoread) {
|
||||
/* We've postponed moving the data until now, but we're
|
||||
|
Loading…
x
Reference in New Issue
Block a user