diff options
author | Nicolas Noble <nicolasnoble@users.noreply.github.com> | 2015-02-16 20:16:10 -0800 |
---|---|---|
committer | Nicolas Noble <nicolasnoble@users.noreply.github.com> | 2015-02-16 20:16:10 -0800 |
commit | b4215bba564627b62241ef7e37528fa154a79e7c (patch) | |
tree | 2fd8cc36a27cee0c0562f09988fb8852a50db527 /src/core/iomgr/tcp_client_posix.c | |
parent | befc83d3dd8d8ceb80822b7de910f1268195d10b (diff) | |
parent | 23197abb50b9116c4cbca52cd5baba157e7110d9 (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.c | 6 |
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; } |