MINOR: buffer: replace buffer_pending() with ci_data()
It used to return b->i for channels, which is what ci_data() does.
diff --git a/include/common/buffer.h b/include/common/buffer.h
index 648e7b6..18b5aa4 100644
--- a/include/common/buffer.h
+++ b/include/common/buffer.h
@@ -103,14 +103,6 @@
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)
{
diff --git a/src/filters.c b/src/filters.c
index 26bed64..69a0331 100644
--- a/src/filters.c
+++ b/src/filters.c
@@ -1094,7 +1094,7 @@
/* 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;
}
diff --git a/src/proto_http.c b/src/proto_http.c
index 7f90373..88cb636 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -6158,7 +6158,7 @@
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);