From: Michael Poole Date: Fri, 19 Nov 2010 21:02:01 +0000 (-0500) Subject: Fix available byte count returned by ioq_grow(). X-Git-Url: http://git.pk910.de/?p=srvx.git;a=commitdiff_plain;h=eab60cb760238b0f57727c1cbe7e095286c58d81 Fix available byte count returned by ioq_grow(). ioq_grow() needs to use the same -1 that ioq_put_avail() uses when the "get" pointer is at byte 0. src/ioset.c (ioq_grow): Reduce the reported available-byte count by 1. --- diff --git a/src/ioset.c b/src/ioset.c index a7563d3..04cae40 100644 --- a/src/ioset.c +++ b/src/ioset.c @@ -131,7 +131,7 @@ ioq_grow(struct ioq *ioq) { ioq->get = 0; ioq->buf = new_buf; ioq->size = new_size; - return new_size - ioq->put; + return new_size - ioq->put - 1; } extern struct io_engine io_engine_kevent;