]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: buffer: replace buffer_pending() with ci_data()
authorWilly Tarreau <w@1wt.eu>
Fri, 15 Jun 2018 13:14:53 +0000 (15:14 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 19 Jul 2018 14:23:41 +0000 (16:23 +0200)
It used to return b->i for channels, which is what ci_data() does.

include/common/buffer.h
src/filters.c
src/proto_http.c

index 648e7b635d1d0856d8777d3e61b78a55fc0e9af5..18b5aa4ae97c13123e5b28e9a89f8f6089d11e47 100644 (file)
@@ -103,14 +103,6 @@ static inline int buffer_count(const struct buffer *buf, const char *from, const
        return count;
 }
 
-/* returns the amount of pending bytes in the buffer. It is the amount of bytes
- * that is not scheduled to be sent.
- */
-static inline int buffer_pending(const struct buffer *buf)
-{
-       return buf->i;
-}
-
 /* Return 1 if the buffer has less than 1/4 of its capacity free, otherwise 0 */
 static inline int buffer_almost_full(const struct buffer *buf)
 {
index 26bed64f52556d5ec2b8895a6ba5fbf95bb18463..69a03310e2554dbd3284b81b6d4af50948e5282b 100644 (file)
@@ -1094,7 +1094,7 @@ flt_xfer_data(struct stream *s, struct channel *chn, unsigned int an_bit)
        /* Stop waiting data if the input in closed and no data is pending or if
         * the output is closed. */
        if ((chn->flags & CF_SHUTW) ||
-           ((chn->flags & CF_SHUTR) && !buffer_pending(chn->buf))) {
+           ((chn->flags & CF_SHUTR) && !ci_data(chn))) {
                ret = 1;
                goto end;
        }
index 7f90373212583afd6d9b478c722dcb8f07434dc7..88cb6360356a4f84ffc12bdf5547e61b66de153e 100644 (file)
@@ -6158,7 +6158,7 @@ int http_response_forward_body(struct stream *s, struct channel *res, int an_bit
                if ((s->req.flags & (CF_SHUTR|CF_SHUTW)) == (CF_SHUTR|CF_SHUTW))
                        goto aborted_xfer;
                /* If we have some pending data, we continue the processing */
-               if (!buffer_pending(res->buf)) {
+               if (!ci_data(res)) {
                        if (!(s->flags & SF_ERR_MASK))
                                s->flags |= SF_ERR_SRVCL;
                        HA_ATOMIC_ADD(&s->be->be_counters.srv_aborts, 1);