aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/iomgr/tcp_client_posix.c
diff options
context:
space:
mode:
authorGravatar Nicolas Noble <nicolasnoble@users.noreply.github.com>2015-02-16 20:16:10 -0800
committerGravatar Nicolas Noble <nicolasnoble@users.noreply.github.com>2015-02-16 20:16:10 -0800
commitb4215bba564627b62241ef7e37528fa154a79e7c (patch)
tree2fd8cc36a27cee0c0562f09988fb8852a50db527 /src/core/iomgr/tcp_client_posix.c
parentbefc83d3dd8d8ceb80822b7de910f1268195d10b (diff)
parent23197abb50b9116c4cbca52cd5baba157e7110d9 (diff)
Merge pull request #525 from ctiller/uds
Unix domain socket support
Diffstat (limited to 'src/core/iomgr/tcp_client_posix.c')
-rw-r--r--src/core/iomgr/tcp_client_posix.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/iomgr/tcp_client_posix.c b/src/core/iomgr/tcp_client_posix.c
index 851530ce68..6dc7997833 100644
--- a/src/core/iomgr/tcp_client_posix.c
+++ b/src/core/iomgr/tcp_client_posix.c
@@ -62,13 +62,13 @@ typedef struct {
int refs;
} async_connect;
-static int prepare_socket(int fd) {
+static int prepare_socket(const struct sockaddr *addr, int fd) {
if (fd < 0) {
goto error;
}
if (!grpc_set_socket_nonblocking(fd, 1) || !grpc_set_socket_cloexec(fd, 1) ||
- !grpc_set_socket_low_latency(fd, 1)) {
+ (addr->sa_family != AF_UNIX && !grpc_set_socket_low_latency(fd, 1))) {
gpr_log(GPR_ERROR, "Unable to configure socket %d: %s", fd,
strerror(errno));
goto error;
@@ -200,7 +200,7 @@ void grpc_tcp_client_connect(void (*cb)(void *arg, grpc_endpoint *ep),
addr = (struct sockaddr *)&addr4_copy;
addr_len = sizeof(addr4_copy);
}
- if (!prepare_socket(fd)) {
+ if (!prepare_socket(addr, fd)) {
cb(arg, NULL);
return;
}