From a070159cc5ed59df4d79f6d23c9ba87a3f50a7ec Mon Sep 17 00:00:00 2001 From: Matt Johnston <matt@ucc.asn.au> Date: Fri, 20 Mar 2015 23:33:45 +0800 Subject: [PATCH] Fix when iov queue is large --- netio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netio.c b/netio.c index 0837e06a..2741de27 100644 --- a/netio.c +++ b/netio.c @@ -273,7 +273,7 @@ void packet_queue_to_iovec(struct Queue *queue, struct iovec *iov, unsigned int *iov_count = MIN(MIN(queue->count, IOV_MAX), *iov_count); - for (l = queue->head, i = 0; l; l = l->link, i++) + for (l = queue->head, i = 0; i < *iov_count; l = l->link, i++) { writebuf = (buffer*)l->item; len = writebuf->len - 1 - writebuf->pos; -- GitLab