r515 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Thu Jul 20 11:58:11 CEST 2006


Author: phk
Date: 2006-07-20 11:58:11 +0200 (Thu, 20 Jul 2006)
New Revision: 515

Modified:
   trunk/varnish-cache/bin/varnishd/cache_http.c
Log:
Hmm, that was a bad idea.


Modified: trunk/varnish-cache/bin/varnishd/cache_http.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_http.c	2006-07-20 09:42:47 UTC (rev 514)
+++ trunk/varnish-cache/bin/varnishd/cache_http.c	2006-07-20 09:58:11 UTC (rev 515)
@@ -127,7 +127,7 @@
 http_Read(struct http *hp, int fd, void *p, unsigned len)
 {
 	int i;
-	unsigned u;
+	int u;
 	char *b = p;
 
 	u = 0;
@@ -140,12 +140,11 @@
 		b += u;
 		len -= u;
 	}
-	while (len > 0) {
+	if (len > 0) {
 		i = read(fd, b, len);
-		if (i <= 0)
+		if (i < 0)
 			return (i);
 		u += i;
-		len -= u;
 	}
 	return (u);
 }




More information about the varnish-commit mailing list