From: Willy Tarreau Date: Fri, 2 Mar 2012 10:36:00 +0000 (+0100) Subject: MINOR: buffers: remove unused function buffer_contig_data() X-Git-Tag: v1.5-dev9~91 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3f7ff1406c6172e8feff64e254fcacfe99beca92;p=thirdparty%2Fhaproxy.git MINOR: buffers: remove unused function buffer_contig_data() This one was never used and is buggy. It will be easier to rewrite it when the buffer rework is complete. --- diff --git a/include/proto/buffers.h b/include/proto/buffers.h index ec8eaab2ba..18495b58fb 100644 --- a/include/proto/buffers.h +++ b/include/proto/buffers.h @@ -273,31 +273,6 @@ static inline int buffer_almost_full(const struct buffer *buf) return 0; } -/* - * Return the max amount of bytes that can be read from the buffer at once. - * Note that this may be lower than the actual buffer length when the data - * wrap after the end, so it's preferable to call this function again after - * reading. Also note that this function respects the ->o limit. - */ -static inline int buffer_contig_data(struct buffer *buf) -{ - int ret; - - if (!buf->o) - return 0; - - if (buf->r > buf->w) - ret = buf->r - buf->w; - else - ret = buf->data + buf->size - buf->w; - - /* limit the amount of outgoing data if required */ - if (ret > buf->o) - ret = buf->o; - - return ret; -} - /* Returns true if the buffer's input is already closed */ static inline int buffer_input_closed(struct buffer *buf) {