[master] 7090d80 Allocate rbuf if -r is specified

Poul-Henning Kamp phk at varnish-cache.org
Mon Nov 21 10:11:25 CET 2011


commit 7090d8029742c592014dba0f34fb9db1ec4e999a
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Nov 21 09:11:13 2011 +0000

    Allocate rbuf if -r is specified

diff --git a/lib/libvarnishapi/vsl_arg.c b/lib/libvarnishapi/vsl_arg.c
index 4bcd44a..b855628 100644
--- a/lib/libvarnishapi/vsl_arg.c
+++ b/lib/libvarnishapi/vsl_arg.c
@@ -93,6 +93,10 @@ vsl_r_arg(const struct VSM_data *vd, const char *opt)
 	if (vd->vsl->r_fd < 0) {
 		perror(opt);
 		return (-1);
+	} else if (vd->vsl->rbuflen == 0) {
+		vd->vsl->rbuf = malloc(1024);
+		AN(vd->vsl->rbuf);
+		vd->vsl->rbuflen = 1024;
 	}
 	return (1);
 }



More information about the varnish-commit mailing list