mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-12 13:58:58 -04:00
http: assert's that evbuffer_drain() success on connection reset
Since otherwise we can have nasty bugs with part of previous *request* in current *request* and hence some parsing errors. And now we have failures: http/non_lingering_close: [forking] [err] ../http.c:1326: Assertion !evbuffer_drain(tmp, -1) failed in ../http.c
This commit is contained in:
parent
04fc82f7ad
commit
2185e63921
4
http.c
4
http.c
@ -1323,9 +1323,9 @@ evhttp_connection_reset_(struct evhttp_connection *evcon)
|
||||
|
||||
/* we need to clean up any buffered data */
|
||||
tmp = bufferevent_get_output(evcon->bufev);
|
||||
evbuffer_drain(tmp, evbuffer_get_length(tmp));
|
||||
EVUTIL_ASSERT(!evbuffer_drain(tmp, -1));
|
||||
tmp = bufferevent_get_input(evcon->bufev);
|
||||
evbuffer_drain(tmp, evbuffer_get_length(tmp));
|
||||
EVUTIL_ASSERT(!evbuffer_drain(tmp, -1));
|
||||
|
||||
evcon->state = EVCON_DISCONNECTED;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user