[3.0] 5d93777 Fix up reading of saved log files

Tollef Fog Heen tfheen at varnish-cache.org
Wed Aug 17 11:25:42 CEST 2011


commit 5d937779bb56e09122ca0abeeea4c5afb4ac7299
Author: Tollef Fog Heen <tfheen at varnish-software.com>
Date:   Mon Aug 1 13:53:31 2011 +0200

    Fix up reading of saved log files
    
    Make sure we compensate for sizeof(int) and the stuff we have already
    read.
    
    Fixes: #848

diff --git a/lib/libvarnishapi/vsl.c b/lib/libvarnishapi/vsl.c
index b06c4df..95e8cae 100644
--- a/lib/libvarnishapi/vsl.c
+++ b/lib/libvarnishapi/vsl.c
@@ -165,7 +165,7 @@ vsl_nextlog(struct vsl *vsl, uint32_t **pp)
 			vsl->rbuflen = l;
 		}
 		i = read(vsl->r_fd, vsl->rbuf + 2, l * 4L - 8L);
-		if (i != l)
+		if (i != (l * 4L - 8L))
 			return (-1);
 		*pp = vsl->rbuf;
 		return (1);



More information about the varnish-commit mailing list