1
0
mirror of http://git.haproxy.org/git/haproxy.git/ synced 2025-04-01 22:48:25 +00:00

MINOR: buffer: use c_head() instead of buffer_wrap_sub(c->buf, p-o)

This way we don't need o anymore.
This commit is contained in:
Willy Tarreau 2018-06-15 15:18:17 +02:00
parent 144c5c4d21
commit 50227f9b88
2 changed files with 1 additions and 9 deletions
include

View 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)
{

View 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);
}