]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MEDIUM] stream_interface: make use of buffer_cut_tail() to report errors
authorWilly Tarreau <w@1wt.eu>
Tue, 15 Sep 2009 19:23:54 +0000 (21:23 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 19 Sep 2009 12:53:47 +0000 (14:53 +0200)
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

index c0c80b6e135c3341302a7ef32f63243ca9c7d0ec..d8ee9e69efcbf93e55dfebc45a136f0c2d765f89 100644 (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);
 }