From cb359e3f3cf6d3334d2d07613a374c8d0cd470ae Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 15 Sep 2009 21:23:54 +0200 Subject: [PATCH] [MEDIUM] stream_interface: make use of buffer_cut_tail() to report errors The stream_int_return() function used to call buffer_erase() on the response buffer, which completely wipes it without taking care about whatever could have been there. Now we more carefully strip only data not scheduled to be sent. --- src/stream_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stream_interface.c b/src/stream_interface.c index c0c80b6e1..d8ee9e69e 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -66,7 +66,7 @@ void stream_int_report_error(struct stream_interface *si) void stream_int_return(struct stream_interface *si, const struct chunk *msg) { buffer_erase(si->ib); - buffer_erase(si->ob); + buffer_cut_tail(si->ob); if (msg && msg->len) buffer_write(si->ob, msg->str, msg->len); }