diff options
author | Shawn Landden <shawn@git.icu> | 2018-07-25 21:16:29 -0700 |
---|---|---|
committer | Shawn Landden <shawn@git.icu> | 2018-07-25 21:19:07 -0700 |
commit | 08c24d2d71bffed9c224a722f2958757a35545f2 (patch) | |
tree | 174d303f2da5857f57d9bd99198bf29c852e5302 /src/io.c | |
parent | bd137d0cfb7b0517efe998a7b79d3318b471ccd6 (diff) | |
download | distcc-git-08c24d2d71bffed9c224a722f2958757a35545f2.tar.gz |
test for sockets
Diffstat (limited to 'src/io.c')
-rw-r--r-- | src/io.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -252,7 +252,6 @@ int dcc_writex(int fd, const void *buf, size_t len) return 0; } - /** * Stick a TCP cork in the socket. It's not clear that this will help * performance, but it might. @@ -262,7 +261,8 @@ int dcc_writex(int fd, const void *buf, size_t len) int tcp_cork_sock(int POSSIBLY_UNUSED(fd), int POSSIBLY_UNUSED(corked)) { #if defined(TCP_CORK) && defined(SOL_TCP) - if (!dcc_getenv_bool("DISTCC_TCP_CORK", 1)) + if (!dcc_getenv_bool("DISTCC_TCP_CORK", 1) || !(sd_is_socket(fd, AF_INET, SOCK_STREAM, 1) || + sd_is_socket(fd, AF_INET6, SOCK_STREAM, 1))) return 0; if (setsockopt(fd, SOL_TCP, TCP_CORK, &corked, sizeof corked) == -1) { @@ -280,8 +280,6 @@ int tcp_cork_sock(int POSSIBLY_UNUSED(fd), int POSSIBLY_UNUSED(corked)) return 0; } - - int dcc_close(int fd) { if (close(fd) != 0) { |