]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: buffer: b_set_data() doesn't truncate output data anymore
authorWilly Tarreau <w@1wt.eu>
Mon, 9 Jul 2018 09:43:36 +0000 (11:43 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 19 Jul 2018 14:23:43 +0000 (16:23 +0200)
b_set_data() is used :
  - in proto_http and hlua to trim input data (b_set_data(co_data()))
  - in SPOE to append data to a buffer while building a message

In no case will this truncate a buffer so we can safely remove the
test for len < b->output.

include/common/buf.h

index 6eec42292907697b8329ba924d9b70e7385c8c21..b223b21fa02c145a095c49c0f1a3d8a8165f5d37 100644 (file)
@@ -385,8 +385,6 @@ static inline void b_add(struct buffer *b, size_t count)
 /* b_set_data() : sets the buffer's length */
 static inline void b_set_data(struct buffer *b, size_t len)
 {
-       if (len < b->output)
-               b->output = len;
        b->len = len;
 }