Commit 51305b37 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Initialize the cache_acceptor.c/VCA in the same manner as other parts.


git-svn-id: http://www.varnish-cache.org/svn/trunk@181 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent de1377c7
......@@ -60,9 +60,9 @@ extern struct stevedore *stevedore;
/* cache_acceptor.c */
void vca_write(struct sess *sp, void *ptr, size_t len);
void vca_flush(struct sess *sp);
void *vca_main(void *arg);
void vca_retire_session(struct sess *sp);
void vca_recycle_session(struct sess *sp);
void VCA_Init(void);
/* cache_backend.c */
void VBE_Init(void);
......
......@@ -11,6 +11,7 @@
#include <assert.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
#include <sys/uio.h>
#include <sys/types.h>
......@@ -33,6 +34,8 @@ static struct event_base *evb;
static struct event pipe_e;
static int pipes[2];
static pthread_t vca_thread;
#define SESS_IOVS 5
static struct event accept_e[2 * HERITAGE_NSOCKS];
......@@ -137,7 +140,7 @@ accept_f(int fd, short event, void *arg)
http_RecvHead(sp->http, sp->fd, evb, DealWithSession, sp);
}
void *
static void *
vca_main(void *arg)
{
unsigned u;
......@@ -194,3 +197,12 @@ vca_retire_session(struct sess *sp)
}
free(sp);
}
/*--------------------------------------------------------------------*/
void
VCA_Init(void)
{
AZ(pthread_create(&vca_thread, NULL, vca_main, NULL));
}
......@@ -24,7 +24,6 @@
#include "cli_event.h"
static struct event ev_keepalive;
static pthread_t vca_thread;
struct hash_slinger *hash;
struct stevedore *stevedore;
......@@ -116,7 +115,7 @@ child_main(void)
VSL_Init();
CacheInitPool();
AZ(pthread_create(&vca_thread, NULL, vca_main, NULL));
VCA_Init();
eb = event_init();
assert(eb != NULL);
......
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