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 2012/02/18 19:04:11 UTC
git commit: Fix for compile problems related to casting 0 to a
reference.
Updated Branches:
refs/heads/master 95000615e -> c2cd672cf
Fix for compile problems related to casting 0 to a reference.
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/c2cd672c
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/c2cd672c
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/c2cd672c
Branch: refs/heads/master
Commit: c2cd672cf12592ea9213390f777d367b61e6b8d5
Parents: 9500061
Author: Alan M. Carroll <am...@network-geographics.com>
Authored: Mon Jan 23 07:06:17 2012 -0600
Committer: Alan M. Carroll <am...@network-geographics.com>
Committed: Mon Jan 23 07:06:17 2012 -0600
----------------------------------------------------------------------
lib/records/I_RecHttp.h | 7 ++++---
lib/ts/ink_inet.cc | 1 +
lib/ts/ink_inet.h | 3 +++
3 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c2cd672c/lib/records/I_RecHttp.h
----------------------------------------------------------------------
diff --git a/lib/records/I_RecHttp.h b/lib/records/I_RecHttp.h
index ec72e8e..18ea20b 100644
--- a/lib/records/I_RecHttp.h
+++ b/lib/records/I_RecHttp.h
@@ -258,14 +258,15 @@ public:
static Vec<self>& m_global; ///< Global ("default") data.
};
-
inline bool HttpProxyPort::isSSL() const { return TRANSPORT_SSL == m_type; }
+
inline InkInetAddr&
HttpProxyPort::outboundIp(uint16_t family) {
+ static InkInetAddr invalid; // dummy to make compiler happy about return.
if (AF_INET == family) return m_outbound_ip4;
else if (AF_INET6 == family) return m_outbound_ip6;
- else ink_release_assert(!"Invalid family for outbound address on proxy port.");
- return *static_cast<InkInetAddr*>(0); // bogus, makes compiler happy.
+ ink_release_assert(!"Invalid family for outbound address on proxy port.");
+ return invalid; // never happens but compiler insists.
}
inline bool
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c2cd672c/lib/ts/ink_inet.cc
----------------------------------------------------------------------
diff --git a/lib/ts/ink_inet.cc b/lib/ts/ink_inet.cc
index 917c03d..a42eb22 100644
--- a/lib/ts/ink_inet.cc
+++ b/lib/ts/ink_inet.cc
@@ -32,6 +32,7 @@ extern "C"
}
#endif
+InkInetAddr const InkInetAddr::INVALID;
struct hostent *
ink_gethostbyname_r(char *hostname, ink_gethostbyname_r_data * data)
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c2cd672c/lib/ts/ink_inet.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_inet.h b/lib/ts/ink_inet.h
index f753713..759594b 100644
--- a/lib/ts/ink_inet.h
+++ b/lib/ts/ink_inet.h
@@ -1069,6 +1069,9 @@ struct InkInetAddr {
in6_addr _ip6; ///< IPv6 address storage.
uint8_t _byte[INK_IP6_SIZE]; ///< As raw bytes.
} _addr;
+
+ ///< Pre-constructed invalid instance.
+ static self const INVALID;
};
inline InkInetAddr&