summaryrefslogtreecommitdiff
path: root/ssh.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2010-05-21 14:57:10 +1000
committerDamien Miller <djm@mindrot.org>2010-05-21 14:57:10 +1000
commitd530f5f471491b6be9edb58a063f2590e4dce48d (patch)
treee536e2b4031a4dd70026ff49c39b02b72af06f30 /ssh.c
parentc6afb5f2c095a6a4380cc13a6480abb7614d949f (diff)
- djm@cvs.openbsd.org 2010/05/14 23:29:23
[channels.c channels.h mux.c ssh.c] Pause the mux channel while waiting for reply from aynch callbacks. Prevents misordering of replies if new requests arrive while waiting. Extend channel open confirm callback to allow signalling failure conditions as well as success. Use this to 1) fix a memory leak, 2) start using the above pause mechanism and 3) delay sending a success/ failure message on mux slave session open until we receive a reply from the server. motivated by and with feedback from markus@
Diffstat (limited to 'ssh.c')
-rw-r--r--ssh.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ssh.c b/ssh.c
index 2230edd16..ee224e9ff 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh.c,v 1.336 2010/04/10 00:00:16 djm Exp $ */ 1/* $OpenBSD: ssh.c,v 1.337 2010/05/14 23:29:23 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1175,12 +1175,15 @@ ssh_session(void)
1175 1175
1176/* request pty/x11/agent/tcpfwd/shell for channel */ 1176/* request pty/x11/agent/tcpfwd/shell for channel */
1177static void 1177static void
1178ssh_session2_setup(int id, void *arg) 1178ssh_session2_setup(int id, int success, void *arg)
1179{ 1179{
1180 extern char **environ; 1180 extern char **environ;
1181 const char *display; 1181 const char *display;
1182 int interactive = tty_flag; 1182 int interactive = tty_flag;
1183 1183
1184 if (!success)
1185 return; /* No need for error message, channels code sens one */
1186
1184 display = getenv("DISPLAY"); 1187 display = getenv("DISPLAY");
1185 if (options.forward_x11 && display != NULL) { 1188 if (options.forward_x11 && display != NULL) {
1186 char *proto, *data; 1189 char *proto, *data;