version 1.213, 2005/03/10 22:01:05 |
version 1.214, 2005/03/14 11:46:56 |
|
|
|
|
/* -- channel core */ |
/* -- channel core */ |
|
|
|
#define CHAN_RBUF 16*1024 |
|
|
/* |
/* |
* Pointer to an array containing all allocated channels. The array is |
* Pointer to an array containing all allocated channels. The array is |
* dynamically extended as needed. |
* dynamically extended as needed. |
|
|
{ |
{ |
u_int limit = compat20 ? c->remote_window : packet_get_maxsize(); |
u_int limit = compat20 ? c->remote_window : packet_get_maxsize(); |
|
|
|
/* check buffer limits */ |
|
limit = MIN(limit, (BUFFER_MAX_LEN - BUFFER_MAX_CHUNK - CHAN_RBUF)); |
|
|
if (c->istate == CHAN_INPUT_OPEN && |
if (c->istate == CHAN_INPUT_OPEN && |
limit > 0 && |
limit > 0 && |
buffer_len(&c->input) < limit) |
buffer_len(&c->input) < limit) |
|
|
static int |
static int |
channel_handle_rfd(Channel *c, fd_set * readset, fd_set * writeset) |
channel_handle_rfd(Channel *c, fd_set * readset, fd_set * writeset) |
{ |
{ |
char buf[16*1024]; |
char buf[CHAN_RBUF]; |
int len; |
int len; |
|
|
if (c->rfd != -1 && |
if (c->rfd != -1 && |
|
|
static int |
static int |
channel_handle_efd(Channel *c, fd_set * readset, fd_set * writeset) |
channel_handle_efd(Channel *c, fd_set * readset, fd_set * writeset) |
{ |
{ |
char buf[16*1024]; |
char buf[CHAN_RBUF]; |
int len; |
int len; |
|
|
/** XXX handle drain efd, too */ |
/** XXX handle drain efd, too */ |