You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2012/03/17 05:32:20 UTC
git commit: TS-1145: additional clang build fixes
Updated Branches:
refs/heads/master b4423861e -> d13336e8e
TS-1145: additional clang build fixes
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/d13336e8
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/d13336e8
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/d13336e8
Branch: refs/heads/master
Commit: d13336e8e68defe7d672060e1ee905f851347c8c
Parents: b442386
Author: Darrin Jewell <db...@mit.edu>
Authored: Fri Mar 16 21:24:52 2012 -0700
Committer: James Peach <jp...@apache.org>
Committed: Fri Mar 16 21:25:28 2012 -0700
----------------------------------------------------------------------
CHANGES | 2 +
doc/man/traffic_shell.1 | 16 +++---
lib/ts/IpMap.cc | 99 +++++++++++++++++++++---------------------
lib/ts/ink_inet.h | 16 ++++++-
lib/ts/test_Map.cc | 2 +-
proxy/UglyLogStubs.cc | 75 +++++++++++++++++++++++++++++++-
6 files changed, 149 insertions(+), 61 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d13336e8/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index f0ffc6f..9fe84e1 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
-*- coding: utf-8 -*-
Changes with Apache Traffic Server 3.1.3
+ *) [TS-1145] Additional clang build fixes. Author: Darrin Jewell.
+
*) [TS-1144] Fix out of tree builds. Author: Darrin Jewell.
*) [TS-1138] Fixed off by one range error in IpMap.s
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d13336e8/doc/man/traffic_shell.1
----------------------------------------------------------------------
diff --git a/doc/man/traffic_shell.1 b/doc/man/traffic_shell.1
index ed83240..abbd68c 100644
--- a/doc/man/traffic_shell.1
+++ b/doc/man/traffic_shell.1
@@ -15,16 +15,16 @@
.\" limitations under the License. .\"
.Dd January 22, 2012
.Dt TRAFFIC.ShELL 1
-
+.sp
.Sh NAME
.Nm traffic_shell
.Nd Traffic Server configuration shell
-
+.sp
.Sh SYNOPSIS
.Nm
.Op Fl V
.Op Ar filename
-
+.sp
.Sh DESCRIPTION
.Nm
is a command-line interface to monitor and configure Apache Traffic Server.
@@ -55,7 +55,7 @@ argument,
.Nm
will read and execute commands from the given file prior to entering interactive
mode.
-
+.sp
.Sh USING TRAFFIC SHELL COMMANDS
Once you start
.Nm
@@ -101,7 +101,7 @@ at the
.Li trafficserver>
prompt to exit
.Nm .
-
+.sp
.Sh TRAFFIC SHELL COMMAND SHORTCUTS
.Nm
supports the following shortcuts for entering commands.
@@ -123,7 +123,7 @@ Command history. From the
prompt, press the Up and Down arrow keys to scroll
through commands that you previously entered.
.El
-
+.sp
.Sh ACCESSING ON-LINE HELP
.Nm
includes manual pages that describe each command. To access
@@ -138,7 +138,7 @@ command at the prompt.
.It Fl V
Print version information and exit.
.El
-
+.sp
.Sh EXAMPLES
Displaying the on-line help for a command:
.Bd -ragged -offset 12345678
@@ -159,7 +159,7 @@ Use a Tcl command to show multiple configuration parameters:
.Bd -ragged -offset 12345678
trafficserver> foreach i {http proxy socks ssl} {show:$i}
.Ed
-
+.sp
.Sh SEE ALSO
.Xr traffic_line 1 ,
.Xr Tcl n .
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d13336e8/lib/ts/IpMap.cc
----------------------------------------------------------------------
diff --git a/lib/ts/IpMap.cc b/lib/ts/IpMap.cc
index 7c2b157..5960c93 100644
--- a/lib/ts/IpMap.cc
+++ b/lib/ts/IpMap.cc
@@ -39,6 +39,56 @@
namespace ts { namespace detail {
+inline int cmp(sockaddr_in6 const& lhs, sockaddr_in6 const& rhs) {
+ return memcmp(lhs.sin6_addr.s6_addr, rhs.sin6_addr.s6_addr, INK_IP6_SIZE);
+}
+
+// Helper functions
+
+/// Less than.
+inline bool operator<(sockaddr_in6 const& lhs, sockaddr_in6 const& rhs) {
+ return -1 == ts::detail::cmp(lhs, rhs);
+}
+inline bool operator<(sockaddr_in6 const* lhs, sockaddr_in6 const& rhs) {
+ return -1 == ts::detail::cmp(*lhs, rhs);
+}
+/// Less than.
+inline bool operator<(sockaddr_in6 const& lhs, sockaddr_in6 const* rhs) {
+ return -1 == ts::detail::cmp(lhs, *rhs);
+}
+/// Equality.
+inline bool operator==(sockaddr_in6 const& lhs, sockaddr_in6 const* rhs) {
+ return 0 == ts::detail::cmp(lhs, *rhs);
+}
+/// Equality.
+inline bool operator==(sockaddr_in6 const* lhs, sockaddr_in6 const& rhs) {
+ return 0 == ts::detail::cmp(*lhs, rhs);
+}
+/// Equality.
+inline bool operator==(sockaddr_in6 const& lhs, sockaddr_in6 const& rhs) {
+ return 0 == ts::detail::cmp(lhs, rhs);
+}
+/// Less than or equal.
+inline bool operator<=(sockaddr_in6 const& lhs, sockaddr_in6 const* rhs) {
+ return 1 != ts::detail::cmp(lhs, *rhs);
+}
+/// Less than or equal.
+inline bool operator<=(sockaddr_in6 const& lhs, sockaddr_in6 const& rhs) {
+ return 1 != ts::detail::cmp(lhs, rhs);
+}
+/// Greater than or equal.
+inline bool operator>=(sockaddr_in6 const& lhs, sockaddr_in6 const& rhs) {
+ return -1 != ts::detail::cmp(lhs, rhs);
+}
+/// Greater than or equal.
+inline bool operator>=(sockaddr_in6 const& lhs, sockaddr_in6 const* rhs) {
+ return -1 != ts::detail::cmp(lhs, *rhs);
+}
+/// Greater than.
+inline bool operator>(sockaddr_in6 const& lhs, sockaddr_in6 const* rhs) {
+ return 1 == ts::detail::cmp(lhs, *rhs);
+}
+
/// Equality.
/// @note If @a n is @c NULL it is treated as having the color @c BLACK.
/// @return @c true if @a c and the color of @a n are the same.
@@ -508,55 +558,6 @@ template <
// Helper functions
-inline int cmp(sockaddr_in6 const& lhs, sockaddr_in6 const& rhs) {
- return memcmp(lhs.sin6_addr.s6_addr, rhs.sin6_addr.s6_addr, INK_IP6_SIZE);
-}
-
-/// Less than.
-inline bool operator<(sockaddr_in6 const& lhs, sockaddr_in6 const& rhs) {
- return -1 == ts::detail::cmp(lhs, rhs);
-}
-inline bool operator<(sockaddr_in6 const* lhs, sockaddr_in6 const& rhs) {
- return -1 == ts::detail::cmp(*lhs, rhs);
-}
-/// Less than.
-inline bool operator<(sockaddr_in6 const& lhs, sockaddr_in6 const* rhs) {
- return -1 == ts::detail::cmp(lhs, *rhs);
-}
-/// Equality.
-inline bool operator==(sockaddr_in6 const& lhs, sockaddr_in6 const* rhs) {
- return 0 == ts::detail::cmp(lhs, *rhs);
-}
-/// Equality.
-inline bool operator==(sockaddr_in6 const* lhs, sockaddr_in6 const& rhs) {
- return 0 == ts::detail::cmp(*lhs, rhs);
-}
-/// Equality.
-inline bool operator==(sockaddr_in6 const& lhs, sockaddr_in6 const& rhs) {
- return 0 == ts::detail::cmp(lhs, rhs);
-}
-/// Less than or equal.
-inline bool operator<=(sockaddr_in6 const& lhs, sockaddr_in6 const* rhs) {
- return 1 != ts::detail::cmp(lhs, *rhs);
-}
-/// Less than or equal.
-inline bool operator<=(sockaddr_in6 const& lhs, sockaddr_in6 const& rhs) {
- return 1 != ts::detail::cmp(lhs, rhs);
-}
-/// Greater than or equal.
-inline bool operator>=(sockaddr_in6 const& lhs, sockaddr_in6 const& rhs) {
- return -1 != ts::detail::cmp(lhs, rhs);
-}
-/// Greater than or equal.
-inline bool operator>=(sockaddr_in6 const& lhs, sockaddr_in6 const* rhs) {
- return -1 != ts::detail::cmp(lhs, *rhs);
-}
-/// Greater than.
-inline bool operator>(sockaddr_in6 const& lhs, sockaddr_in6 const* rhs) {
- return 1 == ts::detail::cmp(lhs, *rhs);
-}
-
-
template < typename N > N*
IpMapBase<N>::lowerBound(ArgType target) {
N* n = _root; // current node to test.
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d13336e8/lib/ts/ink_inet.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_inet.h b/lib/ts/ink_inet.h
index 9c5ab5f..afb268b 100644
--- a/lib/ts/ink_inet.h
+++ b/lib/ts/ink_inet.h
@@ -1150,24 +1150,36 @@ inline bool IpEndpoint::isIp6() const { return AF_INET6 == sa.sa_family; }
inline IpEndpoint&
IpEndpoint::setToAnyAddr(int family) {
+ ink_zero(sa);
sa.sa_family = family;
if (AF_INET == family) {
sin.sin_addr.s_addr = INADDR_ANY;
- ink_zero(sin.sin_zero);
+#if HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
+ sin.sin_len = sizeof(sockaddr_in);
+#endif
} else if (AF_INET6 == family) {
sin6.sin6_addr = in6addr_any;
+#if HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN
+ sin6.sin6_len = sizeof(sockaddr_in6);
+#endif
}
return *this;
}
inline IpEndpoint&
IpEndpoint::setToLoopback(int family) {
+ ink_zero(sa);
sa.sa_family = family;
if (AF_INET == family) {
sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
- ink_zero(sin.sin_zero);
+#if HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
+ sin.sin_len = sizeof(sockaddr_in);
+#endif
} else if (AF_INET6 == family) {
sin6.sin6_addr = in6addr_loopback;
+#if HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN
+ sin6.sin6_len = sizeof(sockaddr_in6);
+#endif
}
return *this;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d13336e8/lib/ts/test_Map.cc
----------------------------------------------------------------------
diff --git a/lib/ts/test_Map.cc b/lib/ts/test_Map.cc
index 27d48c2..4248a73 100644
--- a/lib/ts/test_Map.cc
+++ b/lib/ts/test_Map.cc
@@ -34,7 +34,7 @@ int main(int argc, char **argv) {
ssm.put("b", "B");
ssm.put("c", "C");
ssm.put("d", "D");
- form_SSMap(x, ssm) ;
+ form_SSMap(x, ssm) { /* nop */ }
StringChainHash<> h;
cchar *hi = "hi", *ho = "ho", *hum = "hum", *hhi = "hhi";
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d13336e8/proxy/UglyLogStubs.cc
----------------------------------------------------------------------
diff --git a/proxy/UglyLogStubs.cc b/proxy/UglyLogStubs.cc
index 3e46647..223d453 100644
--- a/proxy/UglyLogStubs.cc
+++ b/proxy/UglyLogStubs.cc
@@ -34,11 +34,23 @@
#include <unistd.h>
#endif
-
#include "P_Net.h"
int fds_limit = 8000;
+class FakeUDPNetProcessor : public UDPNetProcessor {
+ virtual int start(int num) {
+ NOWARN_UNUSED(num);
+ ink_release_assert(false);
+ return 0;
+ };
+ virtual void UDPNetProcessor_is_abstract() {
+ ink_release_assert(false);
+ };
+} fakeUDPNet;
+
+UDPNetProcessor& udpNet = fakeUDPNet;
+
ClassAllocator<UDPPacketInternal> udpPacketAllocator("udpPacketAllocator");
void
@@ -103,6 +115,12 @@ LogCollationClientSM::send(LogBuffer * log_buffer)
return 0;
}
+NetAccept *
+UnixNetProcessor::createNetAccept()
+{
+ ink_release_assert(false);
+ return NULL;
+}
// TODO: The following was necessary only for Solaris, should examine more.
NetVCOptions const Connection::DEFAULT_OPTIONS;
@@ -135,6 +153,61 @@ CacheVC::handleWrite(int event, Event *e)
ink_release_assert(false);
}
+UnixNetProcessor unix_netProcessor;
+NetProcessor& netProcessor = unix_netProcessor;
+
+int
+UnixNetProcessor::start(int num)
+{
+ NOWARN_UNUSED(num);
+ ink_release_assert(false);
+ return 0;
+}
+
+Action *
+NetProcessor::accept(Continuation* cont, AcceptOptions const& opt)
+{
+ NOWARN_UNUSED(cont);
+ NOWARN_UNUSED(opt);
+ ink_release_assert(false);
+ return NULL;
+}
+
+Action *
+NetProcessor::main_accept(Continuation *cont, SOCKET fd, AcceptOptions const& opt)
+{
+ NOWARN_UNUSED(cont);
+ NOWARN_UNUSED(fd);
+ NOWARN_UNUSED(opt);
+ ink_release_assert(false);
+ return NULL;
+}
+
+Action *
+UnixNetProcessor::accept_internal(Continuation *cont, int fd, AcceptOptions const& opt)
+{
+ NOWARN_UNUSED(cont);
+ NOWARN_UNUSED(fd);
+ NOWARN_UNUSED(opt);
+ ink_release_assert(false);
+ return NULL;
+}
+
+UnixNetVConnection *
+UnixNetProcessor::allocateThread(EThread * t)
+{
+ NOWARN_UNUSED(t);
+ ink_release_assert(false);
+ return NULL;
+}
+
+void
+UnixNetProcessor::freeThread(UnixNetVConnection * vc, EThread * t)
+{
+ NOWARN_UNUSED(t);
+ NOWARN_UNUSED(vc);
+ ink_release_assert(false);
+}
// For Intel ICC
int cache_config_mutex_retry_delay = 2;