From 58f42c79e7df54dd5f7136b6c006ba67b55f624f Mon Sep 17 00:00:00 2001 From: Niels Provos Date: Wed, 14 Feb 2007 16:59:47 +0000 Subject: [PATCH] fix handling of chunked requests svn:r328 --- buffer.c | 2 +- event.h | 2 +- http.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/buffer.c b/buffer.c index fe384753..77efd0cf 100644 --- a/buffer.c +++ b/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; diff --git a/event.h b/event.h index 4bdfb49b..65741d42 100644 --- a/event.h +++ b/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 *); diff --git a/http.c b/http.c index 281434cc..aa66889b 100644 --- a/http.c +++ b/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 */