summaryrefslogtreecommitdiff
path: root/listener.c
diff options
context:
space:
mode:
authorAzat Khuzhin <a3at.mail@gmail.com>2017-12-05 22:59:20 +0300
committerAzat Khuzhin <a3at.mail@gmail.com>2017-12-10 23:55:51 +0300
commit94eae336a2f8933741b5984c61616abae9b5ed8c (patch)
treedd30ea98a13918b199be4ea17fc6dd696f3f123d /listener.c
parent6ee73ea9b0b15a9f4909c51e171b7799210ec26c (diff)
downloadlibevent-94eae336a2f8933741b5984c61616abae9b5ed8c.tar.gz
Revert "Fix potential fd leak in listener_read_cb()"
This reverts commit a695a720cda892c270736d127333d73553842094. @kgraefe: "I believe that this commit is just wrong: if lev->cnt is not 1 after the callback, new_fd will still never be closed in listener_read_cb(). So in that case it is the responsibility of the user's code to close the file descriptor (which is fine). But why shouldn't it be in the other case? And how does the user's code know?" And I agree
Diffstat (limited to 'listener.c')
-rw-r--r--listener.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/listener.c b/listener.c
index 2862d32e..942fa451 100644
--- a/listener.c
+++ b/listener.c
@@ -421,8 +421,6 @@ listener_read_cb(evutil_socket_t fd, short what, void *p)
if (lev->refcnt == 1) {
int freed = listener_decref_and_unlock(lev);
EVUTIL_ASSERT(freed);
-
- evutil_closesocket(new_fd);
return;
}
--lev->refcnt;