trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sor...@apache.org
Subject [09/11] trafficserver git commit: TS-3573: Fix connection leak
Date Tue, 05 May 2015 04:21:21 GMT
TS-3573: Fix connection leak

(cherry picked from commit e895bcc6aa64e595c31f682a5acf8e6537235c89)

Conflicts:
	CHANGES


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/1801eef0
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/1801eef0
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/1801eef0

Branch: refs/heads/5.3.x
Commit: 1801eef05033b72a7fc01678c64b334fe8cb96ce
Parents: f2d2391
Author: shinrich <shinrich@yahoo-inc.com>
Authored: Thu Apr 30 13:19:07 2015 -0500
Committer: Phil Sorber <sorber@apache.org>
Committed: Mon May 4 21:38:22 2015 -0600

----------------------------------------------------------------------
 CHANGES                          |  2 ++
 iocore/net/UnixNetVConnection.cc | 19 +++++++++++++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1801eef0/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 292a711..d5d994b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 5.3.0
 
+  *) [TS-3573] Fix connection leak.
+
   *) [TS-3558] Fix proxy.config.http.auth_server_session_private
 
   *) [TS-3533] Revert commits that break unregistered plugin loading.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1801eef0/iocore/net/UnixNetVConnection.cc
----------------------------------------------------------------------
diff --git a/iocore/net/UnixNetVConnection.cc b/iocore/net/UnixNetVConnection.cc
index ae4d028..2e44010 100644
--- a/iocore/net/UnixNetVConnection.cc
+++ b/iocore/net/UnixNetVConnection.cc
@@ -143,7 +143,7 @@ read_signal_and_update(int event, UnixNetVConnection *vc)
     case VC_EVENT_ERROR:
     case VC_EVENT_ACTIVE_TIMEOUT:
     case VC_EVENT_INACTIVITY_TIMEOUT:
-      Debug("inactivity_cop", "event %d: null cont, closing vc %p", event, vc);
+      Debug("inactivity_cop", "event %d: null read.vio cont, closing vc %p", event, vc);
       vc->closed = 1;
       break;
     default:
@@ -166,8 +166,23 @@ static inline int
 write_signal_and_update(int event, UnixNetVConnection *vc)
 {
   vc->recursion++;
-  if (NULL != vc->write.vio._cont)
+  if (vc->write.vio._cont) {
     vc->write.vio._cont->handleEvent(event, &vc->write.vio);
+  } else {
+    switch (event) {
+    case VC_EVENT_EOS:
+    case VC_EVENT_ERROR:
+    case VC_EVENT_ACTIVE_TIMEOUT:
+    case VC_EVENT_INACTIVITY_TIMEOUT:
+      Debug("inactivity_cop", "event %d: null write.vio cont, closing vc %p", event, vc);
+      vc->closed = 1;
+      break;
+    default:
+      Error("Unexpected event %d for vc %p", event, vc);
+      ink_release_assert(0);
+      break;
+    }
+  }
   if (!--vc->recursion && vc->closed) {
     /* BZ  31932 */
     ink_assert(vc->thread == this_ethread());


Mime
View raw message