Commit 1db61302 authored by Andreas Schneider's avatar Andreas Schneider Committed by Michael Adam

swrap: Add support for TCP_NODELAY in getsockopt()

Signed-off-by: default avatarAndreas Schneider <asn@samba.org>
Reviewed-by: default avatarMichael Adam <obnox@samba.org>
parent e9e0dac6
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment