MINOR: buffer: replace buffer_empty() with b_empty() or c_empty()

For the same consistency reasons, let's use b_empty() at the few places
where an empty buffer is expected, or c_empty() if it's done on a channel.
Some of these places were there to realign the buffer so
{b,c}_realign_if_empty() was used instead.
diff --git a/src/buffer.c b/src/buffer.c
index 416cb4c..16372bf 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -102,9 +102,7 @@
 		memcpy(pos, str, len);
 
 	b->i += delta;
-
-	if (buffer_empty(b))
-		b->p = b->data;
+	b_realign_if_empty(b);
 
 	return delta;
 }
diff --git a/src/channel.c b/src/channel.c
index c5a51f7..1efab9c 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -205,7 +205,7 @@
 	if (unlikely(channel_input_closed(chn)))
 		return NULL;
 
-	if (!chn->buf->size || !buffer_empty(chn->buf))
+	if (!c_size(chn) || !c_empty(chn))
 		return buf;
 
 	old = chn->buf;
diff --git a/src/raw_sock.c b/src/raw_sock.c
index 477862e..3ae7656 100644
--- a/src/raw_sock.c
+++ b/src/raw_sock.c
@@ -276,9 +276,7 @@
 		}
 	}
 
-	/* let's realign the buffer to optimize I/O */
-	if (buffer_empty(buf))
-		buf->p = buf->data;
+	b_realign_if_empty(buf);
 
 	/* read the largest possible block. For this, we perform only one call
 	 * to recv() unless the buffer wraps and we exactly fill the first hunk,
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index 42cb72f..9aa101b 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -5351,10 +5351,7 @@
 		/* a handshake was requested */
 		return 0;
 
-	/* let's realign the buffer to optimize I/O */
-	if (buffer_empty(buf)) {
-		buf->p = buf->data;
-	}
+	b_realign_if_empty(buf);
 
 	/* read the largest possible block. For this, we perform only one call
 	 * to recv() unless the buffer wraps and we exactly fill the first hunk,
diff --git a/src/stream.c b/src/stream.c
index 30bfc67..e958423 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -456,11 +456,11 @@
 {
 	int offer = 0;
 
-	if (s->req.buf->size && buffer_empty(s->req.buf)) {
+	if (c_size(&s->req) && c_empty(&s->req)) {
 		offer = 1;
 		b_free(&s->req.buf);
 	}
-	if (s->res.buf->size && buffer_empty(s->res.buf)) {
+	if (c_size(&s->res) && c_empty(&s->res)) {
 		offer = 1;
 		b_free(&s->res.buf);
 	}