[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.
This commit is contained in:
Willy Tarreau 2009-09-15 21:23:54 +02:00
parent 9cb8daa203
commit cb359e3f3c

View File

@ -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);
}