version 1.157, 2002/01/09 17:16:00 |
version 1.158, 2002/01/09 17:26:35 |
|
|
chan_mark_dead(c); |
chan_mark_dead(c); |
return -1; |
return -1; |
} else if (compat13) { |
} else if (compat13) { |
buffer_consume(&c->output, buffer_len(&c->output)); |
buffer_clear(&c->output); |
c->type = SSH_CHANNEL_INPUT_DRAINING; |
c->type = SSH_CHANNEL_INPUT_DRAINING; |
debug("channel %d: input draining.", c->self); |
debug("channel %d: input draining.", c->self); |
} else { |
} else { |
|
|
chan_mark_dead(c); |
chan_mark_dead(c); |
return -1; |
return -1; |
} else if (compat13) { |
} else if (compat13) { |
buffer_consume(&c->output, buffer_len(&c->output)); |
buffer_clear(&c->output); |
debug("channel %d: input draining.", c->self); |
debug("channel %d: input draining.", c->self); |
c->type = SSH_CHANNEL_INPUT_DRAINING; |
c->type = SSH_CHANNEL_INPUT_DRAINING; |
} else { |
} else { |
|
|
len = write(c->sock, buffer_ptr(&c->output), |
len = write(c->sock, buffer_ptr(&c->output), |
buffer_len(&c->output)); |
buffer_len(&c->output)); |
if (len <= 0) |
if (len <= 0) |
buffer_consume(&c->output, buffer_len(&c->output)); |
buffer_clear(&c->output); |
else |
else |
buffer_consume(&c->output, len); |
buffer_consume(&c->output, len); |
} |
} |
|
|
* Not a closed channel - mark it as draining, which will |
* Not a closed channel - mark it as draining, which will |
* cause it to be freed later. |
* cause it to be freed later. |
*/ |
*/ |
buffer_consume(&c->input, buffer_len(&c->input)); |
buffer_clear(&c->input); |
c->type = SSH_CHANNEL_OUTPUT_DRAINING; |
c->type = SSH_CHANNEL_OUTPUT_DRAINING; |
} |
} |
} |
} |