summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 aff63e72c..ad9e3fbda 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -106,6 +106,10 @@
106 - markus@cvs.openbsd.org 2002/01/09 17:16:00 106 - markus@cvs.openbsd.org 2002/01/09 17:16:00
107 [channels.c] 107 [channels.c]
108 merge channel_pre_open_15/channel_pre_open_20; ok provos@ 108 merge channel_pre_open_15/channel_pre_open_20; ok provos@
109 - markus@cvs.openbsd.org 2002/01/09 17:26:35
110 [channels.c nchan.c]
111 replace buffer_consume(b, buffer_len(b)) with buffer_clear(b);
112 ok provos@
109 113
110 114
11120020121 11520020121
@@ -7254,4 +7258,4 @@
7254 - Wrote replacements for strlcpy and mkdtemp 7258 - Wrote replacements for strlcpy and mkdtemp
7255 - Released 1.0pre1 7259 - Released 1.0pre1
7256 7260
7257$Id: ChangeLog,v 1.1753 2002/01/22 12:20:40 djm Exp $ 7261$Id: ChangeLog,v 1.1754 2002/01/22 12:21:15 djm Exp $
diff --git a/channels.c b/channels.c
index a053b0337..db3bda66a 100644
--- a/channels.c
+++ b/channels.c
@@ -39,7 +39,7 @@
39 */ 39 */
40 40
41#include "includes.h" 41#include "includes.h"
42RCSID("$OpenBSD: channels.c,v 1.157 2002/01/09 17:16:00 markus Exp $"); 42RCSID("$OpenBSD: channels.c,v 1.158 2002/01/09 17:26:35 markus Exp $");
43 43
44#include "ssh.h" 44#include "ssh.h"
45#include "ssh1.h" 45#include "ssh1.h"
@@ -1270,7 +1270,7 @@ channel_handle_rfd(Channel *c, fd_set * readset, fd_set * writeset)
1270 chan_mark_dead(c); 1270 chan_mark_dead(c);
1271 return -1; 1271 return -1;
1272 } else if (compat13) { 1272 } else if (compat13) {
1273 buffer_consume(&c->output, buffer_len(&c->output)); 1273 buffer_clear(&c->output);
1274 c->type = SSH_CHANNEL_INPUT_DRAINING; 1274 c->type = SSH_CHANNEL_INPUT_DRAINING;
1275 debug("channel %d: input draining.", c->self); 1275 debug("channel %d: input draining.", c->self);
1276 } else { 1276 } else {
@@ -1312,7 +1312,7 @@ channel_handle_wfd(Channel *c, fd_set * readset, fd_set * writeset)
1312 chan_mark_dead(c); 1312 chan_mark_dead(c);
1313 return -1; 1313 return -1;
1314 } else if (compat13) { 1314 } else if (compat13) {
1315 buffer_consume(&c->output, buffer_len(&c->output)); 1315 buffer_clear(&c->output);
1316 debug("channel %d: input draining.", c->self); 1316 debug("channel %d: input draining.", c->self);
1317 c->type = SSH_CHANNEL_INPUT_DRAINING; 1317 c->type = SSH_CHANNEL_INPUT_DRAINING;
1318 } else { 1318 } else {
@@ -1425,7 +1425,7 @@ channel_post_output_drain_13(Channel *c, fd_set * readset, fd_set * writeset)
1425 len = write(c->sock, buffer_ptr(&c->output), 1425 len = write(c->sock, buffer_ptr(&c->output),
1426 buffer_len(&c->output)); 1426 buffer_len(&c->output));
1427 if (len <= 0) 1427 if (len <= 0)
1428 buffer_consume(&c->output, buffer_len(&c->output)); 1428 buffer_clear(&c->output);
1429 else 1429 else
1430 buffer_consume(&c->output, len); 1430 buffer_consume(&c->output, len);
1431 } 1431 }
@@ -1828,7 +1828,7 @@ channel_input_close(int type, u_int32_t seq, void *ctxt)
1828 * Not a closed channel - mark it as draining, which will 1828 * Not a closed channel - mark it as draining, which will
1829 * cause it to be freed later. 1829 * cause it to be freed later.
1830 */ 1830 */
1831 buffer_consume(&c->input, buffer_len(&c->input)); 1831 buffer_clear(&c->input);
1832 c->type = SSH_CHANNEL_OUTPUT_DRAINING; 1832 c->type = SSH_CHANNEL_OUTPUT_DRAINING;
1833 } 1833 }
1834} 1834}
diff --git a/nchan.c b/nchan.c
index ae5fb4aa3..ae1fe47cc 100644
--- a/nchan.c
+++ b/nchan.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: nchan.c,v 1.33 2001/12/19 07:18:56 deraadt Exp $"); 26RCSID("$OpenBSD: nchan.c,v 1.34 2002/01/09 17:26:35 markus Exp $");
27 27
28#include "ssh1.h" 28#include "ssh1.h"
29#include "ssh2.h" 29#include "ssh2.h"
@@ -266,7 +266,7 @@ chan_send_oclose1(Channel *c)
266 case CHAN_OUTPUT_OPEN: 266 case CHAN_OUTPUT_OPEN:
267 case CHAN_OUTPUT_WAIT_DRAIN: 267 case CHAN_OUTPUT_WAIT_DRAIN:
268 chan_shutdown_write(c); 268 chan_shutdown_write(c);
269 buffer_consume(&c->output, buffer_len(&c->output)); 269 buffer_clear(&c->output);
270 packet_start(SSH_MSG_CHANNEL_OUTPUT_CLOSE); 270 packet_start(SSH_MSG_CHANNEL_OUTPUT_CLOSE);
271 packet_put_int(c->remote_id); 271 packet_put_int(c->remote_id);
272 packet_send(); 272 packet_send();
@@ -516,7 +516,7 @@ chan_init(void)
516static void 516static void
517chan_shutdown_write(Channel *c) 517chan_shutdown_write(Channel *c)
518{ 518{
519 buffer_consume(&c->output, buffer_len(&c->output)); 519 buffer_clear(&c->output);
520 if (compat20 && c->type == SSH_CHANNEL_LARVAL) 520 if (compat20 && c->type == SSH_CHANNEL_LARVAL)
521 return; 521 return;
522 /* shutdown failure is allowed if write failed already */ 522 /* shutdown failure is allowed if write failed already */