From 803931d2303778eeda1126d0890a27a4c0274440 Mon Sep 17 00:00:00 2001 From: ahedberg Date: Fri, 11 Mar 2016 17:24:12 -0500 Subject: Make use of unix sockets optional. --- src/core/iomgr/resolve_address_posix.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/core/iomgr/resolve_address_posix.c') diff --git a/src/core/iomgr/resolve_address_posix.c b/src/core/iomgr/resolve_address_posix.c index a6c9893f23..16bdb20c82 100644 --- a/src/core/iomgr/resolve_address_posix.c +++ b/src/core/iomgr/resolve_address_posix.c @@ -39,7 +39,10 @@ #include #include +#ifdef GPR_HAVE_UNIX_SOCKET #include +#endif +#include #include #include @@ -71,6 +74,7 @@ static grpc_resolved_addresses *blocking_resolve_address_impl( int s; size_t i; grpc_resolved_addresses *addrs = NULL; +#ifdef GPR_HAVE_UNIX_SOCKET struct sockaddr_un *un; if (name[0] == 'u' && name[1] == 'n' && name[2] == 'i' && name[3] == 'x' && @@ -84,6 +88,7 @@ static grpc_resolved_addresses *blocking_resolve_address_impl( addrs->addrs->len = strlen(un->sun_path) + sizeof(un->sun_family) + 1; return addrs; } +#endif /* parse name, splitting it into host and port parts */ gpr_split_host_port(name, &host, &port); -- cgit v1.2.3 From 24ebdfb3a5441d901f124df474131c6750ddd117 Mon Sep 17 00:00:00 2001 From: ahedberg Date: Tue, 15 Mar 2016 12:58:07 -0400 Subject: Remove duplicate include of string.h --- src/core/iomgr/resolve_address_posix.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/core/iomgr/resolve_address_posix.c') diff --git a/src/core/iomgr/resolve_address_posix.c b/src/core/iomgr/resolve_address_posix.c index 16bdb20c82..0360ab717c 100644 --- a/src/core/iomgr/resolve_address_posix.c +++ b/src/core/iomgr/resolve_address_posix.c @@ -42,7 +42,6 @@ #ifdef GPR_HAVE_UNIX_SOCKET #include #endif -#include #include #include -- cgit v1.2.3 From 80d6b12a86a636edc8811b880296fbe45bb214a6 Mon Sep 17 00:00:00 2001 From: ahedberg Date: Thu, 17 Mar 2016 17:37:35 -0400 Subject: move unix socket functionality to unix_sockets_posix module --- .../client_config/resolvers/sockaddr_resolver.c | 22 +---- src/core/iomgr/endpoint_pair_posix.c | 5 +- src/core/iomgr/resolve_address_posix.c | 16 +--- src/core/iomgr/sockaddr_utils.c | 21 ++--- src/core/iomgr/tcp_client_posix.c | 14 +-- src/core/iomgr/tcp_server_posix.c | 45 ++------- src/core/iomgr/udp_server.c | 29 +----- src/core/iomgr/unix_sockets_posix.c | 102 +++++++++++++++++++++ src/core/iomgr/unix_sockets_posix.h | 67 ++++++++++++++ src/core/iomgr/unix_sockets_posix_noop.c | 59 ++++++++++++ 10 files changed, 250 insertions(+), 130 deletions(-) create mode 100644 src/core/iomgr/unix_sockets_posix.c create mode 100644 src/core/iomgr/unix_sockets_posix.h create mode 100644 src/core/iomgr/unix_sockets_posix_noop.c (limited to 'src/core/iomgr/resolve_address_posix.c') diff --git a/src/core/client_config/resolvers/sockaddr_resolver.c b/src/core/client_config/resolvers/sockaddr_resolver.c index 418413315f..d2a081a131 100644 --- a/src/core/client_config/resolvers/sockaddr_resolver.c +++ b/src/core/client_config/resolvers/sockaddr_resolver.c @@ -37,9 +37,6 @@ #include #include -#ifdef GPR_HAVE_UNIX_SOCKET -#include -#endif #include #include @@ -47,6 +44,7 @@ #include "src/core/client_config/lb_policy_registry.h" #include "src/core/iomgr/resolve_address.h" +#include "src/core/iomgr/unix_sockets_posix.h" #include "src/core/support/string.h" typedef struct { @@ -168,24 +166,6 @@ static void sockaddr_destroy(grpc_exec_ctx *exec_ctx, grpc_resolver *gr) { gpr_free(r); } -#ifdef GPR_HAVE_UNIX_SOCKET -static int parse_unix(grpc_uri *uri, struct sockaddr_storage *addr, - size_t *len) { - struct sockaddr_un *un = (struct sockaddr_un *)addr; - - un->sun_family = AF_UNIX; - strcpy(un->sun_path, uri->path); - *len = strlen(un->sun_path) + sizeof(un->sun_family) + 1; - - return 1; -} - -static char *unix_get_default_authority(grpc_resolver_factory *factory, - grpc_uri *uri) { - return gpr_strdup("localhost"); -} -#endif - static char *ip_get_default_authority(grpc_uri *uri) { const char *path = uri->path; if (path[0] == '/') ++path; diff --git a/src/core/iomgr/endpoint_pair_posix.c b/src/core/iomgr/endpoint_pair_posix.c index d3a45f83e0..f6da8f1d1b 100644 --- a/src/core/iomgr/endpoint_pair_posix.c +++ b/src/core/iomgr/endpoint_pair_posix.c @@ -37,6 +37,7 @@ #include "src/core/iomgr/endpoint_pair.h" #include "src/core/iomgr/socket_utils_posix.h" +#include "src/core/iomgr/unix_sockets_posix.h" #include #include @@ -52,9 +53,7 @@ static void create_sockets(int sv[2]) { int flags; -#ifdef GPR_HAVE_UNIX_SOCKET - GPR_ASSERT(socketpair(AF_UNIX, SOCK_STREAM, 0, sv) == 0); -#endif + grpc_create_socketpair_if_unix(sv); flags = fcntl(sv[0], F_GETFL, 0); GPR_ASSERT(fcntl(sv[0], F_SETFL, flags | O_NONBLOCK) == 0); flags = fcntl(sv[1], F_GETFL, 0); diff --git a/src/core/iomgr/resolve_address_posix.c b/src/core/iomgr/resolve_address_posix.c index 0360ab717c..ef193c02ec 100644 --- a/src/core/iomgr/resolve_address_posix.c +++ b/src/core/iomgr/resolve_address_posix.c @@ -39,9 +39,6 @@ #include #include -#ifdef GPR_HAVE_UNIX_SOCKET -#include -#endif #include #include @@ -53,6 +50,7 @@ #include "src/core/iomgr/executor.h" #include "src/core/iomgr/iomgr_internal.h" #include "src/core/iomgr/sockaddr_utils.h" +#include "src/core/iomgr/unix_posix_sockets.h" #include "src/core/support/block_annotate.h" #include "src/core/support/string.h" @@ -73,21 +71,11 @@ static grpc_resolved_addresses *blocking_resolve_address_impl( int s; size_t i; grpc_resolved_addresses *addrs = NULL; -#ifdef GPR_HAVE_UNIX_SOCKET - struct sockaddr_un *un; if (name[0] == 'u' && name[1] == 'n' && name[2] == 'i' && name[3] == 'x' && name[4] == ':' && name[5] != 0) { - addrs = gpr_malloc(sizeof(grpc_resolved_addresses)); - addrs->naddrs = 1; - addrs->addrs = gpr_malloc(sizeof(grpc_resolved_address)); - un = (struct sockaddr_un *)addrs->addrs->addr; - un->sun_family = AF_UNIX; - strcpy(un->sun_path, name + 5); - addrs->addrs->len = strlen(un->sun_path) + sizeof(un->sun_family) + 1; - return addrs; + return grpc_resolve_unix_domain_address(name + 5); } -#endif /* parse name, splitting it into host and port parts */ gpr_split_host_port(name, &host, &port); diff --git a/src/core/iomgr/sockaddr_utils.c b/src/core/iomgr/sockaddr_utils.c index 3d464a228f..667ab01432 100644 --- a/src/core/iomgr/sockaddr_utils.c +++ b/src/core/iomgr/sockaddr_utils.c @@ -36,16 +36,13 @@ #include #include -#ifdef GPR_HAVE_UNIX_SOCKET -#include -#endif - #include #include #include #include #include +#include "src/core/iomgr/unix_sockets_posix.h" #include "src/core/support/string.h" static const uint8_t kV4MappedPrefix[] = {0, 0, 0, 0, 0, 0, @@ -191,14 +188,9 @@ char *grpc_sockaddr_to_uri(const struct sockaddr *addr) { gpr_asprintf(&result, "ipv6:%s", temp); gpr_free(temp); return result; -#ifdef GPR_HAVE_UNIX_SOCKET - case AF_UNIX: - gpr_asprintf(&result, "unix:%s", ((struct sockaddr_un *)addr)->sun_path); - return result; -#endif + default: + return grpc_sockaddr_to_uri_unix_if_possible(addr); } - - return NULL; } int grpc_sockaddr_get_port(const struct sockaddr *addr) { @@ -207,11 +199,10 @@ int grpc_sockaddr_get_port(const struct sockaddr *addr) { return ntohs(((struct sockaddr_in *)addr)->sin_port); case AF_INET6: return ntohs(((struct sockaddr_in6 *)addr)->sin6_port); -#ifdef GPR_HAVE_UNIX_SOCKET - case AF_UNIX: - return 1; -#endif default: + if (grpc_is_unix_socket(addr->sa_family)) { + return 1; + } gpr_log(GPR_ERROR, "Unknown socket family %d in grpc_sockaddr_get_port", addr->sa_family); return 0; diff --git a/src/core/iomgr/tcp_client_posix.c b/src/core/iomgr/tcp_client_posix.c index b04e1dbb68..2ed6fb107b 100644 --- a/src/core/iomgr/tcp_client_posix.c +++ b/src/core/iomgr/tcp_client_posix.c @@ -76,24 +76,14 @@ static int prepare_socket(const struct sockaddr *addr, int fd) { goto error; } -#ifdef GPR_HAVE_UNIX_SOCKET if (!grpc_set_socket_nonblocking(fd, 1) || !grpc_set_socket_cloexec(fd, 1) || - (addr->sa_family != AF_UNIX && !grpc_set_socket_low_latency(fd, 1)) || + (!grpc_is_unix_socket(addr->sa_family) && + !grpc_set_socket_low_latency(fd, 1)) || !grpc_set_socket_no_sigpipe_if_possible(fd)) { gpr_log(GPR_ERROR, "Unable to configure socket %d: %s", fd, strerror(errno)); goto error; } -#else - if (!grpc_set_socket_nonblocking(fd, 1) || !grpc_set_socket_cloexec(fd, 1) || - !grpc_set_socket_low_latency(fd, 1) || - !grpc_set_socket_no_sigpipe_if_possible(fd)) { - gpr_log(GPR_ERROR, "Unable to configure socket %d: %s", fd, - strerror(errno)); - goto error; - } -#endif - return 1; error: diff --git a/src/core/iomgr/tcp_server_posix.c b/src/core/iomgr/tcp_server_posix.c index f47a00c118..0bef9f6254 100644 --- a/src/core/iomgr/tcp_server_posix.c +++ b/src/core/iomgr/tcp_server_posix.c @@ -52,9 +52,6 @@ #include #include #include -#ifdef GPR_HAVE_UNIX_SOCKET -#include -#endif #include #include "src/core/iomgr/pollset_posix.h" @@ -62,6 +59,7 @@ #include "src/core/iomgr/sockaddr_utils.h" #include "src/core/iomgr/socket_utils_posix.h" #include "src/core/iomgr/tcp_posix.h" +#include "src/core/iomgr/unix_sockets_posix.h" #include "src/core/support/string.h" #include #include @@ -83,9 +81,6 @@ struct grpc_tcp_listener { union { uint8_t untyped[GRPC_MAX_SOCKADDR_SIZE]; struct sockaddr sockaddr; -#ifdef GPR_HAVE_UNIX_SOCKET - struct sockaddr_un un; -#endif } addr; size_t addr_len; int port; @@ -102,16 +97,6 @@ struct grpc_tcp_listener { int is_sibling; }; -#ifdef GPR_HAVE_UNIX_SOCKET -static void unlink_if_unix_domain_socket(const struct sockaddr_un *un) { - struct stat st; - - if (stat(un->sun_path, &st) == 0 && (st.st_mode & S_IFMT) == S_IFSOCK) { - unlink(un->sun_path); - } -} -#endif - /* the overall server */ struct grpc_tcp_server { gpr_refcount refs; @@ -209,11 +194,7 @@ static void deactivated_all_ports(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) { if (s->head) { grpc_tcp_listener *sp; for (sp = s->head; sp; sp = sp->next) { -#ifdef GPR_HAVE_UNIX_SOCKET - if (sp->addr.sockaddr.sa_family == AF_UNIX) { - unlink_if_unix_domain_socket(&sp->addr.un); - } -#endif + unlink_if_unix_domain_socket(&sp->addr.sockaddr); sp->destroyed_closure.cb = destroyed_port; sp->destroyed_closure.cb_arg = s; grpc_fd_orphan(exec_ctx, sp->emfd, &sp->destroyed_closure, NULL, @@ -288,25 +269,15 @@ static int prepare_socket(int fd, const struct sockaddr *addr, goto error; } -#ifdef GPR_HAVE_UNIX_SOCKET if (!grpc_set_socket_nonblocking(fd, 1) || !grpc_set_socket_cloexec(fd, 1) || - (addr->sa_family != AF_UNIX && (!grpc_set_socket_low_latency(fd, 1) || - !grpc_set_socket_reuse_addr(fd, 1))) || + (!grpc_is_unix_socket(addr) && + (!grpc_set_socket_low_latency(fd, 1) || + !grpc_set_socket_reuse_addr(fd, 1))) || !grpc_set_socket_no_sigpipe_if_possible(fd)) { gpr_log(GPR_ERROR, "Unable to configure socket %d: %s", fd, strerror(errno)); goto error; } -#else - if (!grpc_set_socket_nonblocking(fd, 1) || !grpc_set_socket_cloexec(fd, 1) || - !grpc_set_socket_low_latency(fd, 1) || - !grpc_set_socket_reuse_addr(fd, 1) || - !grpc_set_socket_no_sigpipe_if_possible(fd)) { - gpr_log(GPR_ERROR, "Unable to configure socket %d: %s", fd, - strerror(errno)); - goto error; - } -#endif GPR_ASSERT(addr_len < ~(socklen_t)0); if (bind(fd, addr, (socklen_t)addr_len) < 0) { @@ -470,11 +441,7 @@ int grpc_tcp_server_add_port(grpc_tcp_server *s, const void *addr, if (s->tail != NULL) { port_index = s->tail->port_index + 1; } -#ifdef GPR_HAVE_UNIX_SOCKET - if (((struct sockaddr *)addr)->sa_family == AF_UNIX) { - unlink_if_unix_domain_socket(addr); - } -#endif + unlink_if_unix_domain_socket((struct sockaddr *)addr); /* Check if this is a wildcard port, and if so, try to keep the port the same as some previously created listener. */ diff --git a/src/core/iomgr/udp_server.c b/src/core/iomgr/udp_server.c index df2f449a9a..c1a438398d 100644 --- a/src/core/iomgr/udp_server.c +++ b/src/core/iomgr/udp_server.c @@ -52,9 +52,6 @@ #include #include #include -#ifdef GPR_HAVE_UNIX_SOCKET -#include -#endif #include #include "src/core/iomgr/fd_posix.h" @@ -62,6 +59,7 @@ #include "src/core/iomgr/resolve_address.h" #include "src/core/iomgr/sockaddr_utils.h" #include "src/core/iomgr/socket_utils_posix.h" +#include "src/core/iomgr/unix_sockets_posix.h" #include "src/core/support/string.h" #include #include @@ -79,9 +77,6 @@ typedef struct { union { uint8_t untyped[GRPC_MAX_SOCKADDR_SIZE]; struct sockaddr sockaddr; -#ifdef GPR_HAVE_UNIX_SOCKET - struct sockaddr_un un; -#endif } addr; size_t addr_len; grpc_closure read_closure; @@ -89,16 +84,6 @@ typedef struct { grpc_udp_server_read_cb read_cb; } server_port; -#ifdef GPR_HAVE_UNIX_SOCKET -static void unlink_if_unix_domain_socket(const struct sockaddr_un *un) { - struct stat st; - - if (stat(un->sun_path, &st) == 0 && (st.st_mode & S_IFMT) == S_IFSOCK) { - unlink(un->sun_path); - } -} -#endif - /* the overall server */ struct grpc_udp_server { gpr_mu mu; @@ -182,11 +167,7 @@ static void deactivated_all_ports(grpc_exec_ctx *exec_ctx, grpc_udp_server *s) { if (s->nports) { for (i = 0; i < s->nports; i++) { server_port *sp = &s->ports[i]; -#ifdef GPR_HAVE_UNIX_SOCKET - if (sp->addr.sockaddr.sa_family == AF_UNIX) { - unlink_if_unix_domain_socket(&sp->addr.un); - } -#endif + unlink_if_unix_domain_socket(&sp->addr.sockaddr); sp->destroyed_closure.cb = destroyed_port; sp->destroyed_closure.cb_arg = s; grpc_fd_orphan(exec_ctx, sp->emfd, &sp->destroyed_closure, NULL, @@ -344,11 +325,7 @@ int grpc_udp_server_add_port(grpc_udp_server *s, const void *addr, socklen_t sockname_len; int port; -#ifdef GPR_HAVE_UNIX_SOCKET - if (((struct sockaddr *)addr)->sa_family == AF_UNIX) { - unlink_if_unix_domain_socket(addr); - } -#endif + unlink_if_unix_domain_socket((struct sockaddr *)addr); /* Check if this is a wildcard port, and if so, try to keep the port the same as some previously created listener. */ diff --git a/src/core/iomgr/unix_sockets_posix.c b/src/core/iomgr/unix_sockets_posix.c new file mode 100644 index 0000000000..531ddcb37d --- /dev/null +++ b/src/core/iomgr/unix_sockets_posix.c @@ -0,0 +1,102 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "src/core/iomgr/unix_sockets_posix.h" + +#ifdef GPR_HAVE_UNIX_SOCKET + +#include +#include + +#include + +void grpc_create_socketpair_if_unix(int sv[2]) { + GPR_ASSERT(socketpair(AF_UNIX, SOCK_STREAM, 0, sv) == 0); +} + +grpc_resolved_addresses *grpc_resolve_unix_domain_address(const char* name) { + struct sockaddr_un *un; + + addrs = gpr_malloc(sizeof(grpc_resolved_addresses)); + addrs->naddrs = 1; + addrs->addrs = gpr_malloc(sizeof(grpc_resolved_address)); + un = (struct sockaddr_un *)addrs->addrs->addr; + un->sun_family = AF_UNIX; + strcpy(un->sun_path, name); + addrs->addrs->len = strlen(un->sun_path) + sizeof(un->sun_family) + 1; + return addrs; +} + +int grpc_is_unix_socket(sa_family_t addr_family) { + return addr_family == AF_UNIX; +} + +static void unlink_if_unix_domain_socket(const struct sockaddr *addr) { + if (addr->sa_family != AF_UNIX) { + return; + } + struct sockaddr_un *un = (struct sockaddr_un *)addr; + struct stat st; + + if (stat(un->sun_path, &st) == 0 && (st.st_mode & S_IFMT) == S_IFSOCK) { + unlink(un->sun_path); + } +} + +static int parse_unix(grpc_uri *uri, struct sockaddr_storage *addr, + size_t *len) { + struct sockaddr_un *un = (struct sockaddr_un *)addr; + + un->sun_family = AF_UNIX; + strcpy(un->sun_path, uri->path); + *len = strlen(un->sun_path) + sizeof(un->sun_family) + 1; + + return 1; +} + +static char *unix_get_default_authority(grpc_resolver_factory *factory, + grpc_uri *uri) { + return gpr_strdup("localhost"); +} + +char *grpc_sockaddr_to_uri_unix_if_possible(struct sockaddr *addr) { + if (addr->sa_family != AF_UNIX) { + return NULL; + } + + char* result; + gpr_asprintf(&result, "unix:%s", ((struct sockaddr_un *)addr)->sun_path); + return result; +} + +#endif diff --git a/src/core/iomgr/unix_sockets_posix.h b/src/core/iomgr/unix_sockets_posix.h new file mode 100644 index 0000000000..6023611373 --- /dev/null +++ b/src/core/iomgr/unix_sockets_posix.h @@ -0,0 +1,67 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef GRPC_INTERNAL_CORE_IOMGR_UNIX_SOCKETS_POSIX_H +#define GRPC_INTERNAL_CORE_IOMGR_UNIX_SOCKETS_POSIX_H + +#include + +#ifdef GPR_POSIX_SOCKET + +#include + +#include + +#include "src/core/client_config/resolver_factory.h" +#include "src/core/client_config/uri_parser.h"; +#include "src/core/iomgr/resolve_address.h" + +void grpc_create_socketpair_if_unix(int sv[2]); + +grpc_resolved_addresses *grpc_resolve_unix_domain_address(const char* name); + +int grpc_is_unix_socket(sa_family_t addr_family); + +static void unlink_if_unix_domain_socket(const struct sockaddr *addr); + +static int parse_unix(grpc_uri *uri, struct sockaddr_storage *addr, + size_t *len); + +static char *unix_get_default_authority(grpc_resolver_factory *factory, + grpc_uri *uri); + +char *grpc_sockaddr_to_uri_unix_if_possible(char **strp, + const char *format, ...); + +#endif +#endif /* GRPC_INTERNAL_CORE_IOMGR_UNIX_SOCKETS_POSIX_H */ diff --git a/src/core/iomgr/unix_sockets_posix_noop.c b/src/core/iomgr/unix_sockets_posix_noop.c new file mode 100644 index 0000000000..1e29242486 --- /dev/null +++ b/src/core/iomgr/unix_sockets_posix_noop.c @@ -0,0 +1,59 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + + +#include "src/core/iomgr/unix_sockets_posix.h" + +void grpc_create_socketpair_if_unix(int sv[2]) {} + +void grpc_resolve_unix_domain_address(const char* name) { + return NULL; +} + +int grpc_is_unix_socket(sa_family_t addr_family) { + return false; +} + +static void unlink_if_unix_domain_socket(const struct sockaddr *addr) {} + +static int parse_unix(grpc_uri *uri, struct sockaddr_storage *addr, + size_t *len) {} + +static char *unix_get_default_authority(grpc_resolver_factory *factory, + grpc_uri *uri) {} + +char *grpc_sockaddr_to_uri_unix_if_possible(struct sockaddr *addr) { + return NULL; +} + +#endif -- cgit v1.2.3 From 43df29552865541e6d6d11a14b3cf47a4c162b42 Mon Sep 17 00:00:00 2001 From: ahedberg Date: Fri, 18 Mar 2016 10:46:38 -0400 Subject: add unix_sockets_posix module to build system and fix compilation errors --- BUILD | 9 +++++++++ Makefile | 4 ++++ binding.gyp | 2 ++ build.yaml | 3 +++ config.m4 | 2 ++ gRPC.podspec | 4 ++++ grpc.gemspec | 3 +++ package.json | 3 +++ package.xml | 3 +++ src/core/iomgr/resolve_address_posix.c | 2 +- src/core/iomgr/sockaddr_utils.c | 2 +- src/core/iomgr/tcp_client_posix.c | 4 ++-- src/core/iomgr/unix_sockets_posix.c | 18 ++++++++--------- src/core/iomgr/unix_sockets_posix.h | 15 ++++++-------- src/core/iomgr/unix_sockets_posix_noop.c | 23 +++++++++++++--------- src/python/grpcio/grpc_core_dependencies.py | 2 ++ tools/doxygen/Doxyfile.core.internal | 3 +++ tools/run_tests/sources_and_headers.json | 8 ++++++++ vsprojects/vcxproj/grpc/grpc.vcxproj | 5 +++++ vsprojects/vcxproj/grpc/grpc.vcxproj.filters | 9 +++++++++ .../vcxproj/grpc_unsecure/grpc_unsecure.vcxproj | 5 +++++ .../grpc_unsecure/grpc_unsecure.vcxproj.filters | 9 +++++++++ 22 files changed, 107 insertions(+), 31 deletions(-) (limited to 'src/core/iomgr/resolve_address_posix.c') diff --git a/BUILD b/BUILD index 0e9f37a0e3..70d188afdf 100644 --- a/BUILD +++ b/BUILD @@ -221,6 +221,7 @@ cc_library( "src/core/iomgr/timer.h", "src/core/iomgr/timer_heap.h", "src/core/iomgr/udp_server.h", + "src/core/iomgr/unix_sockets_posix.h", "src/core/iomgr/wakeup_fd_pipe.h", "src/core/iomgr/wakeup_fd_posix.h", "src/core/iomgr/workqueue.h", @@ -361,6 +362,8 @@ cc_library( "src/core/iomgr/timer.c", "src/core/iomgr/timer_heap.c", "src/core/iomgr/udp_server.c", + "src/core/iomgr/unix_sockets_posix.c", + "src/core/iomgr/unix_sockets_posix_noop.c", "src/core/iomgr/wakeup_fd_eventfd.c", "src/core/iomgr/wakeup_fd_nospecial.c", "src/core/iomgr/wakeup_fd_pipe.c", @@ -551,6 +554,7 @@ cc_library( "src/core/iomgr/timer.h", "src/core/iomgr/timer_heap.h", "src/core/iomgr/udp_server.h", + "src/core/iomgr/unix_sockets_posix.h", "src/core/iomgr/wakeup_fd_pipe.h", "src/core/iomgr/wakeup_fd_posix.h", "src/core/iomgr/workqueue.h", @@ -678,6 +682,8 @@ cc_library( "src/core/iomgr/timer.c", "src/core/iomgr/timer_heap.c", "src/core/iomgr/udp_server.c", + "src/core/iomgr/unix_sockets_posix.c", + "src/core/iomgr/unix_sockets_posix_noop.c", "src/core/iomgr/wakeup_fd_eventfd.c", "src/core/iomgr/wakeup_fd_nospecial.c", "src/core/iomgr/wakeup_fd_pipe.c", @@ -1339,6 +1345,8 @@ objc_library( "src/core/iomgr/timer.c", "src/core/iomgr/timer_heap.c", "src/core/iomgr/udp_server.c", + "src/core/iomgr/unix_sockets_posix.c", + "src/core/iomgr/unix_sockets_posix_noop.c", "src/core/iomgr/wakeup_fd_eventfd.c", "src/core/iomgr/wakeup_fd_nospecial.c", "src/core/iomgr/wakeup_fd_pipe.c", @@ -1510,6 +1518,7 @@ objc_library( "src/core/iomgr/timer.h", "src/core/iomgr/timer_heap.h", "src/core/iomgr/udp_server.h", + "src/core/iomgr/unix_sockets_posix.h", "src/core/iomgr/wakeup_fd_pipe.h", "src/core/iomgr/wakeup_fd_posix.h", "src/core/iomgr/workqueue.h", diff --git a/Makefile b/Makefile index f118d54253..e980b1c877 100644 --- a/Makefile +++ b/Makefile @@ -2432,6 +2432,8 @@ LIBGRPC_SRC = \ src/core/iomgr/timer.c \ src/core/iomgr/timer_heap.c \ src/core/iomgr/udp_server.c \ + src/core/iomgr/unix_sockets_posix.c \ + src/core/iomgr/unix_sockets_posix_noop.c \ src/core/iomgr/wakeup_fd_eventfd.c \ src/core/iomgr/wakeup_fd_nospecial.c \ src/core/iomgr/wakeup_fd_pipe.c \ @@ -2744,6 +2746,8 @@ LIBGRPC_UNSECURE_SRC = \ src/core/iomgr/timer.c \ src/core/iomgr/timer_heap.c \ src/core/iomgr/udp_server.c \ + src/core/iomgr/unix_sockets_posix.c \ + src/core/iomgr/unix_sockets_posix_noop.c \ src/core/iomgr/wakeup_fd_eventfd.c \ src/core/iomgr/wakeup_fd_nospecial.c \ src/core/iomgr/wakeup_fd_pipe.c \ diff --git a/binding.gyp b/binding.gyp index d1e086cfa0..e1f41c224e 100644 --- a/binding.gyp +++ b/binding.gyp @@ -627,6 +627,8 @@ 'src/core/iomgr/timer.c', 'src/core/iomgr/timer_heap.c', 'src/core/iomgr/udp_server.c', + 'src/core/iomgr/unix_sockets_posix.c', + 'src/core/iomgr/unix_sockets_posix_noop.c', 'src/core/iomgr/wakeup_fd_eventfd.c', 'src/core/iomgr/wakeup_fd_nospecial.c', 'src/core/iomgr/wakeup_fd_pipe.c', diff --git a/build.yaml b/build.yaml index 83b7714e65..3f9abccf9f 100644 --- a/build.yaml +++ b/build.yaml @@ -310,6 +310,7 @@ filegroups: - src/core/iomgr/timer.h - src/core/iomgr/timer_heap.h - src/core/iomgr/udp_server.h + - src/core/iomgr/unix_sockets_posix.h - src/core/iomgr/wakeup_fd_pipe.h - src/core/iomgr/wakeup_fd_posix.h - src/core/iomgr/workqueue.h @@ -430,6 +431,8 @@ filegroups: - src/core/iomgr/timer.c - src/core/iomgr/timer_heap.c - src/core/iomgr/udp_server.c + - src/core/iomgr/unix_sockets_posix.c + - src/core/iomgr/unix_sockets_posix_noop.c - src/core/iomgr/wakeup_fd_eventfd.c - src/core/iomgr/wakeup_fd_nospecial.c - src/core/iomgr/wakeup_fd_pipe.c diff --git a/config.m4 b/config.m4 index 8ab45e6603..37d71ecb94 100644 --- a/config.m4 +++ b/config.m4 @@ -149,6 +149,8 @@ if test "$PHP_GRPC" != "no"; then src/core/iomgr/timer.c \ src/core/iomgr/timer_heap.c \ src/core/iomgr/udp_server.c \ + src/core/iomgr/unix_sockets_posix.c \ + src/core/iomgr/unix_sockets_posix_noop.c \ src/core/iomgr/wakeup_fd_eventfd.c \ src/core/iomgr/wakeup_fd_nospecial.c \ src/core/iomgr/wakeup_fd_pipe.c \ diff --git a/gRPC.podspec b/gRPC.podspec index f3103ea79a..ea178960fe 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -225,6 +225,7 @@ Pod::Spec.new do |s| 'src/core/iomgr/timer.h', 'src/core/iomgr/timer_heap.h', 'src/core/iomgr/udp_server.h', + 'src/core/iomgr/unix_sockets_posix.h', 'src/core/iomgr/wakeup_fd_pipe.h', 'src/core/iomgr/wakeup_fd_posix.h', 'src/core/iomgr/workqueue.h', @@ -378,6 +379,8 @@ Pod::Spec.new do |s| 'src/core/iomgr/timer.c', 'src/core/iomgr/timer_heap.c', 'src/core/iomgr/udp_server.c', + 'src/core/iomgr/unix_sockets_posix.c', + 'src/core/iomgr/unix_sockets_posix_noop.c', 'src/core/iomgr/wakeup_fd_eventfd.c', 'src/core/iomgr/wakeup_fd_nospecial.c', 'src/core/iomgr/wakeup_fd_pipe.c', @@ -546,6 +549,7 @@ Pod::Spec.new do |s| 'src/core/iomgr/timer.h', 'src/core/iomgr/timer_heap.h', 'src/core/iomgr/udp_server.h', + 'src/core/iomgr/unix_sockets_posix.h', 'src/core/iomgr/wakeup_fd_pipe.h', 'src/core/iomgr/wakeup_fd_posix.h', 'src/core/iomgr/workqueue.h', diff --git a/grpc.gemspec b/grpc.gemspec index 1b3f15ecf3..6d94258a21 100755 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -221,6 +221,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/iomgr/timer.h ) s.files += %w( src/core/iomgr/timer_heap.h ) s.files += %w( src/core/iomgr/udp_server.h ) + s.files += %w( src/core/iomgr/unix_sockets_posix.h ) s.files += %w( src/core/iomgr/wakeup_fd_pipe.h ) s.files += %w( src/core/iomgr/wakeup_fd_posix.h ) s.files += %w( src/core/iomgr/workqueue.h ) @@ -361,6 +362,8 @@ Gem::Specification.new do |s| s.files += %w( src/core/iomgr/timer.c ) s.files += %w( src/core/iomgr/timer_heap.c ) s.files += %w( src/core/iomgr/udp_server.c ) + s.files += %w( src/core/iomgr/unix_sockets_posix.c ) + s.files += %w( src/core/iomgr/unix_sockets_posix_noop.c ) s.files += %w( src/core/iomgr/wakeup_fd_eventfd.c ) s.files += %w( src/core/iomgr/wakeup_fd_nospecial.c ) s.files += %w( src/core/iomgr/wakeup_fd_pipe.c ) diff --git a/package.json b/package.json index db7f299e13..27342cceb0 100644 --- a/package.json +++ b/package.json @@ -165,6 +165,7 @@ "src/core/iomgr/timer.h", "src/core/iomgr/timer_heap.h", "src/core/iomgr/udp_server.h", + "src/core/iomgr/unix_sockets_posix.h", "src/core/iomgr/wakeup_fd_pipe.h", "src/core/iomgr/wakeup_fd_posix.h", "src/core/iomgr/workqueue.h", @@ -305,6 +306,8 @@ "src/core/iomgr/timer.c", "src/core/iomgr/timer_heap.c", "src/core/iomgr/udp_server.c", + "src/core/iomgr/unix_sockets_posix.c", + "src/core/iomgr/unix_sockets_posix_noop.c", "src/core/iomgr/wakeup_fd_eventfd.c", "src/core/iomgr/wakeup_fd_nospecial.c", "src/core/iomgr/wakeup_fd_pipe.c", diff --git a/package.xml b/package.xml index bb4dcc2037..b992470343 100644 --- a/package.xml +++ b/package.xml @@ -225,6 +225,7 @@ + @@ -365,6 +366,8 @@ + + diff --git a/src/core/iomgr/resolve_address_posix.c b/src/core/iomgr/resolve_address_posix.c index ef193c02ec..26b3aa8189 100644 --- a/src/core/iomgr/resolve_address_posix.c +++ b/src/core/iomgr/resolve_address_posix.c @@ -50,7 +50,7 @@ #include "src/core/iomgr/executor.h" #include "src/core/iomgr/iomgr_internal.h" #include "src/core/iomgr/sockaddr_utils.h" -#include "src/core/iomgr/unix_posix_sockets.h" +#include "src/core/iomgr/unix_sockets_posix.h" #include "src/core/support/block_annotate.h" #include "src/core/support/string.h" diff --git a/src/core/iomgr/sockaddr_utils.c b/src/core/iomgr/sockaddr_utils.c index 667ab01432..682b290a83 100644 --- a/src/core/iomgr/sockaddr_utils.c +++ b/src/core/iomgr/sockaddr_utils.c @@ -200,7 +200,7 @@ int grpc_sockaddr_get_port(const struct sockaddr *addr) { case AF_INET6: return ntohs(((struct sockaddr_in6 *)addr)->sin6_port); default: - if (grpc_is_unix_socket(addr->sa_family)) { + if (grpc_is_unix_socket(addr)) { return 1; } gpr_log(GPR_ERROR, "Unknown socket family %d in grpc_sockaddr_get_port", diff --git a/src/core/iomgr/tcp_client_posix.c b/src/core/iomgr/tcp_client_posix.c index 2ed6fb107b..1d3f9b6555 100644 --- a/src/core/iomgr/tcp_client_posix.c +++ b/src/core/iomgr/tcp_client_posix.c @@ -54,6 +54,7 @@ #include "src/core/iomgr/socket_utils_posix.h" #include "src/core/iomgr/tcp_posix.h" #include "src/core/iomgr/timer.h" +#include "src/core/iomgr/unix_sockets_posix.h" #include "src/core/support/string.h" extern int grpc_tcp_trace; @@ -77,8 +78,7 @@ static int prepare_socket(const struct sockaddr *addr, int fd) { } if (!grpc_set_socket_nonblocking(fd, 1) || !grpc_set_socket_cloexec(fd, 1) || - (!grpc_is_unix_socket(addr->sa_family) && - !grpc_set_socket_low_latency(fd, 1)) || + (!grpc_is_unix_socket(addr) && !grpc_set_socket_low_latency(fd, 1)) || !grpc_set_socket_no_sigpipe_if_possible(fd)) { gpr_log(GPR_ERROR, "Unable to configure socket %d: %s", fd, strerror(errno)); diff --git a/src/core/iomgr/unix_sockets_posix.c b/src/core/iomgr/unix_sockets_posix.c index 531ddcb37d..0ff48320ca 100644 --- a/src/core/iomgr/unix_sockets_posix.c +++ b/src/core/iomgr/unix_sockets_posix.c @@ -36,6 +36,7 @@ #ifdef GPR_HAVE_UNIX_SOCKET #include +#include #include #include @@ -47,7 +48,7 @@ void grpc_create_socketpair_if_unix(int sv[2]) { grpc_resolved_addresses *grpc_resolve_unix_domain_address(const char* name) { struct sockaddr_un *un; - addrs = gpr_malloc(sizeof(grpc_resolved_addresses)); + grpc_resolved_addresses *addrs = gpr_malloc(sizeof(grpc_resolved_addresses)); addrs->naddrs = 1; addrs->addrs = gpr_malloc(sizeof(grpc_resolved_address)); un = (struct sockaddr_un *)addrs->addrs->addr; @@ -57,11 +58,11 @@ grpc_resolved_addresses *grpc_resolve_unix_domain_address(const char* name) { return addrs; } -int grpc_is_unix_socket(sa_family_t addr_family) { - return addr_family == AF_UNIX; +int grpc_is_unix_socket(const struct sockaddr *addr) { + return addr->sa_family == AF_UNIX; } -static void unlink_if_unix_domain_socket(const struct sockaddr *addr) { +void unlink_if_unix_domain_socket(const struct sockaddr *addr) { if (addr->sa_family != AF_UNIX) { return; } @@ -73,8 +74,7 @@ static void unlink_if_unix_domain_socket(const struct sockaddr *addr) { } } -static int parse_unix(grpc_uri *uri, struct sockaddr_storage *addr, - size_t *len) { +int parse_unix(grpc_uri *uri, struct sockaddr_storage *addr, size_t *len) { struct sockaddr_un *un = (struct sockaddr_un *)addr; un->sun_family = AF_UNIX; @@ -84,12 +84,12 @@ static int parse_unix(grpc_uri *uri, struct sockaddr_storage *addr, return 1; } -static char *unix_get_default_authority(grpc_resolver_factory *factory, - grpc_uri *uri) { +char *unix_get_default_authority(grpc_resolver_factory *factory, + grpc_uri *uri) { return gpr_strdup("localhost"); } -char *grpc_sockaddr_to_uri_unix_if_possible(struct sockaddr *addr) { +char *grpc_sockaddr_to_uri_unix_if_possible(const struct sockaddr *addr) { if (addr->sa_family != AF_UNIX) { return NULL; } diff --git a/src/core/iomgr/unix_sockets_posix.h b/src/core/iomgr/unix_sockets_posix.h index 6023611373..c7ba0bfe09 100644 --- a/src/core/iomgr/unix_sockets_posix.h +++ b/src/core/iomgr/unix_sockets_posix.h @@ -43,25 +43,22 @@ #include #include "src/core/client_config/resolver_factory.h" -#include "src/core/client_config/uri_parser.h"; +#include "src/core/client_config/uri_parser.h" #include "src/core/iomgr/resolve_address.h" void grpc_create_socketpair_if_unix(int sv[2]); grpc_resolved_addresses *grpc_resolve_unix_domain_address(const char* name); -int grpc_is_unix_socket(sa_family_t addr_family); +int grpc_is_unix_socket(const struct sockaddr *addr); -static void unlink_if_unix_domain_socket(const struct sockaddr *addr); +void unlink_if_unix_domain_socket(const struct sockaddr *addr); -static int parse_unix(grpc_uri *uri, struct sockaddr_storage *addr, - size_t *len); +int parse_unix(grpc_uri *uri, struct sockaddr_storage *addr, size_t *len); -static char *unix_get_default_authority(grpc_resolver_factory *factory, - grpc_uri *uri); +char *unix_get_default_authority(grpc_resolver_factory *factory, grpc_uri *uri); -char *grpc_sockaddr_to_uri_unix_if_possible(char **strp, - const char *format, ...); +char *grpc_sockaddr_to_uri_unix_if_possible(const struct sockaddr *addr); #endif #endif /* GRPC_INTERNAL_CORE_IOMGR_UNIX_SOCKETS_POSIX_H */ diff --git a/src/core/iomgr/unix_sockets_posix_noop.c b/src/core/iomgr/unix_sockets_posix_noop.c index 1e29242486..1f6773576c 100644 --- a/src/core/iomgr/unix_sockets_posix_noop.c +++ b/src/core/iomgr/unix_sockets_posix_noop.c @@ -34,26 +34,31 @@ #include "src/core/iomgr/unix_sockets_posix.h" +#ifdef GPR_POSIX_SOCKET + void grpc_create_socketpair_if_unix(int sv[2]) {} -void grpc_resolve_unix_domain_address(const char* name) { +grpc_resolved_addresses *grpc_resolve_unix_domain_address(const char* name) { return NULL; } -int grpc_is_unix_socket(sa_family_t addr_family) { +int grpc_is_unix_socket(const struct sockaddr *addr) { return false; } -static void unlink_if_unix_domain_socket(const struct sockaddr *addr) {} +void unlink_if_unix_domain_socket(const struct sockaddr *addr) {} -static int parse_unix(grpc_uri *uri, struct sockaddr_storage *addr, - size_t *len) {} +int parse_unix(grpc_uri *uri, struct sockaddr_storage *addr, size_t *len) { + return 0; +} -static char *unix_get_default_authority(grpc_resolver_factory *factory, - grpc_uri *uri) {} +char *unix_get_default_authority(grpc_resolver_factory *factory, + grpc_uri *uri) { + return NULL; +} -char *grpc_sockaddr_to_uri_unix_if_possible(struct sockaddr *addr) { - return NULL; +char *grpc_sockaddr_to_uri_unix_if_possible(const struct sockaddr *addr) { + return NULL; } #endif diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index a543791f5c..9c131bb4f0 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -143,6 +143,8 @@ CORE_SOURCE_FILES = [ 'src/core/iomgr/timer.c', 'src/core/iomgr/timer_heap.c', 'src/core/iomgr/udp_server.c', + 'src/core/iomgr/unix_sockets_posix.c', + 'src/core/iomgr/unix_sockets_posix_noop.c', 'src/core/iomgr/wakeup_fd_eventfd.c', 'src/core/iomgr/wakeup_fd_nospecial.c', 'src/core/iomgr/wakeup_fd_pipe.c', diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index a894eaf22b..fe8dbe0418 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -839,6 +839,7 @@ src/core/iomgr/time_averaged_stats.h \ src/core/iomgr/timer.h \ src/core/iomgr/timer_heap.h \ src/core/iomgr/udp_server.h \ +src/core/iomgr/unix_sockets_posix.h \ src/core/iomgr/wakeup_fd_pipe.h \ src/core/iomgr/wakeup_fd_posix.h \ src/core/iomgr/workqueue.h \ @@ -979,6 +980,8 @@ src/core/iomgr/time_averaged_stats.c \ src/core/iomgr/timer.c \ src/core/iomgr/timer_heap.c \ src/core/iomgr/udp_server.c \ +src/core/iomgr/unix_sockets_posix.c \ +src/core/iomgr/unix_sockets_posix_noop.c \ src/core/iomgr/wakeup_fd_eventfd.c \ src/core/iomgr/wakeup_fd_nospecial.c \ src/core/iomgr/wakeup_fd_pipe.c \ diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 092ed35ad9..83dbf0ba5f 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -3955,6 +3955,7 @@ "src/core/iomgr/timer.h", "src/core/iomgr/timer_heap.h", "src/core/iomgr/udp_server.h", + "src/core/iomgr/unix_sockets_posix.h", "src/core/iomgr/wakeup_fd_pipe.h", "src/core/iomgr/wakeup_fd_posix.h", "src/core/iomgr/workqueue.h", @@ -4185,6 +4186,9 @@ "src/core/iomgr/timer_heap.h", "src/core/iomgr/udp_server.c", "src/core/iomgr/udp_server.h", + "src/core/iomgr/unix_sockets_posix.c", + "src/core/iomgr/unix_sockets_posix.h", + "src/core/iomgr/unix_sockets_posix_noop.c", "src/core/iomgr/wakeup_fd_eventfd.c", "src/core/iomgr/wakeup_fd_nospecial.c", "src/core/iomgr/wakeup_fd_pipe.c", @@ -4512,6 +4516,7 @@ "src/core/iomgr/timer.h", "src/core/iomgr/timer_heap.h", "src/core/iomgr/udp_server.h", + "src/core/iomgr/unix_sockets_posix.h", "src/core/iomgr/wakeup_fd_pipe.h", "src/core/iomgr/wakeup_fd_posix.h", "src/core/iomgr/workqueue.h", @@ -4726,6 +4731,9 @@ "src/core/iomgr/timer_heap.h", "src/core/iomgr/udp_server.c", "src/core/iomgr/udp_server.h", + "src/core/iomgr/unix_sockets_posix.c", + "src/core/iomgr/unix_sockets_posix.h", + "src/core/iomgr/unix_sockets_posix_noop.c", "src/core/iomgr/wakeup_fd_eventfd.c", "src/core/iomgr/wakeup_fd_nospecial.c", "src/core/iomgr/wakeup_fd_pipe.c", diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj b/vsprojects/vcxproj/grpc/grpc.vcxproj index c2635c31a3..ac87537a85 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj @@ -348,6 +348,7 @@ + @@ -560,6 +561,10 @@ + + + + diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters index 6dd10d3dd3..3a36073b9d 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters @@ -211,6 +211,12 @@ src\core\iomgr + + src\core\iomgr + + + src\core\iomgr + src\core\iomgr @@ -722,6 +728,9 @@ src\core\iomgr + + src\core\iomgr + src\core\iomgr diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj index f0d869ba93..9126183e20 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj @@ -338,6 +338,7 @@ + @@ -538,6 +539,10 @@ + + + + diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters index 1f240212a3..b7cf0764e8 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters @@ -214,6 +214,12 @@ src\core\iomgr + + src\core\iomgr + + + src\core\iomgr + src\core\iomgr @@ -659,6 +665,9 @@ src\core\iomgr + + src\core\iomgr + src\core\iomgr -- cgit v1.2.3