From c87f80686c9e24c305a8c19d71ad78ffeca13f6f Mon Sep 17 00:00:00 2001 From: phk Date: Fri, 13 Feb 2009 09:19:50 +0000 Subject: [PATCH] Due to lack og foresight,the threads that keep an eye on client connections to see if they get reused ended up being named "acceptors", which is a bad name because we have another thread which accepts new connections. Rename the "fake" acceptors to "waiters" git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3758 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/Makefile.am | 10 +++---- varnish-cache/bin/varnishd/cache_acceptor.c | 30 +++++++++---------- .../{cache_acceptor.h => cache_waiter.h} | 18 +++++------ ..._acceptor_epoll.c => cache_waiter_epoll.c} | 4 +-- ...cceptor_kqueue.c => cache_waiter_kqueue.c} | 4 +-- ...he_acceptor_poll.c => cache_waiter_poll.c} | 4 +-- ..._acceptor_ports.c => cache_waiter_ports.c} | 4 +-- varnish-cache/bin/varnishd/common.h | 2 +- varnish-cache/bin/varnishd/mgt_param.c | 10 +++---- 9 files changed, 43 insertions(+), 43 deletions(-) rename varnish-cache/bin/varnishd/{cache_acceptor.h => cache_waiter.h} (84%) rename varnish-cache/bin/varnishd/{cache_acceptor_epoll.c => cache_waiter_epoll.c} (98%) rename varnish-cache/bin/varnishd/{cache_acceptor_kqueue.c => cache_waiter_kqueue.c} (98%) rename varnish-cache/bin/varnishd/{cache_acceptor_poll.c => cache_waiter_poll.c} (98%) rename varnish-cache/bin/varnishd/{cache_acceptor_ports.c => cache_waiter_ports.c} (98%) diff --git a/varnish-cache/bin/varnishd/Makefile.am b/varnish-cache/bin/varnishd/Makefile.am index 14c37910..1a858527 100644 --- a/varnish-cache/bin/varnishd/Makefile.am +++ b/varnish-cache/bin/varnishd/Makefile.am @@ -8,10 +8,10 @@ dist_man_MANS = varnishd.1 varnishd_SOURCES = \ cache_acceptor.c \ - cache_acceptor_epoll.c \ - cache_acceptor_kqueue.c \ - cache_acceptor_poll.c \ - cache_acceptor_ports.c \ + cache_waiter_epoll.c \ + cache_waiter_kqueue.c \ + cache_waiter_poll.c \ + cache_waiter_ports.c \ cache_backend.c \ cache_backend_cfg.c \ cache_backend_poll.c \ @@ -60,7 +60,7 @@ varnishd_SOURCES = \ noinst_HEADERS = \ acct_fields.h \ cache.h \ - cache_acceptor.h \ + cache_waiter.h \ cache_backend.h \ cache_backend_poll.h \ common.h \ diff --git a/varnish-cache/bin/varnishd/cache_acceptor.c b/varnish-cache/bin/varnishd/cache_acceptor.c index 65955e17..28a6a43f 100644 --- a/varnish-cache/bin/varnishd/cache_acceptor.c +++ b/varnish-cache/bin/varnishd/cache_acceptor.c @@ -47,23 +47,23 @@ #include "cli_priv.h" #include "shmlog.h" #include "cache.h" -#include "cache_acceptor.h" +#include "cache_waiter.h" -static struct acceptor * const vca_acceptors[] = { +static struct waiter * const vca_waiters[] = { #if defined(HAVE_KQUEUE) - &acceptor_kqueue, + &waiter_kqueue, #endif #if defined(HAVE_EPOLL_CTL) - &acceptor_epoll, + &waiter_epoll, #endif #if defined(HAVE_PORT_CREATE) - &acceptor_ports, + &waiter_ports, #endif - &acceptor_poll, + &waiter_poll, NULL, }; -static struct acceptor const *vca_act; +static struct waiter const *vca_act; static pthread_t vca_thread_acct; static struct timeval tv_sndtimeo; @@ -322,7 +322,7 @@ ccf_start(struct cli *cli, const char * const *av, void *priv) (void)priv; if (vca_act == NULL) - vca_act = vca_acceptors[0]; + vca_act = vca_waiters[0]; AN(vca_act); AN(vca_act->name); @@ -347,7 +347,7 @@ VCA_Init(void) } void -VCA_tweak_acceptor(struct cli *cli, const char *arg) +VCA_tweak_waiter(struct cli *cli, const char *arg) { int i; @@ -358,9 +358,9 @@ VCA_tweak_acceptor(struct cli *cli, const char *arg) cli_out(cli, "%s", vca_act->name); cli_out(cli, " ("); - for (i = 0; vca_acceptors[i] != NULL; i++) + for (i = 0; vca_waiters[i] != NULL; i++) cli_out(cli, "%s%s", i == 0 ? "" : ", ", - vca_acceptors[i]->name); + vca_waiters[i]->name); cli_out(cli, ")"); return; } @@ -368,12 +368,12 @@ VCA_tweak_acceptor(struct cli *cli, const char *arg) vca_act = NULL; return; } - for (i = 0; vca_acceptors[i]->name; i++) { - if (!strcmp(arg, vca_acceptors[i]->name)) { - vca_act = vca_acceptors[i]; + for (i = 0; vca_waiters[i]->name; i++) { + if (!strcmp(arg, vca_waiters[i]->name)) { + vca_act = vca_waiters[i]; return; } } - cli_out(cli, "Unknown acceptor"); + cli_out(cli, "Unknown waiter"); cli_result(cli, CLIS_PARAM); } diff --git a/varnish-cache/bin/varnishd/cache_acceptor.h b/varnish-cache/bin/varnishd/cache_waiter.h similarity index 84% rename from varnish-cache/bin/varnishd/cache_acceptor.h rename to varnish-cache/bin/varnishd/cache_waiter.h index 9ffd567f..35240045 100644 --- a/varnish-cache/bin/varnishd/cache_acceptor.h +++ b/varnish-cache/bin/varnishd/cache_waiter.h @@ -31,29 +31,29 @@ struct sess; -typedef void acceptor_init_f(void); -typedef void acceptor_pass_f(struct sess *); +typedef void waiter_init_f(void); +typedef void waiter_pass_f(struct sess *); extern int vca_pipes[2]; -struct acceptor { +struct waiter { const char *name; - acceptor_init_f *init; - acceptor_pass_f *pass; + waiter_init_f *init; + waiter_pass_f *pass; }; #if defined(HAVE_EPOLL_CTL) -extern struct acceptor acceptor_epoll; +extern struct waiter waiter_epoll; #endif #if defined(HAVE_KQUEUE) -extern struct acceptor acceptor_kqueue; +extern struct waiter waiter_kqueue; #endif -extern struct acceptor acceptor_poll; +extern struct waiter waiter_poll; #if defined(HAVE_PORT_CREATE) -extern struct acceptor acceptor_ports; +extern struct waiter waiter_ports; #endif /* vca_acceptor.c */ diff --git a/varnish-cache/bin/varnishd/cache_acceptor_epoll.c b/varnish-cache/bin/varnishd/cache_waiter_epoll.c similarity index 98% rename from varnish-cache/bin/varnishd/cache_acceptor_epoll.c rename to varnish-cache/bin/varnishd/cache_waiter_epoll.c index 0f323e23..ec9e87ce 100644 --- a/varnish-cache/bin/varnishd/cache_acceptor_epoll.c +++ b/varnish-cache/bin/varnishd/cache_waiter_epoll.c @@ -45,7 +45,7 @@ #include "shmlog.h" #include "cache.h" -#include "cache_acceptor.h" +#include "cache_waiter.h" static pthread_t vca_epoll_thread; static int epfd = -1; @@ -133,7 +133,7 @@ vca_epoll_init(void) AZ(pthread_create(&vca_epoll_thread, NULL, vca_main, NULL)); } -struct acceptor acceptor_epoll = { +struct waiter waiter_epoll = { .name = "epoll", .init = vca_epoll_init, }; diff --git a/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c b/varnish-cache/bin/varnishd/cache_waiter_kqueue.c similarity index 98% rename from varnish-cache/bin/varnishd/cache_acceptor_kqueue.c rename to varnish-cache/bin/varnishd/cache_waiter_kqueue.c index 22645e80..ab81e55a 100644 --- a/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c +++ b/varnish-cache/bin/varnishd/cache_waiter_kqueue.c @@ -48,7 +48,7 @@ #include "shmlog.h" #include "cache.h" -#include "cache_acceptor.h" +#include "cache_waiter.h" /**********************************************************************/ @@ -217,7 +217,7 @@ vca_kqueue_init(void) AZ(pthread_create(&vca_kqueue_thread, NULL, vca_kqueue_main, NULL)); } -struct acceptor acceptor_kqueue = { +struct waiter waiter_kqueue = { .name = "kqueue", .init = vca_kqueue_init, }; diff --git a/varnish-cache/bin/varnishd/cache_acceptor_poll.c b/varnish-cache/bin/varnishd/cache_waiter_poll.c similarity index 98% rename from varnish-cache/bin/varnishd/cache_acceptor_poll.c rename to varnish-cache/bin/varnishd/cache_waiter_poll.c index 336edd64..fe066995 100644 --- a/varnish-cache/bin/varnishd/cache_acceptor_poll.c +++ b/varnish-cache/bin/varnishd/cache_waiter_poll.c @@ -41,7 +41,7 @@ #include "shmlog.h" #include "cache.h" -#include "cache_acceptor.h" +#include "cache_waiter.h" static pthread_t vca_poll_thread; static struct pollfd *pollfd; @@ -161,7 +161,7 @@ vca_poll_init(void) AZ(pthread_create(&vca_poll_thread, NULL, vca_main, NULL)); } -struct acceptor acceptor_poll = { +struct waiter waiter_poll = { .name = "poll", .init = vca_poll_init, }; diff --git a/varnish-cache/bin/varnishd/cache_acceptor_ports.c b/varnish-cache/bin/varnishd/cache_waiter_ports.c similarity index 98% rename from varnish-cache/bin/varnishd/cache_acceptor_ports.c rename to varnish-cache/bin/varnishd/cache_waiter_ports.c index 6a099d69..f0d53c8d 100644 --- a/varnish-cache/bin/varnishd/cache_acceptor_ports.c +++ b/varnish-cache/bin/varnishd/cache_waiter_ports.c @@ -50,7 +50,7 @@ #include "shmlog.h" #include "cache.h" -#include "cache_acceptor.h" +#include "cache_waiter.h" #define MAX_EVENTS 256 static pthread_t vca_ports_thread; @@ -162,7 +162,7 @@ vca_ports_init(void) AZ(pthread_create(&vca_ports_thread, NULL, vca_main, NULL)); } -struct acceptor acceptor_ports = { +struct waiter waiter_ports = { .name = "ports", .init = vca_ports_init, .pass = vca_ports_pass diff --git a/varnish-cache/bin/varnishd/common.h b/varnish-cache/bin/varnishd/common.h index 82913efd..8b00863a 100644 --- a/varnish-cache/bin/varnishd/common.h +++ b/varnish-cache/bin/varnishd/common.h @@ -33,7 +33,7 @@ struct cli; struct sockaddr; /* cache_acceptor.c */ -void VCA_tweak_acceptor(struct cli *cli, const char *arg); +void VCA_tweak_waiter(struct cli *cli, const char *arg); /* shmlog.c */ void VSL_Panic(int *len, char **ptr); diff --git a/varnish-cache/bin/varnishd/mgt_param.c b/varnish-cache/bin/varnishd/mgt_param.c index 8205a96a..9ba5fa11 100644 --- a/varnish-cache/bin/varnishd/mgt_param.c +++ b/varnish-cache/bin/varnishd/mgt_param.c @@ -413,12 +413,12 @@ tweak_cc_command(struct cli *cli, const struct parspec *par, const char *arg) /*--------------------------------------------------------------------*/ static void -tweak_acceptor(struct cli *cli, const struct parspec *par, const char *arg) +tweak_waiter(struct cli *cli, const struct parspec *par, const char *arg) { /* XXX should have tweak_generic_string */ (void)par; - VCA_tweak_acceptor(cli, arg); + VCA_tweak_waiter(cli, arg); } /*--------------------------------------------------------------------*/ @@ -701,7 +701,7 @@ static const struct parspec input_parspec[] = { "completing.\n" "Setting this too high results in worker threads not doing " "anything for their keep, setting it too low just means that " - "more sessions take a detour around the acceptor.", + "more sessions take a detour around the waiter.", EXPERIMENTAL, "0", "ms" }, { "cli_buffer", tweak_uint, &master.cli_buffer, 4096, UINT_MAX, @@ -726,8 +726,8 @@ static const struct parspec input_parspec[] = { "SessionOpen shared memory record.\n", 0, "off", "bool" }, - { "acceptor", tweak_acceptor, NULL, 0, 0, - "Select the acceptor kernel interface.\n", + { "waiter", tweak_waiter, NULL, 0, 0, + "Select the waiter kernel interface.\n", EXPERIMENTAL | MUST_RESTART, "default", NULL }, { "diag_bitmap", tweak_diag_bitmap, 0, 0, 0, -- 2.39.5