diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-11-09 00:44:40 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-11-09 00:44:40 +0000 |
commit | 6d0443557c96dc130d96931007b4d82a2d97bafc (patch) | |
tree | 43f16248b9c1770cf012538b60f987d0aef52df3 /networking/telnetd.c | |
parent | 3fa36e235021af5810333a52876d29efc661ad60 (diff) | |
download | busybox-w32-6d0443557c96dc130d96931007b4d82a2d97bafc.tar.gz busybox-w32-6d0443557c96dc130d96931007b4d82a2d97bafc.tar.bz2 busybox-w32-6d0443557c96dc130d96931007b4d82a2d97bafc.zip |
telnetd: set SO_KEEPALIVE, users report it's useful. +20 bytes.
Diffstat (limited to 'networking/telnetd.c')
-rw-r--r-- | networking/telnetd.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/networking/telnetd.c b/networking/telnetd.c index f60c42056..46dfb318f 100644 --- a/networking/telnetd.c +++ b/networking/telnetd.c | |||
@@ -182,6 +182,8 @@ make_new_session( | |||
182 | ndelay_on(fd); | 182 | ndelay_on(fd); |
183 | #if ENABLE_FEATURE_TELNETD_STANDALONE | 183 | #if ENABLE_FEATURE_TELNETD_STANDALONE |
184 | ts->sockfd_read = sock; | 184 | ts->sockfd_read = sock; |
185 | /* SO_KEEPALIVE by popular demand */ | ||
186 | setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, &const_int_1, sizeof(const_int_1)); | ||
185 | ndelay_on(sock); | 187 | ndelay_on(sock); |
186 | if (!sock) { /* We are called with fd 0 - we are in inetd mode */ | 188 | if (!sock) { /* We are called with fd 0 - we are in inetd mode */ |
187 | sock++; /* so use fd 1 for output */ | 189 | sock++; /* so use fd 1 for output */ |
@@ -191,6 +193,8 @@ make_new_session( | |||
191 | if (sock > maxfd) | 193 | if (sock > maxfd) |
192 | maxfd = sock; | 194 | maxfd = sock; |
193 | #else | 195 | #else |
196 | /* SO_KEEPALIVE by popular demand */ | ||
197 | setsockopt(0, SOL_SOCKET, SO_KEEPALIVE, &const_int_1, sizeof(const_int_1)); | ||
194 | /* ts->sockfd_read = 0; - done by xzalloc */ | 198 | /* ts->sockfd_read = 0; - done by xzalloc */ |
195 | ts->sockfd_write = 1; | 199 | ts->sockfd_write = 1; |
196 | ndelay_on(0); | 200 | ndelay_on(0); |