This is an automated email from the ASF dual-hosted git repository.
amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new bc1e91d ink_inet: Add UNIX socket family suport.
bc1e91d is described below
commit bc1e91d3ca447dddc647b1ee3a6f4011effdfb0b
Author: Alan M. Carroll <[email protected]>
AuthorDate: Thu Jun 7 17:05:34 2018 -0500
ink_inet: Add UNIX socket family suport.
---
lib/ts/ink_inet.cc | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/lib/ts/ink_inet.cc b/lib/ts/ink_inet.cc
index 4b02280..ec4d7dc 100644
--- a/lib/ts/ink_inet.cc
+++ b/lib/ts/ink_inet.cc
@@ -51,6 +51,8 @@ const std::string_view IP_PROTO_TAG_HTTP_1_0("http/1.0"sv);
const std::string_view IP_PROTO_TAG_HTTP_1_1("http/1.1"sv);
const std::string_view IP_PROTO_TAG_HTTP_2_0("h2"sv); // HTTP/2 over TLS
+const std::string_view UNIX_PROTO_TAG{"unix"sv};
+
uint32_t
ink_inet_addr(const char *s)
{
@@ -147,7 +149,18 @@ ats_ip_ntop(const struct sockaddr *addr, char *dst, size_t
size)
std::string_view
ats_ip_family_name(int family)
{
- return AF_INET == family ? IP_PROTO_TAG_IPV4 : AF_INET6 == family ?
IP_PROTO_TAG_IPV6 : "Unspec"sv;
+ switch (family) {
+ case AF_INET:
+ return IP_PROTO_TAG_IPV4;
+ case AF_INET6:
+ return IP_PROTO_TAG_IPV6;
+ case AF_UNIX:
+ return UNIX_PROTO_TAG;
+ case AF_UNSPEC:
+ return "unspec"sv;
+ default:
+ return "unknown"sv;
+ }
}
const char *
--
To stop receiving notification emails like this one, please contact
[email protected].