From e6a9ce5c55e7ec72dc4636135b5c6f9f49cafdda Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Fri, 20 Mar 2015 23:36:42 +0800 Subject: Make main socket nonblocking. Limit writequeue size. --- common-channel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common-channel.c') diff --git a/common-channel.c b/common-channel.c index a2ed283..0e5c0f1 100644 --- a/common-channel.c +++ b/common-channel.c @@ -531,7 +531,7 @@ static void writechannel(struct Channel* channel, int fd, circbuffer *cbuf, /* Set the file descriptors for the main select in session.c * This avoid channels which don't have any window available, are closed, etc*/ -void setchannelfds(fd_set *readfds, fd_set *writefds) { +void setchannelfds(fd_set *readfds, fd_set *writefds, int allow_reads) { unsigned int i; struct Channel * channel; @@ -549,7 +549,7 @@ void setchannelfds(fd_set *readfds, fd_set *writefds) { FD if there's the possibility of "~."" to kill an interactive session (the read_mangler) */ if (channel->transwindow > 0 - && (ses.dataallowed || channel->read_mangler)) { + && ((ses.dataallowed && allow_reads) || channel->read_mangler)) { if (channel->readfd >= 0) { FD_SET(channel->readfd, readfds); -- cgit v1.2.1