]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: buffer: use c_head() instead of buffer_wrap_sub(c->buf, p-o)
authorWilly Tarreau <w@1wt.eu>
Fri, 15 Jun 2018 13:18:17 +0000 (15:18 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 19 Jul 2018 14:23:42 +0000 (16:23 +0200)
This way we don't need o anymore.

include/common/buffer.h
include/proto/channel.h

index dde0fcc63f3f6f2d04a6d2cd300ea3adc5104ffd..6f3ab26a1983c526bcf61060bf87fc699e2b1cf2 100644 (file)
@@ -61,14 +61,6 @@ void buffer_dump(FILE *o, struct buffer *b, int from, int to);
 
 /***** FIXME: OLD API BELOW *****/
 
-/* Normalizes a pointer after a subtract */
-static inline char *buffer_wrap_sub(const struct buffer *buf, char *ptr)
-{
-       if (ptr < buf->data)
-               ptr += buf->size;
-       return ptr;
-}
-
 /* Normalizes a pointer after an addition */
 static inline char *buffer_wrap_add(const struct buffer *buf, char *ptr)
 {
index 2cbbf96863422ac18dacd3e4ef0872bc18ad322a..b84ccc9e8368cf660b299b1e15d0ecc2b5b832b4 100644 (file)
@@ -823,7 +823,7 @@ static inline int co_getchr(struct channel *chn)
                        return -2;
                return -1;
        }
-       return *buffer_wrap_sub(chn->buf, chn->buf->p - chn->buf->o);
+       return *co_head(chn);
 }