|
|
@ -173,17 +173,8 @@ grpc_error* grpc_tcp_server_prepare_socket(grpc_tcp_server* s, int fd, |
|
|
|
err = grpc_set_socket_no_sigpipe_if_possible(fd); |
|
|
|
err = grpc_set_socket_no_sigpipe_if_possible(fd); |
|
|
|
if (err != GRPC_ERROR_NONE) goto error; |
|
|
|
if (err != GRPC_ERROR_NONE) goto error; |
|
|
|
|
|
|
|
|
|
|
|
if (s->channel_args) { |
|
|
|
err = grpc_apply_socket_mutator_in_args(fd, s->channel_args); |
|
|
|
for (size_t i = 0; i < s->channel_args->num_args; i++) { |
|
|
|
|
|
|
|
if (0 == strcmp(s->channel_args->args[i].key, GRPC_ARG_SOCKET_MUTATOR)) { |
|
|
|
|
|
|
|
GPR_ASSERT(s->channel_args->args[i].type == GRPC_ARG_POINTER); |
|
|
|
|
|
|
|
grpc_socket_mutator* mutator = static_cast<grpc_socket_mutator*>( |
|
|
|
|
|
|
|
s->channel_args->args[i].value.pointer.p); |
|
|
|
|
|
|
|
err = grpc_set_socket_with_mutator(fd, mutator); |
|
|
|
|
|
|
|
if (err != GRPC_ERROR_NONE) goto error; |
|
|
|
if (err != GRPC_ERROR_NONE) goto error; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (bind(fd, reinterpret_cast<grpc_sockaddr*>(const_cast<char*>(addr->addr)), |
|
|
|
if (bind(fd, reinterpret_cast<grpc_sockaddr*>(const_cast<char*>(addr->addr)), |
|
|
|
addr->len) < 0) { |
|
|
|
addr->len) < 0) { |
|
|
|