fix handling of chunked requests

svn:r328
This commit is contained in:
Niels Provos 2007-02-14 16:59:47 +00:00
parent 8901c141c9
commit 58f42c79e7
3 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -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
View File

@ -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 */