]> err.no Git - varnish/commitdiff
Due to lack og foresight,the threads that keep an eye on client connections
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 13 Feb 2009 09:19:50 +0000 (09:19 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 13 Feb 2009 09:19:50 +0000 (09:19 +0000)
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
varnish-cache/bin/varnishd/cache_acceptor.c
varnish-cache/bin/varnishd/cache_waiter.h [moved from varnish-cache/bin/varnishd/cache_acceptor.h with 84% similarity]
varnish-cache/bin/varnishd/cache_waiter_epoll.c [moved from varnish-cache/bin/varnishd/cache_acceptor_epoll.c with 98% similarity]
varnish-cache/bin/varnishd/cache_waiter_kqueue.c [moved from varnish-cache/bin/varnishd/cache_acceptor_kqueue.c with 98% similarity]
varnish-cache/bin/varnishd/cache_waiter_poll.c [moved from varnish-cache/bin/varnishd/cache_acceptor_poll.c with 98% similarity]
varnish-cache/bin/varnishd/cache_waiter_ports.c [moved from varnish-cache/bin/varnishd/cache_acceptor_ports.c with 98% similarity]
varnish-cache/bin/varnishd/common.h
varnish-cache/bin/varnishd/mgt_param.c

index 14c37910f55776ea2e3729a93fff134a483ab83e..1a858527fdd35efab3abef1a051015d6e76a619e 100644 (file)
@@ -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 \
index 65955e177386d0ad7aa03e3d15b5a0cd13370010..28a6a43f02468a7613fa6c7ef02540d5c5d84591 100644 (file)
 #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);
 }
similarity index 84%
rename from varnish-cache/bin/varnishd/cache_acceptor.h
rename to varnish-cache/bin/varnishd/cache_waiter.h
index 9ffd567f10f28a96052bbffc8a7fa57d108722d3..3524004523987c224afd7c558667e4714a64e991 100644 (file)
 
 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 */
similarity index 98%
rename from varnish-cache/bin/varnishd/cache_acceptor_epoll.c
rename to varnish-cache/bin/varnishd/cache_waiter_epoll.c
index 0f323e23d4c1644f484ab3a7baf01af6695e4a69..ec9e87cedb7bacfb81ac6ba7e5d74d922af5bf63 100644 (file)
@@ -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,
 };
similarity index 98%
rename from varnish-cache/bin/varnishd/cache_acceptor_kqueue.c
rename to varnish-cache/bin/varnishd/cache_waiter_kqueue.c
index 22645e8046aade0e919c4bfa5dca3a8425defb29..ab81e55a0432826e5381a79e4e391e34f4852dda 100644 (file)
@@ -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,
 };
similarity index 98%
rename from varnish-cache/bin/varnishd/cache_acceptor_poll.c
rename to varnish-cache/bin/varnishd/cache_waiter_poll.c
index 336edd64c2247315ebca89b396130c0764bf3a9a..fe066995e53a591418d95440a9e7bf2f381165a2 100644 (file)
@@ -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,
 };
similarity index 98%
rename from varnish-cache/bin/varnishd/cache_acceptor_ports.c
rename to varnish-cache/bin/varnishd/cache_waiter_ports.c
index 6a099d697f1de760cb60b5ad0bfa301c29ea29b8..f0d53c8d4e7a4d5843db7f1aaec110b55bc3e1cf 100644 (file)
@@ -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
index 82913efdd66f9d33539fd8b66fe960b2b1688a9d..8b00863a8b35a263db30ce9d2447d087b069870e 100644 (file)
@@ -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);
index 8205a96aa097c3d7b5fbb02810c456ca3a758897..9ba5fa1179790a21d095c956ec75ce92a5e8d79d 100644 (file)
@@ -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,