]> err.no Git - varnish/commitdiff
A Give VLU_New() an optional buffersize argument
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 15 Feb 2008 10:57:20 +0000 (10:57 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 15 Feb 2008 10:57:20 +0000 (10:57 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2473 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/mgt_child.c
varnish-cache/include/vlu.h
varnish-cache/lib/libvarnish/vlu.c

index 619ae81093b535dbfd4ad11395b3d087f42b6a04..0bad337c3d094c473a254947090f7afd051f0dc4 100644 (file)
@@ -229,7 +229,7 @@ start_child(void)
        AZ(close(child_fds[1]));
        child_fds[1] = -1;
 
-       vlu = VLU_New(NULL, child_line);
+       vlu = VLU_New(NULL, child_line, 0);
        AN(vlu);
 
        AZ(ev_listen);
index 307f57f2ab5e9e6e62db3f6b63e21e869468bbd7..ffc767836444b25170e8f514506c8650298d360d 100644 (file)
@@ -33,7 +33,7 @@
 #define VLU_H_INCLUDED
 
 typedef int (vlu_f)(void *, const char *);
-struct vlu *VLU_New(void *priv, vlu_f *func);
+struct vlu *VLU_New(void *priv, vlu_f *func, unsigned bufsize);
 int VLU_Fd(int fd, struct vlu *l);
 int VLU_File(FILE *f, struct vlu *l);
 void VLU_Destroy(struct vlu *l);
index 5f6c89a2064cc80ff34f6a716b6a470df5894a2e..3c278b0b32cbb492346624d836d5a399251d8d78 100644 (file)
@@ -48,15 +48,17 @@ struct vlu {
 };
 
 struct vlu *
-VLU_New(void *priv, vlu_f *func)
+VLU_New(void *priv, vlu_f *func, unsigned bufsize)
 {
        struct vlu *l;
 
+       if (bufsize == 0)
+               bufsize = BUFSIZ;
        ALLOC_OBJ(l, LINEUP_MAGIC);
        if (l != NULL) {
                l->func = func;
                l->priv = priv;
-               l->bufl = BUFSIZ - 1;
+               l->bufl = bufsize - 1;
                l->buf = malloc(l->bufl + 1);
                if (l->buf == NULL) {
                        FREE_OBJ(l);