- markus@cvs.openbsd.org 2001/05/16 22:09:21
[channels.c nchan.c] more select() error fixes (don't set rfd/wfd to -1).
This commit is contained in:
parent
c8b3f47676
commit
b6147ab9e9
|
@ -13,6 +13,9 @@
|
|||
[clientloop.c]
|
||||
check for open sessions before we call select(); fixes the x11 client
|
||||
bug reported by bowman@math.ualberta.ca
|
||||
- markus@cvs.openbsd.org 2001/05/16 22:09:21
|
||||
[channels.c nchan.c]
|
||||
more select() error fixes (don't set rfd/wfd to -1).
|
||||
|
||||
20010512
|
||||
- OpenBSD CVS Sync
|
||||
|
@ -5418,4 +5421,4 @@
|
|||
- Wrote replacements for strlcpy and mkdtemp
|
||||
- Released 1.0pre1
|
||||
|
||||
$Id: ChangeLog,v 1.1222 2001/05/17 03:19:40 mouring Exp $
|
||||
$Id: ChangeLog,v 1.1223 2001/05/17 03:21:27 mouring Exp $
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
*/
|
||||
|
||||
#include "includes.h"
|
||||
RCSID("$OpenBSD: channels.c,v 1.115 2001/05/09 22:51:57 markus Exp $");
|
||||
RCSID("$OpenBSD: channels.c,v 1.116 2001/05/16 22:09:20 markus Exp $");
|
||||
|
||||
#include <openssl/rsa.h>
|
||||
#include <openssl/dsa.h>
|
||||
|
@ -893,7 +893,7 @@ channel_handle_rfd(Channel *c, fd_set * readset, fd_set * writeset)
|
|||
char buf[16*1024];
|
||||
int len;
|
||||
|
||||
if (c->rfd != -1 &&
|
||||
if (c->istate == CHAN_INPUT_OPEN &&
|
||||
FD_ISSET(c->rfd, readset)) {
|
||||
len = read(c->rfd, buf, sizeof(buf));
|
||||
if (len < 0 && (errno == EINTR || errno == EAGAIN))
|
||||
|
@ -932,7 +932,8 @@ channel_handle_wfd(Channel *c, fd_set * readset, fd_set * writeset)
|
|||
int len;
|
||||
|
||||
/* Send buffered output data to the socket. */
|
||||
if (c->wfd != -1 &&
|
||||
if ((c->ostate == CHAN_OUTPUT_OPEN ||
|
||||
c->ostate == CHAN_OUTPUT_WAIT_DRAIN) &&
|
||||
FD_ISSET(c->wfd, writeset) &&
|
||||
buffer_len(&c->output) > 0) {
|
||||
len = write(c->wfd, buffer_ptr(&c->output),
|
||||
|
|
4
nchan.c
4
nchan.c
|
@ -23,7 +23,7 @@
|
|||
*/
|
||||
|
||||
#include "includes.h"
|
||||
RCSID("$OpenBSD: nchan.c,v 1.24 2001/05/04 23:47:34 markus Exp $");
|
||||
RCSID("$OpenBSD: nchan.c,v 1.25 2001/05/16 22:09:21 markus Exp $");
|
||||
|
||||
#include "ssh1.h"
|
||||
#include "ssh2.h"
|
||||
|
@ -484,7 +484,6 @@ chan_shutdown_write(Channel *c)
|
|||
if (close(c->wfd) < 0)
|
||||
log("channel %d: chan_shutdown_write: close() failed for fd%d: %.100s",
|
||||
c->self, c->wfd, strerror(errno));
|
||||
c->wfd = -1;
|
||||
}
|
||||
}
|
||||
static void
|
||||
|
@ -507,6 +506,5 @@ chan_shutdown_read(Channel *c)
|
|||
if (close(c->rfd) < 0)
|
||||
log("channel %d: chan_shutdown_read: close() failed for fd%d: %.100s",
|
||||
c->self, c->rfd, strerror(errno));
|
||||
c->rfd = -1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue