version 1.164, 2002/02/03 17:55:55 |
version 1.165, 2002/02/03 17:58:21 |
|
|
c->remote_name = remote_name; |
c->remote_name = remote_name; |
c->remote_window = 0; |
c->remote_window = 0; |
c->remote_maxpacket = 0; |
c->remote_maxpacket = 0; |
c->cb_fn = NULL; |
|
c->cb_arg = NULL; |
|
c->cb_event = 0; |
|
c->force_drain = 0; |
c->force_drain = 0; |
c->single_connection = 0; |
c->single_connection = 0; |
c->detach_user = NULL; |
c->detach_user = NULL; |
|
c->confirm = NULL; |
c->input_filter = NULL; |
c->input_filter = NULL; |
debug("channel %d: new [%s]", found, remote_name); |
debug("channel %d: new [%s]", found, remote_name); |
return c; |
return c; |
|
|
packet_put_char(wantconfirm); |
packet_put_char(wantconfirm); |
} |
} |
void |
void |
channel_register_callback(int id, int mtype, channel_callback_fn *fn, void *arg) |
channel_register_confirm(int id, channel_callback_fn *fn) |
{ |
{ |
Channel *c = channel_lookup(id); |
Channel *c = channel_lookup(id); |
if (c == NULL) { |
if (c == NULL) { |
log("channel_register_callback: %d: bad id", id); |
log("channel_register_comfirm: %d: bad id", id); |
return; |
return; |
} |
} |
c->cb_event = mtype; |
c->confirm = fn; |
c->cb_fn = fn; |
|
c->cb_arg = arg; |
|
} |
} |
void |
void |
channel_register_cleanup(int id, channel_callback_fn *fn) |
channel_register_cleanup(int id, channel_callback_fn *fn) |
|
|
if (compat20) { |
if (compat20) { |
c->remote_window = packet_get_int(); |
c->remote_window = packet_get_int(); |
c->remote_maxpacket = packet_get_int(); |
c->remote_maxpacket = packet_get_int(); |
if (c->cb_fn != NULL && c->cb_event == type) { |
if (c->confirm) { |
debug2("callback start"); |
debug2("callback start"); |
c->cb_fn(c->self, c->cb_arg); |
c->confirm(c->self, NULL); |
debug2("callback done"); |
debug2("callback done"); |
} |
} |
debug("channel %d: open confirm rwindow %d rmax %d", c->self, |
debug("channel %d: open confirm rwindow %d rmax %d", c->self, |