mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +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
|
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 need = buf->misalign + buf->off + datlen;
|
||||||
size_t oldoff = buf->off;
|
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);
|
struct evbuffer *evbuffer_new(void);
|
||||||
void evbuffer_free(struct evbuffer *);
|
void evbuffer_free(struct evbuffer *);
|
||||||
int evbuffer_expand(struct evbuffer *, size_t);
|
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);
|
int evbuffer_remove(struct evbuffer *, void *, size_t);
|
||||||
char *evbuffer_readline(struct evbuffer *);
|
char *evbuffer_readline(struct evbuffer *);
|
||||||
int evbuffer_add_buffer(struct evbuffer *, 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)
|
if (strlen(p) == 0)
|
||||||
continue;
|
continue;
|
||||||
req->ntoread = strtol(p, &endp, 16);
|
req->ntoread = strtol(p, &endp, 16);
|
||||||
error = *p == '\0' || *endp != '\0';
|
error = *p == '\0' || (*endp != '\0' && *endp != ' ');
|
||||||
free(p);
|
free(p);
|
||||||
if (error) {
|
if (error) {
|
||||||
/* could not get chunk size */
|
/* could not get chunk size */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user