svn commit: trunk/busybox/networking
vda at busybox.net
vda at busybox.net
Sun Nov 9 00:44:40 UTC 2008
Author: vda
Date: 2008-11-08 16:44:40 -0800 (Sat, 08 Nov 2008)
New Revision: 23971
Log:
telnetd: set SO_KEEPALIVE, users report it's useful. +20 bytes.
Modified:
trunk/busybox/networking/telnetd.c
Changeset:
Modified: trunk/busybox/networking/telnetd.c
===================================================================
--- trunk/busybox/networking/telnetd.c 2008-11-09 00:15:11 UTC (rev 23970)
+++ trunk/busybox/networking/telnetd.c 2008-11-09 00:44:40 UTC (rev 23971)
@@ -182,6 +182,8 @@
ndelay_on(fd);
#if ENABLE_FEATURE_TELNETD_STANDALONE
ts->sockfd_read = sock;
+ /* SO_KEEPALIVE by popular demand */
+ setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, &const_int_1, sizeof(const_int_1));
ndelay_on(sock);
if (!sock) { /* We are called with fd 0 - we are in inetd mode */
sock++; /* so use fd 1 for output */
@@ -191,6 +193,8 @@
if (sock > maxfd)
maxfd = sock;
#else
+ /* SO_KEEPALIVE by popular demand */
+ setsockopt(0, SOL_SOCKET, SO_KEEPALIVE, &const_int_1, sizeof(const_int_1));
/* ts->sockfd_read = 0; - done by xzalloc */
ts->sockfd_write = 1;
ndelay_on(0);
More information about the busybox-cvs
mailing list