From: Willy Tarreau Date: Tue, 15 Sep 2009 19:23:54 +0000 (+0200) Subject: [MEDIUM] stream_interface: make use of buffer_cut_tail() to report errors X-Git-Tag: v1.4-dev3~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cb359e3f3cf6d3334d2d07613a374c8d0cd470ae;p=thirdparty%2Fhaproxy.git [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. --- diff --git a/src/stream_interface.c b/src/stream_interface.c index c0c80b6e13..d8ee9e69ef 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); }