[experimental-ims] 66101b9 Fix up reading of saved log files

Geoff Simmons geoff at varnish-cache.org
Wed Aug 31 16:00:11 CEST 2011


commit 66101b90620c1ba08b1e60a059d38835c2395ccd
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