trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpe...@apache.org
Subject trafficserver git commit: Fix clang static analyzer warning.
Date Thu, 08 Oct 2015 04:19:49 GMT
Repository: trafficserver
Updated Branches:
  refs/heads/master 13169491f -> 91b552a88


Fix clang static analyzer warning.


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

Branch: refs/heads/master
Commit: 91b552a888fc60489f1a2a99d98f101a1a688f01
Parents: 1316949
Author: James Peach <jpeach@apache.org>
Authored: Wed Oct 7 21:05:00 2015 -0700
Committer: James Peach <jpeach@apache.org>
Committed: Wed Oct 7 21:19:10 2015 -0700

----------------------------------------------------------------------
 proxy/http/HttpSessionManager.cc | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/91b552a8/proxy/http/HttpSessionManager.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpSessionManager.cc b/proxy/http/HttpSessionManager.cc
index d0b66cc..ae19ca1 100644
--- a/proxy/http/HttpSessionManager.cc
+++ b/proxy/http/HttpSessionManager.cc
@@ -202,17 +202,16 @@ ServerSessionPool::eventHandler(int event, void *data)
 
   HttpConfig::release(http_config_params);
   if (!found) {
-    // We failed to find our session.  This can only be the result
-    //  of a programming flaw
+    // We failed to find our session.  This can only be the result of a programming flaw.
Since we only ever keep
+    // UnixNetVConnections and SSLNetVConnections in the session pool, the dynamic cast won't
fail.
     UnixNetVConnection *unix_net_vc = dynamic_cast<UnixNetVConnection *>(net_vc);
-    char peer_ip[INET6_ADDRPORTSTRLEN];
     if (unix_net_vc) {
+      char peer_ip[INET6_ADDRPORTSTRLEN];
       ats_ip_nptop(unix_net_vc->get_remote_addr(), peer_ip, sizeof(peer_ip));
-    } else {
-      peer_ip[0] = '\0';
+
+      Warning("Connection leak from http keep-alive system fd=%d closed=%d peer_ip_port=%s",
unix_net_vc->con.fd,
+              unix_net_vc->closed, peer_ip);
     }
-    Warning("Connection leak from http keep-alive system fd=%d closed=%d peer_ip_port=%s",
unix_net_vc->con.fd, unix_net_vc->closed,
-            peer_ip);
     ink_assert(0);
   }
   return 0;


Mime
View raw message