summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2002-01-22 23:21:15 +1100
committerDamien Miller <djm@mindrot.org>2002-01-22 23:21:15 +1100
commit76765c0b1ad147f747f088a37ae120413108356f (patch)
tree35897ba3509aaa4d5a5dba5044a1c192ca4671f5
parentde6987c2b935871fd93d502d8a36a6e734667824 (diff)
downloadopenssh-git-76765c0b1ad147f747f088a37ae120413108356f.tar.gz
- 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@
-rw-r--r--ChangeLog6
-rw-r--r--channels.c10
-rw-r--r--nchan.c6
3 files changed, 13 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index aff63e72..ad9e3fbd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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 $
diff --git a/channels.c b/channels.c
index a053b033..db3bda66 100644
--- a/channels.c
+++ b/channels.c
@@ -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;
}
}
diff --git a/nchan.c b/nchan.c
index ae5fb4aa..ae1fe47c 100644
--- a/nchan.c
+++ b/nchan.c
@@ -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 */