mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
Merge remote-tracking branch 'origin/patches-2.0'
This commit is contained in:
commit
356720a23b
4
http.c
4
http.c
@ -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 */
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user