Commit 4160eec6 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

build: Merge vdir.c and misc.c into vmod_directors.c

parent 9458b528
......@@ -36,11 +36,10 @@ libvmod_debug_la_SOURCES = \
vmod_debug_dyn.c
libvmod_directors_la_SOURCES = \
vdir.c \
vdir.h \
vmod_directors.c \
vmod_directors.h \
fall_back.c \
hash.c \
misc.c \
random.c \
round_robin.c \
vmod_shard.c \
......
......@@ -37,7 +37,7 @@
#include "vcc_directors_if.h"
#include "vdir.h"
#include "vmod_directors.h"
#include "vsb.h"
#include "vbm.h"
......
......@@ -35,7 +35,7 @@
#include "cache/cache.h"
#include "vdir.h"
#include "vmod_directors.h"
#include "vcc_directors_if.h"
......
/*-
* Copyright 2019 UPLEX - Nils Goroll Systemoptimierung
* All rights reserved.
*
* Author: Nils Goroll <nils.goroll@uplex.de>
*
* SPDX-License-Identifier: BSD-2-Clause
*
* 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 "vdef.h"
#include "vrt.h"
#include "vcl.h"
#include "vcc_directors_if.h"
VCL_BACKEND
VPFX(lookup)(VRT_CTX, VCL_STRING name)
{
if ((ctx->method & VCL_MET_TASK_H) == 0) {
VRT_fail(ctx,
"lookup() may only be called from vcl_init / vcl_fini");
return (NULL);
}
return (VRT_LookupDirector(ctx, name));
}
......@@ -37,7 +37,7 @@
#include "vbm.h"
#include "vrnd.h"
#include "vdir.h"
#include "vmod_directors.h"
#include "vcc_directors_if.h"
......
......@@ -37,7 +37,7 @@
#include "vcc_directors_if.h"
#include "vdir.h"
#include "vmod_directors.h"
struct vmod_directors_round_robin {
unsigned magic;
......
/*-
* Copyright (c) 2013-2015 Varnish Software AS
* Copyright 2019 UPLEX - Nils Goroll Systemoptimierung
* All rights reserved.
*
* Author: Poul-Henning Kamp <phk@FreeBSD.org>
* Author: Nils Goroll <nils.goroll@uplex.de>
*
* SPDX-License-Identifier: BSD-2-Clause
*
......@@ -36,9 +38,24 @@
#include "cache/cache.h"
#include "vbm.h"
#include "vcl.h"
#include "vsb.h"
#include "vdir.h"
#include "vcc_directors_if.h"
#include "vmod_directors.h"
VCL_BACKEND
VPFX(lookup)(VRT_CTX, VCL_STRING name)
{
if ((ctx->method & VCL_MET_TASK_H) == 0) {
VRT_fail(ctx,
"lookup() may only be called from vcl_init / vcl_fini");
return (NULL);
}
return (VRT_LookupDirector(ctx, name));
}
static void
vdir_expand(struct vdir *vd, unsigned n)
......
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