Commit 55d8e88d authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Split waiter::cache and waiter:mgt out from waiter::common

parent 23e4c603
......@@ -76,7 +76,8 @@ varnishd_SOURCES = \
storage/storage_persistent_subr.c \
storage/storage_synth.c \
storage/storage_umem.c \
waiter/waiter_common.c \
waiter/mgt_waiter.c \
waiter/cache_waiter.c \
waiter/cache_waiter_epoll.c \
waiter/cache_waiter_kqueue.c \
waiter/cache_waiter_poll.c \
......@@ -96,7 +97,7 @@ noinst_HEADERS = \
mgt/mgt_param.h \
storage/storage.h \
storage/storage_persistent.h \
waiter/cache_waiter.h
waiter/waiter.h
varnishd_CFLAGS = \
@PCRE_CFLAGS@ \
......
......@@ -35,7 +35,7 @@
#include "cache.h"
#include "common/heritage.h"
#include "waiter/cache_waiter.h"
#include "waiter/waiter.h"
#include "hash/hash_slinger.h"
volatile struct params *cache_param;
......
......@@ -42,7 +42,7 @@
#include "common/heritage.h"
#include "cache_backend.h"
#include "waiter/cache_waiter.h"
#include "waiter/waiter.h"
#include "vcl.h"
/*
......
......@@ -48,7 +48,7 @@
#include "cache.h"
#include "common/heritage.h"
#include "waiter/cache_waiter.h"
#include "waiter/waiter.h"
#include "vtcp.h"
#include "vtim.h"
......
......@@ -40,7 +40,7 @@
#include "cache.h"
#include "waiter/cache_waiter.h"
#include "waiter/waiter.h"
/*--------------------------------------------------------------------*/
......
......@@ -43,7 +43,7 @@
#include "common/params.h"
#include "mgt/mgt_param.h"
#include "waiter/cache_waiter.h"
#include "waiter/waiter.h"
#include "vav.h"
#include "vcli.h"
#include "vcli_common.h"
......
/*-
* Copyright (c) 2006 Verdens Gang AS
* Copyright (c) 2006-2011 Varnish Software AS
* All rights reserved.
*
* Author: Poul-Henning Kamp <phk@phk.freebsd.dk>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
#include "config.h"
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include "common/common.h"
#include "waiter/waiter.h"
const char *
WAIT_GetName(void)
{
if (waiter != NULL)
return (waiter->name);
else
return ("no_waiter");
}
void
WAIT_Init(void)
{
AN(waiter);
AN(waiter->name);
AN(waiter->init);
AN(waiter->pass);
}
......@@ -42,7 +42,7 @@
#include "cache/cache.h"
#include "waiter/cache_waiter.h"
#include "waiter/waiter.h"
#include "vtim.h"
#ifndef EPOLLRDHUP
......
......@@ -44,7 +44,7 @@
#include "cache/cache.h"
#include "waiter/cache_waiter.h"
#include "waiter/waiter.h"
#include "vtim.h"
#define NKEV 100
......
......@@ -35,7 +35,7 @@
#include "cache/cache.h"
#include "waiter/cache_waiter.h"
#include "waiter/waiter.h"
#include "vtim.h"
#define NEEV 128
......
......@@ -42,7 +42,7 @@
#include "cache/cache.h"
#include "waiter/cache_waiter.h"
#include "waiter/waiter.h"
#include "vtim.h"
#define MAX_EVENTS 256
......
......@@ -35,11 +35,11 @@
#include "common/common.h"
#include "waiter/cache_waiter.h"
#include "waiter/waiter.h"
#include "vcli.h"
#include "vcli_priv.h"
static const struct waiter * const vca_waiters[] = {
static const struct waiter *const vca_waiters[] = {
#if defined(HAVE_KQUEUE)
&waiter_kqueue,
#endif
......@@ -53,17 +53,7 @@ static const struct waiter * const vca_waiters[] = {
NULL,
};
struct waiter const * waiter;
const char *
WAIT_GetName(void)
{
if (waiter != NULL)
return (waiter->name);
else
return ("no_waiter");
}
struct waiter const *waiter;
void
WAIT_tweak_waiter(struct cli *cli, const char *arg)
......@@ -86,7 +76,7 @@ WAIT_tweak_waiter(struct cli *cli, const char *arg)
return;
}
if (!strcmp(arg, "default")) {
waiter = NULL;
waiter = vca_waiters[0];
return;
}
for (i = 0; vca_waiters[i]; i++) {
......@@ -98,16 +88,3 @@ WAIT_tweak_waiter(struct cli *cli, const char *arg)
VCLI_Out(cli, "Unknown waiter");
VCLI_SetResult(cli, CLIS_PARAM);
}
void
WAIT_Init(void)
{
if (waiter == NULL)
waiter = vca_waiters[0];
AN(waiter);
AN(waiter->name);
AN(waiter->init);
AN(waiter->pass);
}
......@@ -39,7 +39,9 @@ struct waiter {
waiter_pass_f *pass;
};
/* mgt_waiter.c */
extern struct waiter const * waiter;
void WAIT_tweak_waiter(struct cli *cli, const char *arg);
#if defined(HAVE_EPOLL_CTL)
extern const struct waiter waiter_epoll;
......@@ -53,12 +55,11 @@ extern const struct waiter waiter_kqueue;
extern const struct waiter waiter_ports;
#endif
extern const struct waiter waiter_poll;
/* cache_session.c */
void SES_Handle(struct sess *sp, int status);
/* cache_waiter.c */
extern const struct waiter waiter_poll;
const char *WAIT_GetName(void);
void WAIT_tweak_waiter(struct cli *cli, const char *arg);
void WAIT_Init(void);
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