mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
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:
parent
807ab182d0
commit
d47907a730
@ -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.
|
||||
|
2
evhttp.h
2
evhttp.h
@ -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
4
http.c
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user