diff options
-rw-r--r-- | src/core/iomgr/tcp_server_posix.c | 23 | ||||
-rw-r--r-- | src/core/iomgr/udp_server.c | 1 | ||||
-rw-r--r-- | src/core/surface/init.c | 9 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_links/service.py | 4 | ||||
-rw-r--r-- | src/python/grpcio/grpc/beta/_server.py | 4 |
5 files changed, 23 insertions, 18 deletions
diff --git a/src/core/iomgr/tcp_server_posix.c b/src/core/iomgr/tcp_server_posix.c index 03dfddd925..11508044dc 100644 --- a/src/core/iomgr/tcp_server_posix.c +++ b/src/core/iomgr/tcp_server_posix.c @@ -486,7 +486,6 @@ int grpc_tcp_server_add_port(grpc_tcp_server *s, const void *addr, /* If we didn't get a dualstack socket, also listen on 0.0.0.0. */ if (port == 0 && sp != NULL) { grpc_sockaddr_set_port((struct sockaddr *)&wild4, sp->port); - sp2 = sp; } addr = (struct sockaddr *)&wild4; addr_len = sizeof(wild4); @@ -495,16 +494,18 @@ int grpc_tcp_server_add_port(grpc_tcp_server *s, const void *addr, fd = grpc_create_dualstack_socket(addr, SOCK_STREAM, 0, &dsmode); if (fd < 0) { gpr_log(GPR_ERROR, "Unable to create socket: %s", strerror(errno)); - } - if (dsmode == GRPC_DSMODE_IPV4 && - grpc_sockaddr_is_v4mapped(addr, &addr4_copy)) { - addr = (struct sockaddr *)&addr4_copy; - addr_len = sizeof(addr4_copy); - } - sp = add_socket_to_server(s, fd, addr, addr_len, port_index, fd_index); - if (sp2 != NULL && sp != NULL) { - sp2->sibling = sp; - sp->is_sibling = 1; + } else { + if (dsmode == GRPC_DSMODE_IPV4 && + grpc_sockaddr_is_v4mapped(addr, &addr4_copy)) { + addr = (struct sockaddr *)&addr4_copy; + addr_len = sizeof(addr4_copy); + } + sp2 = sp; + sp = add_socket_to_server(s, fd, addr, addr_len, port_index, fd_index); + if (sp2 != NULL && sp != NULL) { + sp2->sibling = sp; + sp->is_sibling = 1; + } } done: diff --git a/src/core/iomgr/udp_server.c b/src/core/iomgr/udp_server.c index efedd9f32e..e7853af58a 100644 --- a/src/core/iomgr/udp_server.c +++ b/src/core/iomgr/udp_server.c @@ -61,6 +61,7 @@ #include "src/core/iomgr/socket_utils_posix.h" #include "src/core/iomgr/unix_sockets_posix.h" #include "src/core/support/string.h" +#include <grpc/grpc.h> #include <grpc/support/alloc.h> #include <grpc/support/log.h> #include <grpc/support/sync.h> diff --git a/src/core/surface/init.c b/src/core/surface/init.c index 2ce50a0d82..233572a9f3 100644 --- a/src/core/surface/init.c +++ b/src/core/surface/init.c @@ -89,18 +89,21 @@ static void do_basic_init(void) { } static bool append_filter(grpc_channel_stack_builder *builder, void *arg) { - return grpc_channel_stack_builder_append_filter(builder, arg, NULL, NULL); + return grpc_channel_stack_builder_append_filter( + builder, (const grpc_channel_filter *)arg, NULL, NULL); } static bool prepend_filter(grpc_channel_stack_builder *builder, void *arg) { - return grpc_channel_stack_builder_prepend_filter(builder, arg, NULL, NULL); + return grpc_channel_stack_builder_prepend_filter( + builder, (const grpc_channel_filter *)arg, NULL, NULL); } static bool maybe_add_http_filter(grpc_channel_stack_builder *builder, void *arg) { grpc_transport *t = grpc_channel_stack_builder_get_transport(builder); if (t && strstr(t->vtable->name, "http")) { - return grpc_channel_stack_builder_prepend_filter(builder, arg, NULL, NULL); + return grpc_channel_stack_builder_prepend_filter( + builder, (const grpc_channel_filter *)arg, NULL, NULL); } return true; } diff --git a/src/python/grpcio/grpc/_links/service.py b/src/python/grpcio/grpc/_links/service.py index 01edee6896..e0f26a5b0f 100644 --- a/src/python/grpcio/grpc/_links/service.py +++ b/src/python/grpcio/grpc/_links/service.py @@ -1,4 +1,4 @@ -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -177,7 +177,7 @@ class _Kernel(object): call = service_acceptance.call call.accept(self._completion_queue, call) try: - group, method = service_acceptance.method.split('/')[1:3] + group, method = service_acceptance.method.split(b'/')[1:3] except ValueError: logging.info('Illegal path "%s"!', service_acceptance.method) return diff --git a/src/python/grpcio/grpc/beta/_server.py b/src/python/grpcio/grpc/beta/_server.py index 2b520cc7e5..12d16e6c18 100644 --- a/src/python/grpcio/grpc/beta/_server.py +++ b/src/python/grpcio/grpc/beta/_server.py @@ -1,4 +1,4 @@ -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -62,7 +62,7 @@ class _GRPCServicer(base.Servicer): if e.code is None and e.details is None: raise base.NoSuchMethodError( interfaces.StatusCode.UNIMPLEMENTED, - b'Method "%s" of service "%s" not implemented!' % (method, group)) + 'Method "%s" of service "%s" not implemented!' % (method, group)) else: raise |