mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
fix handling of chunked requests
svn:r328
This commit is contained in:
parent
8901c141c9
commit
58f42c79e7
2
buffer.c
2
buffer.c
@ -291,7 +291,7 @@ evbuffer_expand(struct evbuffer *buf, size_t datlen)
|
||||
}
|
||||
|
||||
int
|
||||
evbuffer_add(struct evbuffer *buf, void *data, size_t datlen)
|
||||
evbuffer_add(struct evbuffer *buf, const void *data, size_t datlen)
|
||||
{
|
||||
size_t need = buf->misalign + buf->off + datlen;
|
||||
size_t oldoff = buf->off;
|
||||
|
2
event.h
2
event.h
@ -279,7 +279,7 @@ void bufferevent_settimeout(struct bufferevent *bufev,
|
||||
struct evbuffer *evbuffer_new(void);
|
||||
void evbuffer_free(struct evbuffer *);
|
||||
int evbuffer_expand(struct evbuffer *, size_t);
|
||||
int evbuffer_add(struct evbuffer *, void *, size_t);
|
||||
int evbuffer_add(struct evbuffer *, const void *, size_t);
|
||||
int evbuffer_remove(struct evbuffer *, void *, size_t);
|
||||
char *evbuffer_readline(struct evbuffer *);
|
||||
int evbuffer_add_buffer(struct evbuffer *, struct evbuffer *);
|
||||
|
2
http.c
2
http.c
@ -635,7 +635,7 @@ evhttp_handle_chunked_read(struct evhttp_request *req, struct evbuffer *buf)
|
||||
if (strlen(p) == 0)
|
||||
continue;
|
||||
req->ntoread = strtol(p, &endp, 16);
|
||||
error = *p == '\0' || *endp != '\0';
|
||||
error = *p == '\0' || (*endp != '\0' && *endp != ' ');
|
||||
free(p);
|
||||
if (error) {
|
||||
/* could not get chunk size */
|
||||
|
Loading…
x
Reference in New Issue
Block a user