You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2015/07/16 00:33:45 UTC

trafficserver git commit: TS-3769: Fix coverity complaint about NULL reference.

Repository: trafficserver
Updated Branches:
  refs/heads/master 5a5311bca -> 1d81a2d79


TS-3769: Fix coverity complaint about NULL reference.


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

Branch: refs/heads/master
Commit: 1d81a2d79a4b21c3d7850e3acde40fd612bc6f38
Parents: 5a5311b
Author: Alan M. Carroll <so...@yahoo-inc.com>
Authored: Wed Jul 15 13:53:42 2015 -0500
Committer: Alan M. Carroll <so...@yahoo-inc.com>
Committed: Wed Jul 15 13:53:42 2015 -0500

----------------------------------------------------------------------
 proxy/http/HttpTransact.cc | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1d81a2d7/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index d164c1a..fcd0666 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -1592,9 +1592,10 @@ HttpTransact::ReDNSRoundRobin(State *s)
 
     // Our ReDNS of the server succeeded so update the necessary
     //  information and try again. Need to preserve the current port value if possible.
-    in_port_t server_port = s->current.server ? s->current.server->dst_addr.host_order_port() : s->server_info.dst_addr.isValid() ?
-                                                s->server_info.dst_addr.host_order_port() :
-                                                s->hdr_info.client_request.port_get();
+    in_port_t server_port = s->current.server->dst_addr.host_order_port();
+    // Temporary check to make sure the port preservation can be depended upon. That should be the case
+    // because we get here only after trying a connection. Remove for 6.2.
+    ink_assert(s->current.server->dst_addr.isValid() && 0 != server_port);
 
     ats_ip_copy(&s->server_info.dst_addr, s->host_db_info.ip());
     s->server_info.dst_addr.port() = htons(server_port);