r1730 - trunk/varnish-cache/bin/varnishd
cecilihf at projects.linpro.no
cecilihf at projects.linpro.no
Fri Jul 20 11:06:42 CEST 2007
Author: cecilihf
Date: 2007-07-20 11:06:42 +0200 (Fri, 20 Jul 2007)
New Revision: 1730
Modified:
trunk/varnish-cache/bin/varnishd/cache.h
trunk/varnish-cache/bin/varnishd/cache_main.c
trunk/varnish-cache/bin/varnishd/stevedore.c
trunk/varnish-cache/bin/varnishd/stevedore.h
Log:
Move all use of the stevedore list to stevedore.c
Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h 2007-07-20 08:40:33 UTC (rev 1729)
+++ trunk/varnish-cache/bin/varnishd/cache.h 2007-07-20 09:06:42 UTC (rev 1730)
@@ -216,13 +216,6 @@
#include "stevedore.h"
-/*
- * XXX: in the longer term, we want to support multiple stevedores,
- * XXX: selected by some kind of heuristics based on size, lifetime
- * XXX: etc etc. For now we support only one.
- */
-extern struct stevedore_head *stevedore_h;
-
/* -------------------------------------------------------------------*/
struct object {
Modified: trunk/varnish-cache/bin/varnishd/cache_main.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_main.c 2007-07-20 08:40:33 UTC (rev 1729)
+++ trunk/varnish-cache/bin/varnishd/cache_main.c 2007-07-20 09:06:42 UTC (rev 1730)
@@ -38,7 +38,6 @@
#include "shmlog.h"
#include "cache.h"
-struct stevedore_head *stevedore_h;
/*--------------------------------------------------------------------
* XXX: Think more about which order we start things
@@ -47,8 +46,6 @@
void
child_main(void)
{
- struct stevedore *st;
-
setbuf(stdout, NULL);
setbuf(stderr, NULL);
printf("Child starts\n");
@@ -67,12 +64,8 @@
HSH_Init();
BAN_Init();
- stevedore_h = &heritage.stevedore_h;
- TAILQ_FOREACH(st, stevedore_h, stevedore_list) {
- if (st->open != NULL)
- st->open(st);
- }
-
+ STV_open();
+
printf("Ready\n");
VSL_stats->start_time = (time_t)TIM_real();
Modified: trunk/varnish-cache/bin/varnishd/stevedore.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/stevedore.c 2007-07-20 08:40:33 UTC (rev 1729)
+++ trunk/varnish-cache/bin/varnishd/stevedore.c 2007-07-20 09:06:42 UTC (rev 1730)
@@ -44,6 +44,7 @@
{
struct storage *st;
struct stevedore *stv, *stv_first;
+ struct stevedore_head *stevedore_h = &heritage.stevedore_h;
/* Simple round robin selecting of a stevedore.
*/
@@ -101,7 +102,6 @@
return (0);
}
-
void
STV_add(const char *spec)
{
@@ -131,3 +131,16 @@
if (stp->init != NULL)
stp->init(stp, q);
}
+
+void
+STV_open(void)
+{
+ struct stevedore_head *stevedore_h;
+ struct stevedore *st;
+
+ stevedore_h = &heritage.stevedore_h;
+ TAILQ_FOREACH(st, stevedore_h, stevedore_list) {
+ if (st->open != NULL)
+ st->open(st);
+ }
+}
Modified: trunk/varnish-cache/bin/varnishd/stevedore.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/stevedore.h 2007-07-20 08:40:33 UTC (rev 1729)
+++ trunk/varnish-cache/bin/varnishd/stevedore.h 2007-07-20 09:06:42 UTC (rev 1730)
@@ -59,3 +59,4 @@
void STV_trim(struct storage *st, size_t size);
void STV_free(struct storage *st);
void STV_add(const char *spec);
+void STV_open(void);
More information about the varnish-commit
mailing list