]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: channel: rename bi_full to channel_full as it checks the whole channel
authorWilly Tarreau <wtarreau@exceliance.fr>
Mon, 27 Aug 2012 16:54:20 +0000 (18:54 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 3 Sep 2012 18:47:32 +0000 (20:47 +0200)
Since the function takes care of the forward count and involves more than
buffer knowledge, rename it.

include/proto/channel.h
src/channel.c
src/stream_interface.c

index 4aa6a572219378adb51433d7363fde2e27067a9d..6d4d3e73967c442ff0a567a83728d293cc551eb5 100644 (file)
@@ -107,7 +107,7 @@ static inline int buffer_max_len(const struct channel *buf)
  * close to happen. The test is optimized to avoid as many operations as
  * possible for the fast case and to be used as an "if" condition.
  */
-static inline int bi_full(const struct channel *b)
+static inline int channel_full(const struct channel *b)
 {
        int rem = b->buf.size;
 
@@ -228,8 +228,6 @@ static inline void bi_erase(struct channel *buf)
 
        buf->buf.i = 0;
        buf->flags &= ~BF_FULL;
-       if (bi_full(buf))
-               buf->flags |= BF_FULL;
 }
 
 /* marks the buffer as "shutdown" ASAP for reads */
@@ -322,7 +320,7 @@ static inline void bo_skip(struct channel *buf, int len)
        if (buffer_len(&buf->buf) == 0)
                buf->buf.p = buf->buf.data;
 
-       if (!bi_full(buf))
+       if (!channel_full(buf))
                buf->flags &= ~BF_FULL;
 
        /* notify that some data was written to the SI from the buffer */
index 86fa811300a7724a57701c563718e35e20500322..0e1af13499d3c670c4e7a2f7cadc1efd35ea778e 100644 (file)
@@ -128,7 +128,7 @@ int bo_inject(struct channel *buf, const char *msg, int len)
        buf->total += len;
 
        buf->flags &= ~BF_FULL;
-       if (bi_full(buf))
+       if (channel_full(buf))
                buf->flags |= BF_FULL;
 
        return -1;
@@ -152,7 +152,7 @@ int bi_putchr(struct channel *buf, char c)
        *bi_end(&buf->buf) = c;
 
        buf->buf.i++;
-       if (bi_full(buf))
+       if (channel_full(buf))
                buf->flags |= BF_FULL;
        buf->flags |= BF_READ_PARTIAL;
 
@@ -215,7 +215,7 @@ int bi_putblk(struct channel *buf, const char *blk, int len)
        }
 
        buf->flags &= ~BF_FULL;
-       if (bi_full(buf))
+       if (channel_full(buf))
                buf->flags |= BF_FULL;
 
        /* notify that some data was read from the SI into the buffer */
@@ -346,7 +346,7 @@ int buffer_replace2(struct channel *b, char *pos, char *end, const char *str, in
        b->flags &= ~BF_FULL;
        if (buffer_len(&b->buf) == 0)
                b->buf.p = b->buf.data;
-       if (bi_full(b))
+       if (channel_full(b))
                b->flags |= BF_FULL;
 
        return delta;
@@ -384,7 +384,7 @@ int buffer_insert_line2(struct channel *b, char *pos, const char *str, int len)
        b->buf.i += delta;
 
        b->flags &= ~BF_FULL;
-       if (bi_full(b))
+       if (channel_full(b))
                b->flags |= BF_FULL;
 
        return delta;
index 14e2cd5ce474bcbfcee7f2d1254193ca84f38c8f..2f3400dcc3234183c8cde9d4661c42d3c9c4520a 100644 (file)
@@ -727,7 +727,7 @@ static int si_conn_send_loop(struct connection *conn)
 
                b->flags |= BF_WRITE_PARTIAL;
 
-               if (likely(!bi_full(b)))
+               if (likely(!channel_full(b)))
                        b->flags &= ~BF_FULL;
 
                if (!b->buf.o) {
@@ -1080,7 +1080,7 @@ void si_conn_recv_cb(struct connection *conn)
                b->flags |= BF_READ_PARTIAL;
                b->total += ret;
 
-               if (bi_full(b)) {
+               if (channel_full(b)) {
                        /* The buffer is now full, there's no point in going through
                         * the loop again.
                         */