]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: buffer: remove bo_end()
authorWilly Tarreau <w@1wt.eu>
Thu, 7 Jun 2018 16:22:26 +0000 (18:22 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 19 Jul 2018 14:23:40 +0000 (16:23 +0200)
It was replaced by either b_tail() when the buffer has no input data, or
b_peek(b, b->o).

include/common/buffer.h
src/h1.c
src/mux_h2.c

index fcb61f3c70641cb88770512b90391c0ec1d58fb6..9e1f25fa79c797cda3769fe9c41266a020f92130 100644 (file)
@@ -117,12 +117,6 @@ static inline char *bi_end(const struct buffer *b)
        return ret;
 }
 
-/* Returns the end of the output data in a buffer */
-static inline char *bo_end(const struct buffer *b)
-{
-       return b->p;
-}
-
 /* Returns the amount of output data that can contiguously be read at once */
 static inline int bo_contig_data(const struct buffer *b)
 {
index d3a20c2ed263f2285f44b5e24862a18db6633b2f..ddc7daf15ea795c489bfc2e56a8462e61aa190c2 100644 (file)
--- a/src/h1.c
+++ b/src/h1.c
@@ -1220,7 +1220,7 @@ int h1_measure_trailers(const struct buffer *buf)
        while (1) {
                const char *p1 = NULL, *p2 = NULL;
                const char *start = b_ptr(buf, (int)(count - buf->o));
-               const char *stop  = bo_end(buf);
+               const char *stop  = b_peek(buf, buf->o);
                const char *ptr   = start;
                int bytes = 0;
 
index afd33cb066112eeaf9866af82526cba1f6191d0d..5a7af54d55907edf02ee0399b1f9211022eb74ae 100644 (file)
@@ -2988,7 +2988,7 @@ static int h2s_frt_make_resp_headers(struct h2s *h2s, struct buffer *buf)
        chunk_reset(&outbuf);
 
        while (1) {
-               outbuf.str  = bo_end(h2c->mbuf);
+               outbuf.str  = b_tail(h2c->mbuf);
                outbuf.size = bo_contig_space(h2c->mbuf);
                outbuf.len = 0;
 
@@ -3146,7 +3146,7 @@ static int h2s_frt_make_resp_data(struct h2s *h2s, struct buffer *buf)
        chunk_reset(&outbuf);
 
        while (1) {
-               outbuf.str  = bo_end(h2c->mbuf);
+               outbuf.str  = b_tail(h2c->mbuf);
                outbuf.size = bo_contig_space(h2c->mbuf);
                outbuf.len = 0;