MINOR: buffer: use b_room() to determine available space in a buffer
We used to have variations around buffer_total_space() and
size-buffer_len() or size-b_data(). Let's simplify all this. buffer_len()
was also removed as not used anymore.
diff --git a/src/channel.c b/src/channel.c
index b3382a7..c5a51f7 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -151,7 +151,7 @@
return -3;
max = channel_recv_limit(chn);
- if (unlikely(len > max - buffer_len(chn->buf))) {
+ if (unlikely(len > max - b_data(chn->buf))) {
/* we can't write this chunk right now because the buffer is
* almost full or because the block is too large. Return the
* available space or -2 if impossible.