[channels.c nchan.c]
     replace buffer_consume(b, buffer_len(b)) with buffer_clear(b); ok provos@
This commit is contained in:
Damien Miller 2002-01-22 23:21:15 +11:00
parent de6987c2b9
commit 76765c0b1a
3 changed files with 13 additions and 9 deletions

View File

@ -106,6 +106,10 @@
- markus@cvs.openbsd.org 2002/01/09 17:16:00
[channels.c]
merge channel_pre_open_15/channel_pre_open_20; ok provos@
- markus@cvs.openbsd.org 2002/01/09 17:26:35
[channels.c nchan.c]
replace buffer_consume(b, buffer_len(b)) with buffer_clear(b);
ok provos@
20020121
@ -7254,4 +7258,4 @@
- Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1
$Id: ChangeLog,v 1.1753 2002/01/22 12:20:40 djm Exp $
$Id: ChangeLog,v 1.1754 2002/01/22 12:21:15 djm Exp $

View File

@ -39,7 +39,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: channels.c,v 1.157 2002/01/09 17:16:00 markus Exp $");
RCSID("$OpenBSD: channels.c,v 1.158 2002/01/09 17:26:35 markus Exp $");
#include "ssh.h"
#include "ssh1.h"
@ -1270,7 +1270,7 @@ channel_handle_rfd(Channel *c, fd_set * readset, fd_set * writeset)
chan_mark_dead(c);
return -1;
} else if (compat13) {
buffer_consume(&c->output, buffer_len(&c->output));
buffer_clear(&c->output);
c->type = SSH_CHANNEL_INPUT_DRAINING;
debug("channel %d: input draining.", c->self);
} else {
@ -1312,7 +1312,7 @@ channel_handle_wfd(Channel *c, fd_set * readset, fd_set * writeset)
chan_mark_dead(c);
return -1;
} else if (compat13) {
buffer_consume(&c->output, buffer_len(&c->output));
buffer_clear(&c->output);
debug("channel %d: input draining.", c->self);
c->type = SSH_CHANNEL_INPUT_DRAINING;
} else {
@ -1425,7 +1425,7 @@ channel_post_output_drain_13(Channel *c, fd_set * readset, fd_set * writeset)
len = write(c->sock, buffer_ptr(&c->output),
buffer_len(&c->output));
if (len <= 0)
buffer_consume(&c->output, buffer_len(&c->output));
buffer_clear(&c->output);
else
buffer_consume(&c->output, len);
}
@ -1828,7 +1828,7 @@ channel_input_close(int type, u_int32_t seq, void *ctxt)
* Not a closed channel - mark it as draining, which will
* cause it to be freed later.
*/
buffer_consume(&c->input, buffer_len(&c->input));
buffer_clear(&c->input);
c->type = SSH_CHANNEL_OUTPUT_DRAINING;
}
}

View File

@ -23,7 +23,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: nchan.c,v 1.33 2001/12/19 07:18:56 deraadt Exp $");
RCSID("$OpenBSD: nchan.c,v 1.34 2002/01/09 17:26:35 markus Exp $");
#include "ssh1.h"
#include "ssh2.h"
@ -266,7 +266,7 @@ chan_send_oclose1(Channel *c)
case CHAN_OUTPUT_OPEN:
case CHAN_OUTPUT_WAIT_DRAIN:
chan_shutdown_write(c);
buffer_consume(&c->output, buffer_len(&c->output));
buffer_clear(&c->output);
packet_start(SSH_MSG_CHANNEL_OUTPUT_CLOSE);
packet_put_int(c->remote_id);
packet_send();
@ -516,7 +516,7 @@ chan_init(void)
static void
chan_shutdown_write(Channel *c)
{
buffer_consume(&c->output, buffer_len(&c->output));
buffer_clear(&c->output);
if (compat20 && c->type == SSH_CHANNEL_LARVAL)
return;
/* shutdown failure is allowed if write failed already */