r14213@tombo: nickm | 2008-02-16 15:48:07 -0500

Patch from Scott Lamb: make http content length into a 64-bit value.


svn:r641
This commit is contained in:
Nick Mathewson 2008-02-16 20:50:02 +00:00
parent 807ab182d0
commit d47907a730
3 changed files with 5 additions and 3 deletions

View File

@ -40,6 +40,8 @@ Changes in current version:
o event_base_get_method; from Springande Ulv
o Send CRLF after each chunk in HTTP output, for compliance with RFC2626. Patch from "propanbutan". Fixes bug 1894184.
o Add a int64_t parsing function, with unit tests, so we can apply Scott Lamb's fix to allow large HTTP values.
o Use a 64-bit field to hold HTTP content-lengths. Patch from Scott Lamb.
Changes in 1.4.0:
o allow \r or \n individually to separate HTTP headers instead of the standard "\r\n"; from Charles Kerr.

View File

@ -204,7 +204,7 @@ struct {
char *response_code_line; /* Readable response */
struct evbuffer *input_buffer; /* read data */
int ntoread;
ev_int64_t ntoread;
int chunked;
struct evbuffer *output_buffer; /* outgoing post or data */

4
http.c
View File

@ -707,7 +707,7 @@ evhttp_handle_chunked_read(struct evhttp_request *req, struct evbuffer *buf)
event_free(p);
continue;
}
req->ntoread = strtol(p, &endp, 16);
req->ntoread = evutil_strtoll(p, &endp, 16);
error = *p == '\0' || (*endp != '\0' && *endp != ' ');
event_free(p);
if (error) {
@ -1321,7 +1321,7 @@ evhttp_get_body_length(struct evhttp_request *req)
req->ntoread = -1;
} else {
char *endp;
req->ntoread = strtol(content_length, &endp, 10);
req->ntoread = evutil_strtoll(content_length, &endp, 10);
if (*content_length == '\0' || *endp != '\0') {
event_warnx("%s: illegal content length: %s",
__func__, content_length);