diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | serverloop.c | 18 |
2 files changed, 19 insertions, 10 deletions
@@ -1,5 +1,14 @@ | |||
1 | 20010407 | 1 | 20010407 |
2 | - (bal) CVS ID Resync of version.h | 2 | - (bal) CVS ID Resync of version.h |
3 | - OpenBSD CVS Sync | ||
4 | - markus@cvs.openbsd.org 2001/04/05 23:39:20 | ||
5 | [serverloop.c] | ||
6 | keep the ssh session even if there is no active channel. | ||
7 | this is more in line with the protocol spec and makes | ||
8 | ssh -N -L 1234:server:110 host | ||
9 | more useful. | ||
10 | based on discussion with <mats@mindbright.se> long time ago | ||
11 | and recent mail from <res@shore.net> | ||
3 | 12 | ||
4 | 20010406 | 13 | 20010406 |
5 | - (stevesk) logintest.c: fix for systems without __progname | 14 | - (stevesk) logintest.c: fix for systems without __progname |
@@ -4911,4 +4920,4 @@ | |||
4911 | - Wrote replacements for strlcpy and mkdtemp | 4920 | - Wrote replacements for strlcpy and mkdtemp |
4912 | - Released 1.0pre1 | 4921 | - Released 1.0pre1 |
4913 | 4922 | ||
4914 | $Id: ChangeLog,v 1.1075 2001/04/07 01:08:46 mouring Exp $ | 4923 | $Id: ChangeLog,v 1.1076 2001/04/07 01:12:11 mouring Exp $ |
diff --git a/serverloop.c b/serverloop.c index cd9368d07..d6b360d9a 100644 --- a/serverloop.c +++ b/serverloop.c | |||
@@ -35,7 +35,7 @@ | |||
35 | */ | 35 | */ |
36 | 36 | ||
37 | #include "includes.h" | 37 | #include "includes.h" |
38 | RCSID("$OpenBSD: serverloop.c,v 1.59 2001/04/05 10:42:51 markus Exp $"); | 38 | RCSID("$OpenBSD: serverloop.c,v 1.60 2001/04/05 23:39:20 markus Exp $"); |
39 | 39 | ||
40 | #include "xmalloc.h" | 40 | #include "xmalloc.h" |
41 | #include "packet.h" | 41 | #include "packet.h" |
@@ -77,7 +77,8 @@ static int fderr_eof = 0; /* EOF encountered readung from fderr. */ | |||
77 | static int fdin_is_tty = 0; /* fdin points to a tty. */ | 77 | static int fdin_is_tty = 0; /* fdin points to a tty. */ |
78 | static int connection_in; /* Connection to client (input). */ | 78 | static int connection_in; /* Connection to client (input). */ |
79 | static int connection_out; /* Connection to client (output). */ | 79 | static int connection_out; /* Connection to client (output). */ |
80 | static u_int buffer_high;/* "Soft" max buffer size. */ | 80 | static int connection_closed = 0; /* Connection to client closed. */ |
81 | static u_int buffer_high; /* "Soft" max buffer size. */ | ||
81 | 82 | ||
82 | /* | 83 | /* |
83 | * This SIGCHLD kludge is used to detect when the child exits. The server | 84 | * This SIGCHLD kludge is used to detect when the child exits. The server |
@@ -277,6 +278,9 @@ process_input(fd_set * readset) | |||
277 | len = read(connection_in, buf, sizeof(buf)); | 278 | len = read(connection_in, buf, sizeof(buf)); |
278 | if (len == 0) { | 279 | if (len == 0) { |
279 | verbose("Connection closed by remote host."); | 280 | verbose("Connection closed by remote host."); |
281 | connection_closed = 1; | ||
282 | if (compat20) | ||
283 | return; | ||
280 | fatal_cleanup(); | 284 | fatal_cleanup(); |
281 | } else if (len < 0) { | 285 | } else if (len < 0) { |
282 | if (errno != EINTR && errno != EAGAIN) { | 286 | if (errno != EINTR && errno != EAGAIN) { |
@@ -650,7 +654,7 @@ void | |||
650 | server_loop2(void) | 654 | server_loop2(void) |
651 | { | 655 | { |
652 | fd_set *readset = NULL, *writeset = NULL; | 656 | fd_set *readset = NULL, *writeset = NULL; |
653 | int had_channel = 0, rekeying = 0, max_fd, status; | 657 | int rekeying = 0, max_fd, status; |
654 | pid_t pid; | 658 | pid_t pid; |
655 | 659 | ||
656 | debug("Entering interactive session for SSH2."); | 660 | debug("Entering interactive session for SSH2."); |
@@ -669,12 +673,6 @@ server_loop2(void) | |||
669 | 673 | ||
670 | rekeying = (xxx_kex != NULL && !xxx_kex->done); | 674 | rekeying = (xxx_kex != NULL && !xxx_kex->done); |
671 | 675 | ||
672 | if (!had_channel && channel_still_open()) | ||
673 | had_channel = 1; | ||
674 | if (had_channel && !channel_still_open()) { | ||
675 | debug("!channel_still_open."); | ||
676 | break; | ||
677 | } | ||
678 | if (!rekeying && packet_not_very_much_data_to_write()) | 676 | if (!rekeying && packet_not_very_much_data_to_write()) |
679 | channel_output_poll(); | 677 | channel_output_poll(); |
680 | wait_until_can_do_something(&readset, &writeset, &max_fd, | 678 | wait_until_can_do_something(&readset, &writeset, &max_fd, |
@@ -687,6 +685,8 @@ server_loop2(void) | |||
687 | if (!rekeying) | 685 | if (!rekeying) |
688 | channel_after_select(readset, writeset); | 686 | channel_after_select(readset, writeset); |
689 | process_input(readset); | 687 | process_input(readset); |
688 | if (connection_closed) | ||
689 | break; | ||
690 | process_output(writeset); | 690 | process_output(writeset); |
691 | } | 691 | } |
692 | if (readset) | 692 | if (readset) |