mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-09 12:28:19 -04:00
http: get fd from be layer during connection reset
Since it can be non -1, and we must close it, otherwise we will have problems. And after this patch the following tests report fd 2307 instead of 2309 fd leaks: $ valgrind --leak-check=full --show-reachable=yes --track-fds=yes --error-exitcode=1 regress --no-fork http/cancel.. ==10853== FILE DESCRIPTORS: 2307 open at exit.
This commit is contained in:
parent
86dfd2ced1
commit
4a53c54bf7
3
http.c
3
http.c
@ -1329,6 +1329,9 @@ evhttp_connection_reset_(struct evhttp_connection *evcon)
|
||||
*/
|
||||
bufferevent_disable_hard_(evcon->bufev, EV_READ|EV_WRITE);
|
||||
|
||||
if (evcon->fd == -1)
|
||||
evcon->fd = bufferevent_getfd(evcon->bufev);
|
||||
|
||||
if (evcon->fd != -1) {
|
||||
/* inform interested parties about connection close */
|
||||
if (evhttp_connected(evcon) && evcon->closecb != NULL)
|
||||
|
Loading…
x
Reference in New Issue
Block a user