changeset 1073:88043f9d40bd

Fix when iov queue is large
author Matt Johnston <matt@ucc.asn.au>
date Fri, 20 Mar 2015 23:33:45 +0800
parents 686cd3e8e13e
children 10f198d4a308
files netio.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/netio.c	Fri Mar 20 22:53:32 2015 +0800
+++ b/netio.c	Fri Mar 20 23:33:45 2015 +0800
@@ -273,7 +273,7 @@
 
 	*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;