version 1.298, 2009/11/10 04:30:44 |
version 1.299, 2009/11/11 21:37:03 |
|
|
c->output_filter = NULL; |
c->output_filter = NULL; |
c->filter_ctx = NULL; |
c->filter_ctx = NULL; |
c->filter_cleanup = NULL; |
c->filter_cleanup = NULL; |
|
c->delayed = 1; /* prevent call to channel_post handler */ |
TAILQ_INIT(&c->status_confirms); |
TAILQ_INIT(&c->status_confirms); |
debug("channel %d: new [%s]", found, remote_name); |
debug("channel %d: new [%s]", found, remote_name); |
return c; |
return c; |
|
|
int ret; |
int ret; |
|
|
have = buffer_len(&c->input); |
have = buffer_len(&c->input); |
c->delayed = 0; |
|
debug2("channel %d: pre_dynamic: have %d", c->self, have); |
debug2("channel %d: pre_dynamic: have %d", c->self, have); |
/* buffer_dump(&c->input); */ |
/* buffer_dump(&c->input); */ |
/* check if the fixed size part of the packet is in buffer. */ |
/* check if the fixed size part of the packet is in buffer. */ |
|
|
if (c->path != NULL) |
if (c->path != NULL) |
nc->path = xstrdup(c->path); |
nc->path = xstrdup(c->path); |
|
|
if (nextstate == SSH_CHANNEL_DYNAMIC) { |
if (nextstate != SSH_CHANNEL_DYNAMIC) |
/* |
|
* do not call the channel_post handler until |
|
* this flag has been reset by a pre-handler. |
|
* otherwise the FD_ISSET calls might overflow |
|
*/ |
|
nc->delayed = 1; |
|
} else { |
|
port_open_helper(nc, rtype); |
port_open_helper(nc, rtype); |
} |
|
} |
} |
} |
} |
|
|
|
|
static void |
static void |
channel_post_open(Channel *c, fd_set *readset, fd_set *writeset) |
channel_post_open(Channel *c, fd_set *readset, fd_set *writeset) |
{ |
{ |
if (c->delayed) |
|
return; |
|
channel_handle_rfd(c, readset, writeset); |
channel_handle_rfd(c, readset, writeset); |
channel_handle_wfd(c, readset, writeset); |
channel_handle_wfd(c, readset, writeset); |
if (!compat20) |
if (!compat20) |
|
|
channel_handler(chan_fn *ftab[], fd_set *readset, fd_set *writeset) |
channel_handler(chan_fn *ftab[], fd_set *readset, fd_set *writeset) |
{ |
{ |
static int did_init = 0; |
static int did_init = 0; |
u_int i; |
u_int i, oalloc; |
Channel *c; |
Channel *c; |
|
|
if (!did_init) { |
if (!did_init) { |
channel_handler_init(); |
channel_handler_init(); |
did_init = 1; |
did_init = 1; |
} |
} |
for (i = 0; i < channels_alloc; i++) { |
for (i = 0, oalloc = channels_alloc; i < oalloc; i++) { |
c = channels[i]; |
c = channels[i]; |
if (c == NULL) |
if (c == NULL) |
continue; |
continue; |
|
if (c->delayed) { |
|
if (ftab == channel_pre) |
|
c->delayed = 0; |
|
else |
|
continue; |
|
} |
if (ftab[c->type] != NULL) |
if (ftab[c->type] != NULL) |
(*ftab[c->type])(c, readset, writeset); |
(*ftab[c->type])(c, readset, writeset); |
channel_garbage_collect(c); |
channel_garbage_collect(c); |