From: phk Date: Fri, 25 Jul 2008 15:27:04 +0000 (+0000) Subject: Add a stevedore for synthetic pages. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7cbd309d9b59aa4fc3d9ef2daac724c9d5ed6bdc;p=varnish Add a stevedore for synthetic pages. The storage from this stevedore is backed by an autoextending vsb, which can be used to generate synthetic pages into. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3025 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/Makefile.am b/varnish-cache/bin/varnishd/Makefile.am index 93524f4f..ebf01107 100644 --- a/varnish-cache/bin/varnishd/Makefile.am +++ b/varnish-cache/bin/varnishd/Makefile.am @@ -51,6 +51,7 @@ varnishd_SOURCES = \ stevedore.c \ storage_file.c \ storage_malloc.c \ + storage_synth.c \ tcp.c \ varnishd.c diff --git a/varnish-cache/bin/varnishd/cache_main.c b/varnish-cache/bin/varnishd/cache_main.c index 4c093a12..6e9ea68d 100644 --- a/varnish-cache/bin/varnishd/cache_main.c +++ b/varnish-cache/bin/varnishd/cache_main.c @@ -121,6 +121,7 @@ child_main(void) VCA_Init(); + SMS_Init(); STV_open(); VSL_stats->start_time = (time_t)TIM_real(); diff --git a/varnish-cache/bin/varnishd/stevedore.c b/varnish-cache/bin/varnishd/stevedore.c index 81971c4c..2e206857 100644 --- a/varnish-cache/bin/varnishd/stevedore.c +++ b/varnish-cache/bin/varnishd/stevedore.c @@ -83,7 +83,7 @@ STV_trim(const struct storage *st, size_t size) } void -STV_free(const struct storage *st) +STV_free(struct storage *st) { CHECK_OBJ_NOTNULL(st, STORAGE_MAGIC); diff --git a/varnish-cache/bin/varnishd/stevedore.h b/varnish-cache/bin/varnishd/stevedore.h index 7f5df8ef..c8d2905a 100644 --- a/varnish-cache/bin/varnishd/stevedore.h +++ b/varnish-cache/bin/varnishd/stevedore.h @@ -39,7 +39,7 @@ typedef void storage_init_f(struct stevedore *, int ac, char * const *av); typedef void storage_open_f(const struct stevedore *); typedef struct storage *storage_alloc_f(struct stevedore *, size_t size); typedef void storage_trim_f(const struct storage *, size_t size); -typedef void storage_free_f(const struct storage *); +typedef void storage_free_f(struct storage *); struct stevedore { unsigned magic; @@ -59,6 +59,9 @@ struct stevedore { struct storage *STV_alloc(struct sess *sp, size_t size); void STV_trim(const struct storage *st, size_t size); -void STV_free(const struct storage *st); +void STV_free(struct storage *st); void STV_add(const struct stevedore *stv, int ac, char * const *av); void STV_open(void); + +/* Synthetic Storage */ +void SMS_Init(void); diff --git a/varnish-cache/bin/varnishd/storage_file.c b/varnish-cache/bin/varnishd/storage_file.c index f244156d..021c4785 100644 --- a/varnish-cache/bin/varnishd/storage_file.c +++ b/varnish-cache/bin/varnishd/storage_file.c @@ -681,7 +681,7 @@ smf_trim(const struct storage *s, size_t size) /*--------------------------------------------------------------------*/ static void -smf_free(const struct storage *s) +smf_free(struct storage *s) { struct smf *smf; struct smf_sc *sc; diff --git a/varnish-cache/bin/varnishd/storage_malloc.c b/varnish-cache/bin/varnishd/storage_malloc.c index 75e6d914..bee45c79 100644 --- a/varnish-cache/bin/varnishd/storage_malloc.c +++ b/varnish-cache/bin/varnishd/storage_malloc.c @@ -86,7 +86,7 @@ sma_alloc(struct stevedore *st, size_t size) } static void -sma_free(const struct storage *s) +sma_free(struct storage *s) { struct sma *sma;