Browse Source

[mod_balance]: renamed from mod_balancer

personal/stbuehler/wip
Stefan Bühler 11 years ago
parent
commit
be50c790e1
  1. 2
      src/CMakeLists.txt
  2. 8
      src/modules/Makefile.am
  3. 26
      src/modules/mod_balance.c
  4. 2
      src/modules/wscript

2
src/CMakeLists.txt

@ -328,7 +328,7 @@ SET(COMMON_CFLAGS "${LUA_CFLAGS} ${LIBEV_CFLAGS} ${GTHREAD_CFLAGS} ${GMODULE_CFL
ADD_AND_INSTALL_LIBRARY(mod_access "modules/mod_access.c")
ADD_AND_INSTALL_LIBRARY(mod_accesslog "modules/mod_accesslog.c")
ADD_AND_INSTALL_LIBRARY(mod_auth "modules/mod_auth.c")
ADD_AND_INSTALL_LIBRARY(mod_balancer "modules/mod_balancer.c")
ADD_AND_INSTALL_LIBRARY(mod_balance "modules/mod_balance.c")
ADD_AND_INSTALL_LIBRARY(mod_cache_disk_etag "modules/mod_cache_disk_etag.c")
ADD_AND_INSTALL_LIBRARY(mod_debug "modules/mod_debug.c")
ADD_AND_INSTALL_LIBRARY(mod_dirlist "modules/mod_dirlist.c")

8
src/modules/Makefile.am

@ -25,10 +25,10 @@ libmod_auth_la_SOURCES = mod_auth.c
libmod_auth_la_LDFLAGS = $(common_ldflags)
libmod_auth_la_LIBADD = $(common_libadd)
install_libs += libmod_balancer.la
libmod_balancer_la_SOURCES = mod_balancer.c
libmod_balancer_la_LDFLAGS = $(common_ldflags)
libmod_balancer_la_LIBADD = $(common_libadd)
install_libs += libmod_balance.la
libmod_balance_la_SOURCES = mod_balance.c
libmod_balance_la_LDFLAGS = $(common_ldflags)
libmod_balance_la_LIBADD = $(common_libadd)
install_libs += libmod_cache_disk_etag.la
libmod_cache_disk_etag_la_SOURCES = mod_cache_disk_etag.c

26
src/modules/mod_balancer.c → src/modules/mod_balance.c

@ -1,8 +1,8 @@
/*
* mod_balancer - balance between different backends
* mod_balance - balance between different backends
*
* Description:
* mod_balancer balances between different backends;
* mod_balance balances between different backends;
*
* Setups:
* none
@ -26,8 +26,8 @@
#include <lighttpd/base.h>
#include <lighttpd/plugin_core.h>
LI_API gboolean mod_balancer_init(liModules *mods, liModule *mod);
LI_API gboolean mod_balancer_free(liModules *mods, liModule *mod);
LI_API gboolean mod_balance_init(liModules *mods, liModule *mod);
LI_API gboolean mod_balance_free(liModules *mods, liModule *mod);
typedef enum {
BE_ALIVE,
@ -329,7 +329,7 @@ static void _balancer_context_select_backend(balancer *b, gpointer *context, gin
}
static liHandlerResult balancer_act_select(liVRequest *vr, gboolean backlog_provided, gpointer param, gpointer *context) {
balancer *b = (balancer*) param;
balancer *b = param;
bcontext *bc = *context;
gint be_ndx, load;
guint i, j;
@ -460,7 +460,7 @@ static liHandlerResult balancer_act_select(liVRequest *vr, gboolean backlog_prov
}
static liHandlerResult balancer_act_fallback(liVRequest *vr, gboolean backlog_provided, gpointer param, gpointer *context, liBackendError error) {
balancer *b = (balancer*) param;
balancer *b = param;
bcontext *bc = *context;
backend *be;
gboolean debug = _OPTION(vr, b->p, 0).boolean;
@ -497,7 +497,7 @@ static liHandlerResult balancer_act_fallback(liVRequest *vr, gboolean backlog_pr
}
static liHandlerResult balancer_act_finished(liVRequest *vr, gpointer param, gpointer context) {
balancer *b = (balancer*) param;
balancer *b = param;
bcontext *bc = context;
gboolean debug = _OPTION(vr, b->p, 0).boolean;
@ -543,14 +543,14 @@ static liAction* balancer_create(liServer *srv, liWorker *wrk, liPlugin* p, liVa
}
static const liPluginOption options[] = {
{ "balancer.debug", LI_VALUE_BOOLEAN, FALSE, NULL },
{ "balance.debug", LI_VALUE_BOOLEAN, FALSE, NULL },
{ NULL, 0, 0, NULL }
};
static const liPluginAction actions[] = {
{ "balancer.rr", balancer_create, GINT_TO_POINTER(BM_ROUNDROBIN) },
{ "balancer.sqf", balancer_create, GINT_TO_POINTER(BM_SQF) },
{ "balance.rr", balancer_create, GINT_TO_POINTER(BM_ROUNDROBIN) },
{ "balance.sqf", balancer_create, GINT_TO_POINTER(BM_SQF) },
{ NULL, NULL, NULL }
};
@ -568,15 +568,15 @@ static void plugin_init(liServer *srv, liPlugin *p, gpointer userdata) {
}
gboolean mod_balancer_init(liModules *mods, liModule *mod) {
gboolean mod_balance_init(liModules *mods, liModule *mod) {
MODULE_VERSION_CHECK(mods);
mod->config = li_plugin_register(mods->main, "mod_balancer", plugin_init, NULL);
mod->config = li_plugin_register(mods->main, "mod_balance", plugin_init, NULL);
return mod->config != NULL;
}
gboolean mod_balancer_free(liModules *mods, liModule *mod) {
gboolean mod_balance_free(liModules *mods, liModule *mod) {
if (mod->config)
li_plugin_free(mods->main, mod->config);

2
src/modules/wscript

@ -33,7 +33,7 @@ def build(bld):
lighty_mod(bld, 'mod_access', 'mod_access.c')
lighty_mod(bld, 'mod_accesslog', 'mod_accesslog.c')
lighty_mod(bld, 'mod_auth', 'mod_auth.c')
lighty_mod(bld, 'mod_balancer', 'mod_balancer.c')
lighty_mod(bld, 'mod_balance', 'mod_balance.c')
lighty_mod(bld, 'mod_cache_disk_etag', 'mod_cache_disk_etag.c')
uselib = []
if env['HAVE_ZLIB'] == 1:

Loading…
Cancel
Save