Merge remote-tracking branch 'origin/patches-2.0'

This commit is contained in:
Nick Mathewson 2011-05-27 15:09:54 -04:00
commit 356720a23b
2 changed files with 7 additions and 2 deletions

4
http.c
View File

@ -882,7 +882,7 @@ evhttp_handle_chunked_read(struct evhttp_request *req, struct evbuffer *buf)
}
/* ntoread is signed int64, body_size is unsigned size_t, check for under/overflow conditions */
if (ntoread > EV_SIZE_MAX - req->body_size) {
if ((ev_uint64_t)ntoread > EV_SIZE_MAX - req->body_size) {
return DATA_CORRUPTED;
}
@ -908,7 +908,7 @@ evhttp_handle_chunked_read(struct evhttp_request *req, struct evbuffer *buf)
}
/* don't have enough to complete a chunk; wait for more */
if (buflen < req->ntoread)
if (req->ntoread > 0 && buflen < (ev_uint64_t)req->ntoread)
return (MORE_DATA_EXPECTED);
/* Completed chunk */

View File

@ -2218,6 +2218,7 @@ test_many_events(void *arg)
int called[MANY];
int i;
int loopflags = EVLOOP_NONBLOCK, evflags=0;
const int is_evport = !strcmp(event_base_get_method(base),"evport");
if (one_at_a_time) {
loopflags |= EVLOOP_ONCE;
evflags = EV_PERSIST;
@ -2226,6 +2227,10 @@ test_many_events(void *arg)
memset(sock, 0xff, sizeof(sock));
memset(ev, 0, sizeof(ev));
memset(called, 0, sizeof(called));
if (is_evport && one_at_a_time) {
TT_DECLARE("NOTE", ("evport can't pass this in 2.0; skipping\n"));
tt_skip();
}
for (i = 0; i < MANY; ++i) {
/* We need an event that will hit the backend, and that will