summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/channels.c b/channels.c
index 568779dff..e5f910ed7 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.164 2002/02/03 17:55:55 markus Exp $"); 42RCSID("$OpenBSD: channels.c,v 1.165 2002/02/03 17:58:21 markus Exp $");
43 43
44#include "ssh.h" 44#include "ssh.h"
45#include "ssh1.h" 45#include "ssh1.h"
@@ -260,12 +260,10 @@ channel_new(char *ctype, int type, int rfd, int wfd, int efd,
260 c->remote_name = remote_name; 260 c->remote_name = remote_name;
261 c->remote_window = 0; 261 c->remote_window = 0;
262 c->remote_maxpacket = 0; 262 c->remote_maxpacket = 0;
263 c->cb_fn = NULL;
264 c->cb_arg = NULL;
265 c->cb_event = 0;
266 c->force_drain = 0; 263 c->force_drain = 0;
267 c->single_connection = 0; 264 c->single_connection = 0;
268 c->detach_user = NULL; 265 c->detach_user = NULL;
266 c->confirm = NULL;
269 c->input_filter = NULL; 267 c->input_filter = NULL;
270 debug("channel %d: new [%s]", found, remote_name); 268 debug("channel %d: new [%s]", found, remote_name);
271 return c; 269 return c;
@@ -610,16 +608,14 @@ channel_request_start(int id, char *service, int wantconfirm)
610 packet_put_char(wantconfirm); 608 packet_put_char(wantconfirm);
611} 609}
612void 610void
613channel_register_callback(int id, int mtype, channel_callback_fn *fn, void *arg) 611channel_register_confirm(int id, channel_callback_fn *fn)
614{ 612{
615 Channel *c = channel_lookup(id); 613 Channel *c = channel_lookup(id);
616 if (c == NULL) { 614 if (c == NULL) {
617 log("channel_register_callback: %d: bad id", id); 615 log("channel_register_comfirm: %d: bad id", id);
618 return; 616 return;
619 } 617 }
620 c->cb_event = mtype; 618 c->confirm = fn;
621 c->cb_fn = fn;
622 c->cb_arg = arg;
623} 619}
624void 620void
625channel_register_cleanup(int id, channel_callback_fn *fn) 621channel_register_cleanup(int id, channel_callback_fn *fn)
@@ -1882,9 +1878,9 @@ channel_input_open_confirmation(int type, u_int32_t seq, void *ctxt)
1882 if (compat20) { 1878 if (compat20) {
1883 c->remote_window = packet_get_int(); 1879 c->remote_window = packet_get_int();
1884 c->remote_maxpacket = packet_get_int(); 1880 c->remote_maxpacket = packet_get_int();
1885 if (c->cb_fn != NULL && c->cb_event == type) { 1881 if (c->confirm) {
1886 debug2("callback start"); 1882 debug2("callback start");
1887 c->cb_fn(c->self, c->cb_arg); 1883 c->confirm(c->self, NULL);
1888 debug2("callback done"); 1884 debug2("callback done");
1889 } 1885 }
1890 debug("channel %d: open confirm rwindow %d rmax %d", c->self, 1886 debug("channel %d: open confirm rwindow %d rmax %d", c->self,