comparison dbutil.c @ 1023:a00303a7d247 fastopen

tcp fastopen for the server
author Matt Johnston <matt@ucc.asn.au>
date Sun, 15 Feb 2015 22:34:05 +0800
parents 4121ca987e6a
children aac0095dc3b4
comparison
equal deleted inserted replaced
1022:4121ca987e6a 1023:a00303a7d247
219 /* disable nagle */ 219 /* disable nagle */
220 val = 1; 220 val = 1;
221 setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (void*)&val, sizeof(val)); 221 setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (void*)&val, sizeof(val));
222 } 222 }
223 223
224 #ifdef DROPBEAR_TCP_FAST_OPEN
225 void set_listen_fast_open(int sock) {
226 int qlen = MAX(MAX_UNAUTH_PER_IP, 5);
227 if (setsockopt(sock, SOL_TCP, TCP_FASTOPEN, &qlen, sizeof(qlen)) != 0) {
228 TRACE(("set_listen_fast_open failed for socket %d: %s", sock, strerror(errno)))
229 }
230 }
231
232 #endif
233
224 void set_sock_priority(int sock, enum dropbear_prio prio) { 234 void set_sock_priority(int sock, enum dropbear_prio prio) {
225 235
226 int iptos_val = 0, so_prio_val = 0, rc; 236 int iptos_val = 0, so_prio_val = 0, rc;
227 237
228 /* Don't log ENOTSOCK errors so that this can harmlessly be called 238 /* Don't log ENOTSOCK errors so that this can harmlessly be called