diff options
Diffstat (limited to 'src/socket_wrapper.c')
| -rw-r--r-- | src/socket_wrapper.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c index 527ba21..aad5f3e 100644 --- a/src/socket_wrapper.c +++ b/src/socket_wrapper.c @@ -3351,6 +3351,29 @@ static int swrap_getsockopt(int s, int level, int optname, optval, optlen); } + } else if (level == IPPROTO_TCP) { + switch (optname) { +#ifdef TCP_NODELAY + case TCP_NODELAY: + /* + * This enables sending packets directly out over TCP. + * As a unix socket is doing that any way, report it as + * enabled. + */ + if (optval == NULL || optlen == NULL || + *optlen < (socklen_t)sizeof(int)) { + errno = EINVAL; + return -1; + } + + *optlen = sizeof(int); + *(int *)optval = si->tcp_nodelay; + + return 0; +#endif /* TCP_NODELAY */ + default: + break; + } } errno = ENOPROTOOPT; |
