diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | channels.c | 7 | ||||
-rw-r--r-- | nchan.c | 4 |
3 files changed, 9 insertions, 7 deletions
@@ -13,6 +13,9 @@ | |||
13 | [clientloop.c] | 13 | [clientloop.c] |
14 | check for open sessions before we call select(); fixes the x11 client | 14 | check for open sessions before we call select(); fixes the x11 client |
15 | bug reported by bowman@math.ualberta.ca | 15 | bug reported by bowman@math.ualberta.ca |
16 | - markus@cvs.openbsd.org 2001/05/16 22:09:21 | ||
17 | [channels.c nchan.c] | ||
18 | more select() error fixes (don't set rfd/wfd to -1). | ||
16 | 19 | ||
17 | 20010512 | 20 | 20010512 |
18 | - OpenBSD CVS Sync | 21 | - OpenBSD CVS Sync |
@@ -5418,4 +5421,4 @@ | |||
5418 | - Wrote replacements for strlcpy and mkdtemp | 5421 | - Wrote replacements for strlcpy and mkdtemp |
5419 | - Released 1.0pre1 | 5422 | - Released 1.0pre1 |
5420 | 5423 | ||
5421 | $Id: ChangeLog,v 1.1222 2001/05/17 03:19:40 mouring Exp $ | 5424 | $Id: ChangeLog,v 1.1223 2001/05/17 03:21:27 mouring Exp $ |
diff --git a/channels.c b/channels.c index 9397d48e5..55cef42c2 100644 --- a/channels.c +++ b/channels.c | |||
@@ -40,7 +40,7 @@ | |||
40 | */ | 40 | */ |
41 | 41 | ||
42 | #include "includes.h" | 42 | #include "includes.h" |
43 | RCSID("$OpenBSD: channels.c,v 1.115 2001/05/09 22:51:57 markus Exp $"); | 43 | RCSID("$OpenBSD: channels.c,v 1.116 2001/05/16 22:09:20 markus Exp $"); |
44 | 44 | ||
45 | #include <openssl/rsa.h> | 45 | #include <openssl/rsa.h> |
46 | #include <openssl/dsa.h> | 46 | #include <openssl/dsa.h> |
@@ -893,7 +893,7 @@ channel_handle_rfd(Channel *c, fd_set * readset, fd_set * writeset) | |||
893 | char buf[16*1024]; | 893 | char buf[16*1024]; |
894 | int len; | 894 | int len; |
895 | 895 | ||
896 | if (c->rfd != -1 && | 896 | if (c->istate == CHAN_INPUT_OPEN && |
897 | FD_ISSET(c->rfd, readset)) { | 897 | FD_ISSET(c->rfd, readset)) { |
898 | len = read(c->rfd, buf, sizeof(buf)); | 898 | len = read(c->rfd, buf, sizeof(buf)); |
899 | if (len < 0 && (errno == EINTR || errno == EAGAIN)) | 899 | if (len < 0 && (errno == EINTR || errno == EAGAIN)) |
@@ -932,7 +932,8 @@ channel_handle_wfd(Channel *c, fd_set * readset, fd_set * writeset) | |||
932 | int len; | 932 | int len; |
933 | 933 | ||
934 | /* Send buffered output data to the socket. */ | 934 | /* Send buffered output data to the socket. */ |
935 | if (c->wfd != -1 && | 935 | if ((c->ostate == CHAN_OUTPUT_OPEN || |
936 | c->ostate == CHAN_OUTPUT_WAIT_DRAIN) && | ||
936 | FD_ISSET(c->wfd, writeset) && | 937 | FD_ISSET(c->wfd, writeset) && |
937 | buffer_len(&c->output) > 0) { | 938 | buffer_len(&c->output) > 0) { |
938 | len = write(c->wfd, buffer_ptr(&c->output), | 939 | len = write(c->wfd, buffer_ptr(&c->output), |
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | RCSID("$OpenBSD: nchan.c,v 1.24 2001/05/04 23:47:34 markus Exp $"); | 26 | RCSID("$OpenBSD: nchan.c,v 1.25 2001/05/16 22:09:21 markus Exp $"); |
27 | 27 | ||
28 | #include "ssh1.h" | 28 | #include "ssh1.h" |
29 | #include "ssh2.h" | 29 | #include "ssh2.h" |
@@ -484,7 +484,6 @@ chan_shutdown_write(Channel *c) | |||
484 | if (close(c->wfd) < 0) | 484 | if (close(c->wfd) < 0) |
485 | log("channel %d: chan_shutdown_write: close() failed for fd%d: %.100s", | 485 | log("channel %d: chan_shutdown_write: close() failed for fd%d: %.100s", |
486 | c->self, c->wfd, strerror(errno)); | 486 | c->self, c->wfd, strerror(errno)); |
487 | c->wfd = -1; | ||
488 | } | 487 | } |
489 | } | 488 | } |
490 | static void | 489 | static void |
@@ -507,6 +506,5 @@ chan_shutdown_read(Channel *c) | |||
507 | if (close(c->rfd) < 0) | 506 | if (close(c->rfd) < 0) |
508 | log("channel %d: chan_shutdown_read: close() failed for fd%d: %.100s", | 507 | log("channel %d: chan_shutdown_read: close() failed for fd%d: %.100s", |
509 | c->self, c->rfd, strerror(errno)); | 508 | c->self, c->rfd, strerror(errno)); |
510 | c->rfd = -1; | ||
511 | } | 509 | } |
512 | } | 510 | } |