diff options
author | Matt Johnston <matt@ucc.asn.au> | 2015-02-15 22:34:05 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2015-02-15 22:34:05 +0800 |
commit | 28f61c8b3a2015fdf07755ed8797a47eb0508887 (patch) | |
tree | 15173b559a01c121a2cb4b61b3fcb602056b1324 /dbutil.c | |
parent | 9abcc7b909b6ff0f173405e73dc7c0c3d093e44a (diff) |
tcp fastopen for the server
--HG--
branch : fastopen
Diffstat (limited to 'dbutil.c')
-rw-r--r-- | dbutil.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -221,6 +221,16 @@ void set_sock_nodelay(int sock) { setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (void*)&val, sizeof(val)); } +#ifdef DROPBEAR_TCP_FAST_OPEN +void set_listen_fast_open(int sock) { + int qlen = MAX(MAX_UNAUTH_PER_IP, 5); + if (setsockopt(sock, SOL_TCP, TCP_FASTOPEN, &qlen, sizeof(qlen)) != 0) { + TRACE(("set_listen_fast_open failed for socket %d: %s", sock, strerror(errno))) + } +} + +#endif + void set_sock_priority(int sock, enum dropbear_prio prio) { int iptos_val = 0, so_prio_val = 0, rc; |