This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/7.1.x by this push:
     new bf19960  Revert "FD leaks when ep.start() failed or cancelled in 
acceptEvent or con.connect() failed"
bf19960 is described below

commit bf1996041fbcb97d9a92aa6ddaf6573077df6e87
Author: Leif Hedstrom <zw...@apache.org>
AuthorDate: Wed Aug 30 10:32:03 2017 -0600

    Revert "FD leaks when ep.start() failed or cancelled in acceptEvent or 
con.connect() failed"
    
    This reverts commit 319e219f6b98f331e6cd0e6ee302da770a150213.
---
 iocore/net/SSLNetVConnection.cc  | 1 +
 iocore/net/UnixNetVConnection.cc | 8 +++-----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc
index 9b389a2..53d7012 100644
--- a/iocore/net/SSLNetVConnection.cc
+++ b/iocore/net/SSLNetVConnection.cc
@@ -892,6 +892,7 @@ SSLNetVConnection::free(EThread *t)
 
   closed = 0;
   options.reset();
+  con.close();
 
   ink_assert(con.fd == NO_FD);
 
diff --git a/iocore/net/UnixNetVConnection.cc b/iocore/net/UnixNetVConnection.cc
index 122cd42..c914f6c 100644
--- a/iocore/net/UnixNetVConnection.cc
+++ b/iocore/net/UnixNetVConnection.cc
@@ -94,6 +94,7 @@ close_UnixNetVConnection(UnixNetVConnection *vc, EThread *t)
   NetHandler *nh = vc->nh;
   vc->cancel_OOB();
   vc->ep.stop();
+  vc->con.close();
 
   ink_release_assert(vc->thread == t);
 
@@ -1151,14 +1152,14 @@ UnixNetVConnection::acceptEvent(int event, Event *e)
 
   SET_HANDLER((NetVConnHandler)&UnixNetVConnection::mainEvent);
 
+  nh                 = get_NetHandler(thread);
   PollDescriptor *pd = get_PollDescriptor(thread);
   if (ep.start(pd, this, EVENTIO_READ | EVENTIO_WRITE) < 0) {
     Debug("iocore_net", "acceptEvent : failed EventIO::start");
-    free(t);
+    close_UnixNetVConnection(this, e->ethread);
     return EVENT_DONE;
   }
 
-  nh = get_NetHandler(thread);
   set_inactivity_timeout(0);
   nh->open_list.enqueue(this);
 
@@ -1393,9 +1394,6 @@ void
 UnixNetVConnection::free(EThread *t)
 {
   ink_release_assert(t == this_ethread());
-
-  // close socket fd
-  con.close();
   // clear variables for reuse
   this->mutex.clear();
   action_.mutex.clear();

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Reply via email to