From 835284b74c984600aa50ebac527c37238027b4da Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Mon, 11 Jun 2007 13:03:16 +1000 Subject: - (djm) Bugzilla #1306: silence spurious error messages from hang-on-exit fix; tested by dtucker@ and jochen.kirn AT gmail.com --- channels.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'channels.c') diff --git a/channels.c b/channels.c index c68ad6419..bb14450f4 100644 --- a/channels.c +++ b/channels.c @@ -1446,14 +1446,13 @@ static int channel_handle_rfd(Channel *c, fd_set *readset, fd_set *writeset) { char buf[CHAN_RBUF]; - int len; + int len, force; - if (c->rfd != -1 && - (c->detach_close || FD_ISSET(c->rfd, readset))) { + force = c->isatty && c->detach_close && c->istate != CHAN_INPUT_CLOSED; + if (c->rfd != -1 && (force || FD_ISSET(c->rfd, readset))) { errno = 0; len = read(c->rfd, buf, sizeof(buf)); - if (len < 0 && (errno == EINTR || - (errno == EAGAIN && !(c->isatty && c->detach_close)))) + if (len < 0 && (errno == EINTR || (errno == EAGAIN && !force))) return 1; #ifndef PTY_ZEROREAD if (len <= 0) { -- cgit v1.2.3 From 3191a8e8ba454c0cc27fa8a24a9eed87cd111e4b Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Mon, 11 Jun 2007 18:33:15 +1000 Subject: - markus@cvs.openbsd.org 2007/06/11 08:04:44 [channels.c] send 'window adjust' messages every tree packets and do not wait until 50% of the window is consumed. ok djm dtucker --- ChangeLog | 6 +++++- channels.c | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'channels.c') diff --git a/ChangeLog b/ChangeLog index bb9c59899..3a7a497a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,6 +24,10 @@ [sshd_config.5] oops, here too: put the MAC list into a display, like we do for ciphers, since groff has trouble with wide lines; + - markus@cvs.openbsd.org 2007/06/11 08:04:44 + [channels.c] + send 'window adjust' messages every tree packets and do not wait + until 50% of the window is consumed. ok djm dtucker - (djm) [configure.ac umac.c] If platform doesn't provide swap32(3), then fallback to provided bit-swizzing functions - (dtucker) [openbsd-compat/bsd-misc.c] According to the spec the "remainder" @@ -3007,4 +3011,4 @@ OpenServer 6 and add osr5bigcrypt support so when someone migrates passwords between UnixWare and OpenServer they will still work. OK dtucker@ -$Id: ChangeLog,v 1.4687 2007/06/11 04:44:02 dtucker Exp $ +$Id: ChangeLog,v 1.4688 2007/06/11 08:33:15 djm Exp $ diff --git a/channels.c b/channels.c index bb14450f4..1d5b1f108 100644 --- a/channels.c +++ b/channels.c @@ -1,4 +1,4 @@ -/* $OpenBSD: channels.c,v 1.268 2007/01/03 03:01:40 stevesk Exp $ */ +/* $OpenBSD: channels.c,v 1.269 2007/06/11 08:04:44 markus Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -1657,7 +1657,9 @@ channel_check_window(Channel *c) { if (c->type == SSH_CHANNEL_OPEN && !(c->flags & (CHAN_CLOSE_SENT|CHAN_CLOSE_RCVD)) && - c->local_window < c->local_window_max/2 && + ((c->local_window_max - c->local_window < + c->local_maxpacket*3) || + c->local_window < c->local_window_max/2) && c->local_consumed > 0) { packet_start(SSH2_MSG_CHANNEL_WINDOW_ADJUST); packet_put_int(c->remote_id); -- cgit v1.2.3 From ae09cb8a7123416217e88a42c2c0ad04230d5314 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Mon, 25 Jun 2007 19:04:46 +1000 Subject: - dtucker@cvs.openbsd.org 2007/06/25 08:20:03 [channels.c] Correct test for window updates every three packets; prevents sending window updates for every single packet. ok markus@ --- ChangeLog | 6 +++++- channels.c | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'channels.c') diff --git a/ChangeLog b/ChangeLog index 07ee5e927..43d5e365b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,10 @@ [atomicio.c] if the fd passed to atomicio/atomiciov() is non blocking, then poll() to avoid a spin if it is not yet ready for reading/writing; ok dtucker@ + - dtucker@cvs.openbsd.org 2007/06/25 08:20:03 + [channels.c] + Correct test for window updates every three packets; prevents sending + window updates for every single packet. ok markus@ 20070614 - (dtucker) [cipher-ctr.c umac.c openbsd-compat/openssl-compat.h] Move the @@ -3091,4 +3095,4 @@ OpenServer 6 and add osr5bigcrypt support so when someone migrates passwords between UnixWare and OpenServer they will still work. OK dtucker@ -$Id: ChangeLog,v 1.4706 2007/06/25 09:04:12 dtucker Exp $ +$Id: ChangeLog,v 1.4707 2007/06/25 09:04:46 dtucker Exp $ diff --git a/channels.c b/channels.c index 1d5b1f108..2006353d4 100644 --- a/channels.c +++ b/channels.c @@ -1,4 +1,4 @@ -/* $OpenBSD: channels.c,v 1.269 2007/06/11 08:04:44 markus Exp $ */ +/* $OpenBSD: channels.c,v 1.270 2007/06/25 08:20:03 dtucker Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -1657,7 +1657,7 @@ channel_check_window(Channel *c) { if (c->type == SSH_CHANNEL_OPEN && !(c->flags & (CHAN_CLOSE_SENT|CHAN_CLOSE_RCVD)) && - ((c->local_window_max - c->local_window < + ((c->local_window_max - c->local_window > c->local_maxpacket*3) || c->local_window < c->local_window_max/2) && c->local_consumed > 0) { -- cgit v1.2.3