]> err.no Git - varnish/commitdiff
Make it possible for the acceptor to provide a method by which sessions
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 21 Apr 2008 06:33:37 +0000 (06:33 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 21 Apr 2008 06:33:37 +0000 (06:33 +0000)
are passed to it.

If no method is provided, we fall back to vca_pipes.

closes #227

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2632 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_acceptor.c
varnish-cache/bin/varnishd/cache_acceptor.h

index 69019d22072b8b65c89de982092262a2a4161fc4..6394cee03b7c0d00bbb14ed3f613f74949f3d4db 100644 (file)
@@ -270,7 +270,10 @@ vca_return_session(struct sess *sp)
        AZ(sp->obj);
        AZ(sp->vcl);
        assert(sp->fd >= 0);
-       assert(sizeof sp == write(vca_pipes[1], &sp, sizeof sp));
+       if (vca_act->pass == NULL)
+               assert(sizeof sp == write(vca_pipes[1], &sp, sizeof sp));
+       else
+               vca_act->pass(sp);
 }
 
 
@@ -290,7 +293,8 @@ ccf_start(struct cli *cli, const char * const *av, void *priv)
                fprintf(stderr, "No acceptor in program\n");
                exit (2);
        }
-       AZ(pipe(vca_pipes));
+       if (vca_act->pass == NULL)
+               AZ(pipe(vca_pipes));
        vca_act->init();
        AZ(pthread_create(&vca_thread_acct, NULL, vca_acct, NULL));
        VSL(SLT_Debug, 0, "Acceptor is %s", vca_act->name);
index 06e8c2069222939690955e537694977b99926c8f..dcda822ee31971fb8f679cbd30072533225cc0f2 100644 (file)
 struct sess;
 
 typedef void acceptor_init_f(void);
+typedef void acceptor_pass_f(struct sess *);
 
 struct acceptor {
        const char              *name;
        acceptor_init_f         *init;
+       acceptor_pass_f         *pass;
 };
 
 #if defined(HAVE_EPOLL_CTL)