Commit 8b3144f2 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Make it possible for the acceptor to provide a method by which sessions

are passed to it.

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

closes #227


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2632 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 8c71f341
......@@ -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);
......
......@@ -32,10 +32,12 @@
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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment