summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-09-18 05:51:13 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-09-18 05:51:13 +0000
commit944c4f0bdaa12ac3c58b77ee866758958e708329 (patch)
treefa88329431b6580c3a023670c585ae9a27ab7768 /channels.c
parent99a30f11c2e698916f3a3d8434a438085d9f298f (diff)
- markus@cvs.openbsd.org 2001/09/17 20:52:47
[channels.c channels.h clientloop.c] try to fix agent-forwarding-backconnection-bug, as seen on HPUX, for example; with Lutz.Jaenicke@aet.TU-Cottbus.DE,
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/channels.c b/channels.c
index 7bf127d91..bf11716b8 100644
--- a/channels.c
+++ b/channels.c
@@ -39,7 +39,7 @@
39 */ 39 */
40 40
41#include "includes.h" 41#include "includes.h"
42RCSID("$OpenBSD: channels.c,v 1.132 2001/07/17 21:04:56 markus Exp $"); 42RCSID("$OpenBSD: channels.c,v 1.133 2001/09/17 20:52:47 markus Exp $");
43 43
44#include "ssh.h" 44#include "ssh.h"
45#include "ssh1.h" 45#include "ssh1.h"
@@ -260,6 +260,7 @@ channel_new(char *ctype, int type, int rfd, int wfd, int efd,
260 c->cb_fn = NULL; 260 c->cb_fn = NULL;
261 c->cb_arg = NULL; 261 c->cb_arg = NULL;
262 c->cb_event = 0; 262 c->cb_event = 0;
263 c->force_drain = 0;
263 c->detach_user = NULL; 264 c->detach_user = NULL;
264 c->input_filter = NULL; 265 c->input_filter = NULL;
265 debug("channel %d: new [%s]", found, remote_name); 266 debug("channel %d: new [%s]", found, remote_name);
@@ -874,6 +875,9 @@ static void
874channel_pre_x11_open(Channel *c, fd_set * readset, fd_set * writeset) 875channel_pre_x11_open(Channel *c, fd_set * readset, fd_set * writeset)
875{ 876{
876 int ret = x11_open_helper(&c->output); 877 int ret = x11_open_helper(&c->output);
878
879 /* c->force_drain = 1; */
880
877 if (ret == 1) { 881 if (ret == 1) {
878 c->type = SSH_CHANNEL_OPEN; 882 c->type = SSH_CHANNEL_OPEN;
879 if (compat20) 883 if (compat20)
@@ -1781,6 +1785,13 @@ channel_input_ieof(int type, int plen, void *ctxt)
1781 if (c == NULL) 1785 if (c == NULL)
1782 packet_disconnect("Received ieof for nonexistent channel %d.", id); 1786 packet_disconnect("Received ieof for nonexistent channel %d.", id);
1783 chan_rcvd_ieof(c); 1787 chan_rcvd_ieof(c);
1788
1789 /* XXX force input close */
1790 if (c->force_drain) {
1791 debug("channel %d: FORCE input drain", c->self);
1792 c->istate = CHAN_INPUT_WAIT_DRAIN;
1793 }
1794
1784} 1795}
1785 1796
1786void 1797void
@@ -2669,6 +2680,7 @@ x11_input_open(int type, int plen, void *ctxt)
2669 close(sock); 2680 close(sock);
2670 } else { 2681 } else {
2671 c->remote_id = remote_id; 2682 c->remote_id = remote_id;
2683 c->force_drain = 1;
2672 } 2684 }
2673 } 2685 }
2674 if (c == NULL) { 2686 if (c == NULL) {
@@ -2931,6 +2943,7 @@ auth_input_open_request(int type, int plen, void *ctxt)
2931 close(sock); 2943 close(sock);
2932 } else { 2944 } else {
2933 c->remote_id = remote_id; 2945 c->remote_id = remote_id;
2946 c->force_drain = 1;
2934 } 2947 }
2935 } 2948 }
2936 if (c == NULL) { 2949 if (c == NULL) {