From: Willy Tarreau Date: Mon, 9 Jul 2018 09:43:36 +0000 (+0200) Subject: MINOR: buffer: b_set_data() doesn't truncate output data anymore X-Git-Tag: v1.9-dev1~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6dfd88a92388823258efbf858fc3a2db7fa7bd3;p=thirdparty%2Fhaproxy.git MINOR: buffer: b_set_data() doesn't truncate output data anymore 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. --- diff --git a/include/common/buf.h b/include/common/buf.h index 6eec422929..b223b21fa0 100644 --- a/include/common/buf.h +++ b/include/common/buf.h @@ -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; }