diff options
author | Azat Khuzhin <a3at.mail@gmail.com> | 2017-12-05 22:59:20 +0300 |
---|---|---|
committer | Azat Khuzhin <a3at.mail@gmail.com> | 2017-12-10 23:55:51 +0300 |
commit | 94eae336a2f8933741b5984c61616abae9b5ed8c (patch) | |
tree | dd30ea98a13918b199be4ea17fc6dd696f3f123d /listener.c | |
parent | 6ee73ea9b0b15a9f4909c51e171b7799210ec26c (diff) | |
download | libevent-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.c | 2 |
1 files changed, 0 insertions, 2 deletions
@@ -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; |