summaryrefslogtreecommitdiff
path: root/serverloop.c
diff options
context:
space:
mode:
Diffstat (limited to 'serverloop.c')
-rw-r--r--serverloop.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/serverloop.c b/serverloop.c
index 81cafe6ad..8be01c5c3 100644
--- a/serverloop.c
+++ b/serverloop.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: serverloop.c,v 1.157 2009/02/12 03:16:01 djm Exp $ */ 1/* $OpenBSD: serverloop.c,v 1.159 2009/05/28 16:50:16 andreas Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -78,6 +78,7 @@
78#include "auth-options.h" 78#include "auth-options.h"
79#include "serverloop.h" 79#include "serverloop.h"
80#include "misc.h" 80#include "misc.h"
81#include "roaming.h"
81 82
82extern ServerOptions options; 83extern ServerOptions options;
83 84
@@ -249,7 +250,7 @@ client_alive_check(void)
249 int channel_id; 250 int channel_id;
250 251
251 /* timeout, check to see how many we have had */ 252 /* timeout, check to see how many we have had */
252 if (++keep_alive_timeouts > options.client_alive_count_max) { 253 if (packet_inc_alive_timeouts() > options.client_alive_count_max) {
253 logit("Timeout, client not responding."); 254 logit("Timeout, client not responding.");
254 cleanup_exit(255); 255 cleanup_exit(255);
255 } 256 }
@@ -391,8 +392,11 @@ process_input(fd_set *readset)
391 392
392 /* Read and buffer any input data from the client. */ 393 /* Read and buffer any input data from the client. */
393 if (FD_ISSET(connection_in, readset)) { 394 if (FD_ISSET(connection_in, readset)) {
394 len = read(connection_in, buf, sizeof(buf)); 395 int cont = 0;
396 len = roaming_read(connection_in, buf, sizeof(buf), &cont);
395 if (len == 0) { 397 if (len == 0) {
398 if (cont)
399 return;
396 verbose("Connection closed by %.100s", 400 verbose("Connection closed by %.100s",
397 get_remote_ipaddr()); 401 get_remote_ipaddr());
398 connection_closed = 1; 402 connection_closed = 1;
@@ -890,7 +894,7 @@ server_input_keep_alive(int type, u_int32_t seq, void *ctxt)
890 * even if this was generated by something other than 894 * even if this was generated by something other than
891 * the bogus CHANNEL_REQUEST we send for keepalives. 895 * the bogus CHANNEL_REQUEST we send for keepalives.
892 */ 896 */
893 keep_alive_timeouts = 0; 897 packet_set_alive_timeouts(0);
894} 898}
895 899
896static void 900static void
@@ -1120,7 +1124,8 @@ server_input_global_request(int type, u_int32_t seq, void *ctxt)
1120 no_port_forwarding_flag || 1124 no_port_forwarding_flag ||
1121 (!want_reply && listen_port == 0) 1125 (!want_reply && listen_port == 0)
1122#ifndef NO_IPPORT_RESERVED_CONCEPT 1126#ifndef NO_IPPORT_RESERVED_CONCEPT
1123 || (listen_port < IPPORT_RESERVED && pw->pw_uid != 0) 1127 || (listen_port != 0 && listen_port < IPPORT_RESERVED &&
1128 pw->pw_uid != 0)
1124#endif 1129#endif
1125 ) { 1130 ) {
1126 success = 0; 1131 success = 0;