From tfheen at projects.linpro.no Wed Jun 3 09:28:25 2009 From: tfheen at projects.linpro.no (tfheen at projects.linpro.no) Date: Wed, 3 Jun 2009 11:28:25 +0200 (CEST) Subject: r4091 - trunk/varnish-cache/bin/varnishd Message-ID: <20090603092825.0E2951F7C3B@projects.linpro.no> Author: tfheen Date: 2009-06-03 11:28:24 +0200 (Wed, 03 Jun 2009) New Revision: 4091 Modified: trunk/varnish-cache/bin/varnishd/default.vcl Log: Change Varnish footer in default.vcl Hopefully make it slightly more obvious we are just the provider of the caching software in the default vcl_error. Modified: trunk/varnish-cache/bin/varnishd/default.vcl =================================================================== --- trunk/varnish-cache/bin/varnishd/default.vcl 2009-05-29 17:55:24 UTC (rev 4090) +++ trunk/varnish-cache/bin/varnishd/default.vcl 2009-06-03 09:28:24 UTC (rev 4091) @@ -135,8 +135,9 @@

"} obj.response {"

Guru Meditation:

XID: "} req.xid {"

+
- Varnish + Varnish cache server
From sky at projects.linpro.no Wed Jun 3 22:59:59 2009 From: sky at projects.linpro.no (sky at projects.linpro.no) Date: Thu, 4 Jun 2009 00:59:59 +0200 (CEST) Subject: r4092 - trunk/varnish-cache/bin/varnishd Message-ID: <20090603225959.14C051F7C57@projects.linpro.no> Author: sky Date: 2009-06-04 00:59:58 +0200 (Thu, 04 Jun 2009) New Revision: 4092 Removed: trunk/varnish-cache/bin/varnishd/cachw_wrw.c Log: Accidentally added in r4083 Deleted: trunk/varnish-cache/bin/varnishd/cachw_wrw.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cachw_wrw.c 2009-06-03 09:28:24 UTC (rev 4091) +++ trunk/varnish-cache/bin/varnishd/cachw_wrw.c 2009-06-03 22:59:58 UTC (rev 4092) @@ -1,227 +0,0 @@ -/*- - * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2009 Linpro AS - * All rights reserved. - * - * Author: Poul-Henning Kamp - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $Id$ - * - * We maintain a number of worker thread pools, to spread lock contention. - * - * Pools can be added on the fly, as a means to mitigate lock contention, - * but can only be removed again by a restart. (XXX: we could fix that) - * - * Two threads herd the pools, one eliminates idle threads and aggregates - * statistics for all the pools, the other thread creates new threads - * on demand, subject to various numerical constraints. - * - * The algorithm for when to create threads needs to be reactive enough - * to handle startup spikes, but sufficiently attenuated to not cause - * thread pileups. This remains subject for improvement. - */ - -#include "config.h" - -#include -#include - -#ifdef SENDFILE_WORKS -#if defined(__FreeBSD__) || defined(__DragonFly__) -#include -#elif defined(__linux__) -#include -#elif defined(__sun) -#include -#else -#error Unknown sendfile() implementation -#endif -#endif /* SENDFILE_WORKS */ - -#include "shmlog.h" -#include "cache.h" - -/*-------------------------------------------------------------------- - * Write data to fd - * We try to use writev() if possible in order to minimize number of - * syscalls made and packets sent. It also just might allow the worker - * thread to complete the request without holding stuff locked. - */ - -void -WRW_Reserve(struct worker *w, int *fd) -{ - - CHECK_OBJ_NOTNULL(w, WORKER_MAGIC); - AZ(w->wfd); - w->werr = 0; - w->liov = 0; - w->niov = 0; - w->wfd = fd; -} - -void -WRW_Release(struct worker *w) -{ - - CHECK_OBJ_NOTNULL(w, WORKER_MAGIC); - w->werr = 0; - w->liov = 0; - w->niov = 0; - w->wfd = NULL; -} - -unsigned -WRW_Flush(struct worker *w) -{ - ssize_t i; - - CHECK_OBJ_NOTNULL(w, WORKER_MAGIC); - AN(w->wfd); - if (*w->wfd >= 0 && w->niov > 0 && w->werr == 0) { - i = writev(*w->wfd, w->iov, w->niov); - if (i != w->liov) { - w->werr++; - WSL(w, SLT_Debug, *w->wfd, - "Write error, len = %d/%d, errno = %s", - i, w->liov, strerror(errno)); - } - } - w->liov = 0; - w->niov = 0; - return (w->werr); -} - -unsigned -WRW_FlushRelease(struct worker *w) -{ - unsigned u; - - CHECK_OBJ_NOTNULL(w, WORKER_MAGIC); - AN(w->wfd); - u = WRW_Flush(w); - WRW_Release(w); - return (u); -} - -unsigned -WRW_WriteH(struct worker *w, const txt *hh, const char *suf) -{ - unsigned u; - - CHECK_OBJ_NOTNULL(w, WORKER_MAGIC); - AN(w->wfd); - AN(w); - AN(hh); - AN(hh->b); - AN(hh->e); - u = WRW_Write(w, hh->b, hh->e - hh->b); - if (suf != NULL) - u += WRW_Write(w, suf, -1); - return (u); -} - -unsigned -WRW_Write(struct worker *w, const void *ptr, int len) -{ - - CHECK_OBJ_NOTNULL(w, WORKER_MAGIC); - AN(w->wfd); - if (len == 0 || *w->wfd < 0) - return (0); - if (len == -1) - len = strlen(ptr); - if (w->niov == MAX_IOVS) - (void)WRW_Flush(w); - w->iov[w->niov].iov_base = TRUST_ME(ptr); - w->iov[w->niov].iov_len = len; - w->liov += len; - w->niov++; - return (len); -} - -#ifdef SENDFILE_WORKS -void -WRW_Sendfile(struct worker *w, int fd, off_t off, unsigned len) -{ - - CHECK_OBJ_NOTNULL(w, WORKER_MAGIC); - AN(w->wfd); - assert(fd >= 0); - assert(len > 0); - -#if defined(__FreeBSD__) || defined(__DragonFly__) - do { - struct sf_hdtr sfh; - memset(&sfh, 0, sizeof sfh); - if (w->niov > 0) { - sfh.headers = w->iov; - sfh.hdr_cnt = w->niov; - } - if (sendfile(fd, *w->wfd, off, len, &sfh, NULL, 0) != 0) - w->werr++; - w->liov = 0; - w->niov = 0; - } while (0); -#elif defined(__linux__) - do { - if (WRK_Flush(w) == 0 && - sendfile(*w->wfd, fd, &off, len) != len) - w->werr++; - } while (0); -#elif defined(__sun) && defined(HAVE_SENDFILEV) - do { - sendfilevec_t svvec[HTTP_HDR_MAX * 2 + 1]; - size_t xferred = 0, expected = 0; - int i; - for (i = 0; i < w->niov; i++) { - svvec[i].sfv_fd = SFV_FD_SELF; - svvec[i].sfv_flag = 0; - svvec[i].sfv_off = (off_t) w->iov[i].iov_base; - svvec[i].sfv_len = w->iov[i].iov_len; - expected += svvec[i].sfv_len; - } - svvec[i].sfv_fd = fd; - svvec[i].sfv_flag = 0; - svvec[i].sfv_off = off; - svvec[i].sfv_len = len; - expected += svvec[i].sfv_len; - if (sendfilev(*w->wfd, svvec, i, &xferred) == -1 || - xferred != expected) - w->werr++; - w->liov = 0; - w->niov = 0; - } while (0); -#elif defined(__sun) && defined(HAVE_SENDFILE) - do { - if (WRK_Flush(w) == 0 && - sendfile(*w->wfd, fd, &off, len) != len) - w->werr++; - } while (0); -#else -#error Unknown sendfile() implementation -#endif -} -#endif /* SENDFILE_WORKS */ - From des at projects.linpro.no Sat Jun 6 15:56:17 2009 From: des at projects.linpro.no (des at projects.linpro.no) Date: Sat, 6 Jun 2009 17:56:17 +0200 (CEST) Subject: r4093 - in trunk/varnish-cache: bin/varnishadm bin/varnishd bin/varnishhist bin/varnishlog bin/varnishncsa bin/varnishreplay bin/varnishstat bin/varnishtest bin/varnishtop include lib/libvarnish lib/libvarnishapi lib/libvarnishcompat lib/libvcl Message-ID: <20090606155617.8A9361F7C34@projects.linpro.no> Author: des Date: 2009-06-06 17:56:17 +0200 (Sat, 06 Jun 2009) New Revision: 4093 Added: trunk/varnish-cache/include/svnid.h Modified: trunk/varnish-cache/bin/varnishadm/varnishadm.c trunk/varnish-cache/bin/varnishd/cache_acceptor.c trunk/varnish-cache/bin/varnishd/cache_backend.c trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c trunk/varnish-cache/bin/varnishd/cache_backend_poll.c trunk/varnish-cache/bin/varnishd/cache_ban.c trunk/varnish-cache/bin/varnishd/cache_center.c trunk/varnish-cache/bin/varnishd/cache_cli.c trunk/varnish-cache/bin/varnishd/cache_dir_random.c trunk/varnish-cache/bin/varnishd/cache_dir_round_robin.c trunk/varnish-cache/bin/varnishd/cache_dir_simple.c trunk/varnish-cache/bin/varnishd/cache_esi.c trunk/varnish-cache/bin/varnishd/cache_expire.c trunk/varnish-cache/bin/varnishd/cache_fetch.c trunk/varnish-cache/bin/varnishd/cache_hash.c trunk/varnish-cache/bin/varnishd/cache_http.c trunk/varnish-cache/bin/varnishd/cache_httpconn.c trunk/varnish-cache/bin/varnishd/cache_lck.c trunk/varnish-cache/bin/varnishd/cache_main.c trunk/varnish-cache/bin/varnishd/cache_panic.c trunk/varnish-cache/bin/varnishd/cache_pipe.c trunk/varnish-cache/bin/varnishd/cache_pool.c trunk/varnish-cache/bin/varnishd/cache_response.c trunk/varnish-cache/bin/varnishd/cache_session.c trunk/varnish-cache/bin/varnishd/cache_vary.c trunk/varnish-cache/bin/varnishd/cache_vcl.c trunk/varnish-cache/bin/varnishd/cache_vrt.c trunk/varnish-cache/bin/varnishd/cache_vrt_re.c trunk/varnish-cache/bin/varnishd/cache_waiter_epoll.c trunk/varnish-cache/bin/varnishd/cache_waiter_kqueue.c trunk/varnish-cache/bin/varnishd/cache_waiter_poll.c trunk/varnish-cache/bin/varnishd/cache_waiter_ports.c trunk/varnish-cache/bin/varnishd/cache_wrw.c trunk/varnish-cache/bin/varnishd/cache_ws.c trunk/varnish-cache/bin/varnishd/hash_classic.c trunk/varnish-cache/bin/varnishd/hash_critbit.c trunk/varnish-cache/bin/varnishd/hash_simple_list.c trunk/varnish-cache/bin/varnishd/mgt_child.c trunk/varnish-cache/bin/varnishd/mgt_cli.c trunk/varnish-cache/bin/varnishd/mgt_param.c trunk/varnish-cache/bin/varnishd/mgt_pool.c trunk/varnish-cache/bin/varnishd/mgt_vcc.c trunk/varnish-cache/bin/varnishd/rfc2616.c trunk/varnish-cache/bin/varnishd/shmlog.c trunk/varnish-cache/bin/varnishd/stevedore.c trunk/varnish-cache/bin/varnishd/stevedore_utils.c trunk/varnish-cache/bin/varnishd/storage_file.c trunk/varnish-cache/bin/varnishd/storage_malloc.c trunk/varnish-cache/bin/varnishd/storage_persistent.c trunk/varnish-cache/bin/varnishd/storage_synth.c trunk/varnish-cache/bin/varnishd/storage_umem.c trunk/varnish-cache/bin/varnishd/varnishd.c trunk/varnish-cache/bin/varnishhist/varnishhist.c trunk/varnish-cache/bin/varnishlog/varnishlog.c trunk/varnish-cache/bin/varnishncsa/varnishncsa.c trunk/varnish-cache/bin/varnishreplay/varnishreplay.c trunk/varnish-cache/bin/varnishstat/varnishstat.c trunk/varnish-cache/bin/varnishtest/vtc.c trunk/varnish-cache/bin/varnishtest/vtc_client.c trunk/varnish-cache/bin/varnishtest/vtc_http.c trunk/varnish-cache/bin/varnishtest/vtc_log.c trunk/varnish-cache/bin/varnishtest/vtc_sema.c trunk/varnish-cache/bin/varnishtest/vtc_server.c trunk/varnish-cache/bin/varnishtest/vtc_varnish.c trunk/varnish-cache/bin/varnishtop/varnishtop.c trunk/varnish-cache/include/Makefile.am trunk/varnish-cache/lib/libvarnish/argv.c trunk/varnish-cache/lib/libvarnish/assert.c trunk/varnish-cache/lib/libvarnish/binary_heap.c trunk/varnish-cache/lib/libvarnish/cli.c trunk/varnish-cache/lib/libvarnish/cli_common.c trunk/varnish-cache/lib/libvarnish/flopen.c trunk/varnish-cache/lib/libvarnish/inxorcise.c trunk/varnish-cache/lib/libvarnish/num.c trunk/varnish-cache/lib/libvarnish/subproc.c trunk/varnish-cache/lib/libvarnish/tcp.c trunk/varnish-cache/lib/libvarnish/time.c trunk/varnish-cache/lib/libvarnish/vct.c trunk/varnish-cache/lib/libvarnish/version.c trunk/varnish-cache/lib/libvarnish/vev.c trunk/varnish-cache/lib/libvarnish/vlu.c trunk/varnish-cache/lib/libvarnish/vpf.c trunk/varnish-cache/lib/libvarnish/vsb.c trunk/varnish-cache/lib/libvarnish/vsha256.c trunk/varnish-cache/lib/libvarnish/vss.c trunk/varnish-cache/lib/libvarnish/vtmpfile.c trunk/varnish-cache/lib/libvarnishapi/base64.c trunk/varnish-cache/lib/libvarnishapi/instance.c trunk/varnish-cache/lib/libvarnishapi/shmlog.c trunk/varnish-cache/lib/libvarnishcompat/asprintf.c trunk/varnish-cache/lib/libvarnishcompat/daemon.c trunk/varnish-cache/lib/libvarnishcompat/execinfo.c trunk/varnish-cache/lib/libvarnishcompat/setproctitle.c trunk/varnish-cache/lib/libvarnishcompat/srandomdev.c trunk/varnish-cache/lib/libvarnishcompat/strlcat.c trunk/varnish-cache/lib/libvarnishcompat/strlcpy.c trunk/varnish-cache/lib/libvarnishcompat/strndup.c trunk/varnish-cache/lib/libvarnishcompat/vasprintf.c trunk/varnish-cache/lib/libvcl/vcc_acl.c trunk/varnish-cache/lib/libvcl/vcc_action.c trunk/varnish-cache/lib/libvcl/vcc_backend.c trunk/varnish-cache/lib/libvcl/vcc_compile.c trunk/varnish-cache/lib/libvcl/vcc_dir_random.c trunk/varnish-cache/lib/libvcl/vcc_dir_round_robin.c trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c trunk/varnish-cache/lib/libvcl/vcc_obj.c trunk/varnish-cache/lib/libvcl/vcc_parse.c trunk/varnish-cache/lib/libvcl/vcc_string.c trunk/varnish-cache/lib/libvcl/vcc_token.c trunk/varnish-cache/lib/libvcl/vcc_var.c trunk/varnish-cache/lib/libvcl/vcc_xref.c Log: Embed RCS tag in each compiled file. Modified: trunk/varnish-cache/bin/varnishadm/varnishadm.c =================================================================== --- trunk/varnish-cache/bin/varnishadm/varnishadm.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishadm/varnishadm.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,12 +25,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_acceptor.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_acceptor.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,12 +26,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_backend.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_backend.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_backend.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,14 +26,15 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Handle backend connections and backend request structures. * */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,14 +26,15 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Handle configuration of backends from VCL programs. * */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_backend_poll.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_backend_poll.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_backend_poll.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,8 +26,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Poll backends for collection of health statistics * * We co-opt threads from the worker pool for probing the backends, @@ -39,6 +37,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_ban.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_ban.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_ban.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,8 +26,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Ban ("purge") processing * * A ban consists of a number of conditions (or tests), all of which must be @@ -44,6 +42,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_center.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_center.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_center.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,8 +26,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * This file contains the central state machine for pushing requests. * * We cannot just use direct calls because it is possible to kick a @@ -59,6 +57,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_cli.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_cli.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_cli.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,8 +26,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Caching process CLI handling. * * We only have one CLI source, the stdin/stdout pipes from the manager @@ -38,6 +36,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_dir_random.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_dir_random.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_dir_random.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,12 +26,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_dir_round_robin.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_dir_round_robin.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_dir_round_robin.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,12 +25,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_dir_simple.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_dir_simple.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_dir_simple.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,12 +26,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_esi.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_esi.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_esi.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,8 +26,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Runtime support for compiled VCL programs ESI processing. * * The basic ESI 1.0 is a very simple specification: @@ -42,6 +40,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_expire.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_expire.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_expire.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,8 +26,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * LRU and object timer handling. * * We have two data structures, a LRU-list and a binary heap for the timers @@ -51,6 +49,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_fetch.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_fetch.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,12 +25,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_hash.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_hash.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,8 +26,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * This is the central hash-table code, it relies on a chosen hash * implementation only for the actual hashing, all the housekeeping * happens here. @@ -54,6 +52,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_http.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_http.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_http.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,13 +26,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * HTTP request storage and manipulation */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_httpconn.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_httpconn.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_httpconn.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,13 +26,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * HTTP protocol requests */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_lck.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_lck.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_lck.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,8 +25,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * The geniuses who came up with pthreads did not think operations like * pthread_assert_mutex_held() were important enough to include them in * the API. @@ -37,6 +35,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_main.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_main.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_main.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,12 +25,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_panic.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_panic.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_panic.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,12 +25,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_pipe.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_pipe.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_pipe.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,13 +26,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * XXX: charge bytes to srcaddr */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_pool.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_pool.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_pool.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,8 +26,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * We maintain a number of worker thread pools, to spread lock contention. * * Pools can be added on the fly, as a means to mitigate lock contention, @@ -44,6 +42,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_response.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_response.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_response.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,12 +25,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_session.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_session.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_session.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,8 +26,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Session and Client management. * * XXX: The two-list session management is actually not a good idea @@ -42,6 +40,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_vary.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vary.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_vary.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,8 +25,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Do Vary processing. * * When we insert an object into the cache which has a Vary: header, @@ -56,6 +54,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_vcl.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vcl.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_vcl.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,8 +26,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Interface *to* compiled VCL code: Loading, unloading, calling into etc. * * The interface *from* the compiled VCL code is in cache_vrt.c. @@ -35,6 +33,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vrt.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_vrt.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,13 +26,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Runtime support for compiled VCL programs */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_vrt_re.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vrt_re.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_vrt_re.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,13 +26,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Runtime support for compiled VCL programs, regexps */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_waiter_epoll.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_waiter_epoll.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_waiter_epoll.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,8 +26,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * XXX: We need to pass sessions back into the event engine when they are * reused. Not sure what the most efficient way is for that. For now * write the session pointer to a pipe which the event engine monitors. @@ -35,6 +33,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #if defined(HAVE_EPOLL_CTL) #include Modified: trunk/varnish-cache/bin/varnishd/cache_waiter_kqueue.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_waiter_kqueue.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_waiter_kqueue.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,8 +26,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * XXX: We need to pass sessions back into the event engine when they are * reused. Not sure what the most efficient way is for that. For now * write the session pointer to a pipe which the event engine monitors. @@ -35,6 +33,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #if defined(HAVE_KQUEUE) #include Modified: trunk/varnish-cache/bin/varnishd/cache_waiter_poll.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_waiter_poll.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_waiter_poll.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,12 +26,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_waiter_ports.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_waiter_ports.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_waiter_ports.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,14 +26,15 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * XXX: We need to pass sessions back into the event engine when they are * reused. Not sure what the most efficient way is for that. For now * write the session pointer to a pipe which the event engine monitors. */ #include "config.h" + +#include "svnid.h" +SVNID("$Id$") #if defined(HAVE_PORT_CREATE) #include Modified: trunk/varnish-cache/bin/varnishd/cache_wrw.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_wrw.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_wrw.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,8 +26,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cache_pool.c 4069 2009-05-11 08:57:00Z phk $ - * * We maintain a number of worker thread pools, to spread lock contention. * * Pools can be added on the fly, as a means to mitigate lock contention, @@ -44,6 +42,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id: cache_pool.c 4069 2009-05-11 08:57:00Z phk $") + #include #include Modified: trunk/varnish-cache/bin/varnishd/cache_ws.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_ws.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/cache_ws.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,12 +26,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/bin/varnishd/hash_classic.c =================================================================== --- trunk/varnish-cache/bin/varnishd/hash_classic.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/hash_classic.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,13 +26,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * A classic bucketed hash */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/hash_critbit.c =================================================================== --- trunk/varnish-cache/bin/varnishd/hash_critbit.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/hash_critbit.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,8 +25,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * A Crit Bit tree based hash */ @@ -34,6 +32,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/hash_simple_list.c =================================================================== --- trunk/varnish-cache/bin/varnishd/hash_simple_list.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/hash_simple_list.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,13 +26,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * This is the reference hash(/lookup) implementation */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/mgt_child.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_child.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/mgt_child.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,13 +26,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * The mechanics of handling the child process */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/mgt_cli.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_cli.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/mgt_cli.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,13 +26,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * The management process' CLI handling */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/bin/varnishd/mgt_param.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_param.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/mgt_param.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,12 +25,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/bin/varnishd/mgt_pool.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_pool.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/mgt_pool.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,8 +26,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cache_pool.c 3429 2008-11-24 17:47:21Z phk $ - * * We maintain a number of worker thread pools, to spread lock contention. * * Pools can be added on the fly, as a means to mitigate lock contention, @@ -43,6 +41,9 @@ */ #include "config.h" + +#include "svnid.h" +SVNID("$Id: cache_pool.c 3429 2008-11-24 17:47:21Z phk $") #include #include Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,13 +26,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * VCL compiler stuff */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/bin/varnishd/rfc2616.c =================================================================== --- trunk/varnish-cache/bin/varnishd/rfc2616.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/rfc2616.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,12 +25,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/bin/varnishd/shmlog.c =================================================================== --- trunk/varnish-cache/bin/varnishd/shmlog.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/shmlog.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,12 +25,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/stevedore.c =================================================================== --- trunk/varnish-cache/bin/varnishd/stevedore.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/stevedore.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -24,12 +24,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/stevedore_utils.c =================================================================== --- trunk/varnish-cache/bin/varnishd/stevedore_utils.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/stevedore_utils.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,13 +26,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Utility functions for stevedores and storage modules */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/storage_file.c =================================================================== --- trunk/varnish-cache/bin/varnishd/storage_file.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/storage_file.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,13 +26,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Storage method based on mmap'ed file */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/storage_malloc.c =================================================================== --- trunk/varnish-cache/bin/varnishd/storage_malloc.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/storage_malloc.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,13 +26,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Storage method based on malloc(3) */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/bin/varnishd/storage_persistent.c =================================================================== --- trunk/varnish-cache/bin/varnishd/storage_persistent.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/storage_persistent.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,8 +25,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Persistent storage method * * XXX: Before we start the client or maybe after it stops, we should give the @@ -35,6 +33,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishd/storage_synth.c =================================================================== --- trunk/varnish-cache/bin/varnishd/storage_synth.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/storage_synth.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,13 +25,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Storage method for synthetic content, based on vsb. */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/bin/varnishd/storage_umem.c =================================================================== --- trunk/varnish-cache/bin/varnishd/storage_umem.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/storage_umem.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,13 +26,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Storage method based on umem_alloc(3MALLOC) */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #ifdef HAVE_LIBUMEM #include Modified: trunk/varnish-cache/bin/varnishd/varnishd.c =================================================================== --- trunk/varnish-cache/bin/varnishd/varnishd.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishd/varnishd.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,13 +26,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * The management process and CLI handling */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/bin/varnishhist/varnishhist.c =================================================================== --- trunk/varnish-cache/bin/varnishhist/varnishhist.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishhist/varnishhist.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -27,13 +27,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Log tailer for Varnish */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishlog/varnishlog.c =================================================================== --- trunk/varnish-cache/bin/varnishlog/varnishlog.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishlog/varnishlog.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,13 +26,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Log tailer for Varnish */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishncsa/varnishncsa.c =================================================================== --- trunk/varnish-cache/bin/varnishncsa/varnishncsa.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishncsa/varnishncsa.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -27,8 +27,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Obtain log data from the shared memory log, order it by session ID, and * display it in Apache / NCSA combined log format: * @@ -61,6 +59,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishreplay/varnishreplay.c =================================================================== --- trunk/varnish-cache/bin/varnishreplay/varnishreplay.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishreplay/varnishreplay.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -24,12 +24,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishstat/varnishstat.c =================================================================== --- trunk/varnish-cache/bin/varnishstat/varnishstat.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishstat/varnishstat.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -27,13 +27,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Log tailer for Varnish */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/bin/varnishtest/vtc.c =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishtest/vtc.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -24,12 +24,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishtest/vtc_client.c =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc_client.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishtest/vtc_client.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -24,12 +24,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishtest/vtc_http.c =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc_http.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishtest/vtc_http.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -24,12 +24,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishtest/vtc_log.c =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc_log.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishtest/vtc_log.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -24,12 +24,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishtest/vtc_sema.c =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc_sema.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishtest/vtc_sema.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -24,12 +24,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishtest/vtc_server.c =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc_server.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishtest/vtc_server.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -24,12 +24,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/bin/varnishtest/vtc_varnish.c =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc_varnish.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishtest/vtc_varnish.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -24,12 +24,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/bin/varnishtop/varnishtop.c =================================================================== --- trunk/varnish-cache/bin/varnishtop/varnishtop.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/bin/varnishtop/varnishtop.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -27,13 +27,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Log tailer for Varnish */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/include/Makefile.am =================================================================== --- trunk/varnish-cache/include/Makefile.am 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/include/Makefile.am 2009-06-06 15:56:17 UTC (rev 4093) @@ -29,6 +29,7 @@ miniobj.h \ persistent.h \ purge_vars.h \ + svnid.h \ vsha256.h \ vqueue.h \ vpf.h \ Added: trunk/varnish-cache/include/svnid.h =================================================================== --- trunk/varnish-cache/include/svnid.h (rev 0) +++ trunk/varnish-cache/include/svnid.h 2009-06-06 15:56:17 UTC (rev 4093) @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2009 Dag-Erling Co?dan Sm?rgrav + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $Id$ + */ + +#ifndef SVNID_H_INCLUDED +#define SVNID_H_INCLUDED + +#define SVNID(id) \ + static const char *svnid __attribute__((__unused__)) = id; + +#endif Property changes on: trunk/varnish-cache/include/svnid.h ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native Modified: trunk/varnish-cache/lib/libvarnish/argv.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/argv.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnish/argv.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,8 +26,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * const char **ParseArgv(const char *s, int comment) * Parse a command like line into an argv[] * Index zero contains NULL or an error message @@ -40,6 +38,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/lib/libvarnish/assert.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/assert.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnish/assert.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,13 +26,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * This is the default backend function for libvarnish' assert facilities. */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/lib/libvarnish/binary_heap.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/binary_heap.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnish/binary_heap.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,8 +26,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Implementation of a binary heap API * * We use a malloc(3)/realloc(3) array to store the pointers using the @@ -36,6 +34,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/lib/libvarnish/cli.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/cli.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnish/cli.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,13 +26,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Stuff for handling the CLI protocol */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/lib/libvarnish/cli_common.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/cli_common.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnish/cli_common.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,12 +25,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/lib/libvarnish/flopen.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/flopen.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnish/flopen.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -23,14 +23,15 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ * Derived from: * $FreeBSD: head/lib/libutil/flopen.c 184094 2008-10-20 18:11:30Z des $ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/lib/libvarnish/inxorcise.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/inxorcise.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnish/inxorcise.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,8 +26,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * This file only exists because Apple has decided to break a * function that has an age old tradition and force the user * to use launchd instead. @@ -38,6 +36,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/lib/libvarnish/num.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/num.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnish/num.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,13 +25,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Deal with numbers with data storage suffix scaling */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/lib/libvarnish/subproc.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/subproc.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnish/subproc.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,13 +26,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Run stuff in a child process */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/lib/libvarnish/tcp.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/tcp.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnish/tcp.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,12 +25,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/lib/libvarnish/time.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/time.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnish/time.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,8 +26,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Semi-trivial functions to handle HTTP header timestamps according to * RFC 2616 section 3.3. * @@ -48,6 +46,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/lib/libvarnish/vct.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/vct.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnish/vct.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,13 +25,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * ctype(3) like functions, according to RFC2616 */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include /* NB: VCT always operate in ASCII, don't replace 0x0d with \r etc. */ Modified: trunk/varnish-cache/lib/libvarnish/version.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/version.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnish/version.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,13 +26,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Display a standardized version message. */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include "libvarnish.h" Modified: trunk/varnish-cache/lib/libvarnish/vev.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/vev.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnish/vev.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,12 +25,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/lib/libvarnish/vlu.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/vlu.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnish/vlu.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -23,14 +23,15 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * Functions for assembling a bytestream into text-lines and calling * a function on each. */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/lib/libvarnish/vpf.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/vpf.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnish/vpf.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -22,14 +22,15 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ * Derived from: * $FreeBSD: head/lib/libutil/pidfile.c 184091 2008-10-20 17:41:08Z des $ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/lib/libvarnish/vsb.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/vsb.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnish/vsb.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -22,13 +22,14 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $Id$ * $FreeBSD: src/sys/kern/subr_sbuf.c,v 1.30 2005/12/23 11:49:53 phk Exp $ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/lib/libvarnish/vsha256.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/vsha256.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnish/vsha256.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -28,6 +28,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/lib/libvarnish/vss.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/vss.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnish/vss.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,12 +26,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/lib/libvarnish/vtmpfile.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/vtmpfile.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnish/vtmpfile.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,12 +25,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/lib/libvarnishapi/base64.c =================================================================== --- trunk/varnish-cache/lib/libvarnishapi/base64.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnishapi/base64.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -2,12 +2,13 @@ * Written by Poul-Henning Kamp * * This file is in the public domain. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include "varnishapi.h" Modified: trunk/varnish-cache/lib/libvarnishapi/instance.c =================================================================== --- trunk/varnish-cache/lib/libvarnishapi/instance.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnishapi/instance.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -24,12 +24,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/lib/libvarnishapi/shmlog.c =================================================================== --- trunk/varnish-cache/lib/libvarnishapi/shmlog.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnishapi/shmlog.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,12 +25,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/lib/libvarnishcompat/asprintf.c =================================================================== --- trunk/varnish-cache/lib/libvarnishcompat/asprintf.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnishcompat/asprintf.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,12 +26,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #ifndef HAVE_ASPRINTF #include Modified: trunk/varnish-cache/lib/libvarnishcompat/daemon.c =================================================================== --- trunk/varnish-cache/lib/libvarnishcompat/daemon.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnishcompat/daemon.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,14 +25,15 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ * Derived from: * $FreeBSD: src/lib/libc/gen/daemon.c,v 1.8 2007/01/09 00:27:53 imp Exp $ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #ifndef HAVE_DAEMON #include Modified: trunk/varnish-cache/lib/libvarnishcompat/execinfo.c =================================================================== --- trunk/varnish-cache/lib/libvarnishcompat/execinfo.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnishcompat/execinfo.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -22,12 +22,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id: execinfo.c,v 1.3 2004/07/19 05:21:09 sobomax Exp $ */ #include "config.h" +#include "svnid.h" +SVNID("$Id: execinfo.c,v 1.3 2004/07/19 05:21:09 sobomax Exp $") + #include #include #include Modified: trunk/varnish-cache/lib/libvarnishcompat/setproctitle.c =================================================================== --- trunk/varnish-cache/lib/libvarnishcompat/setproctitle.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnishcompat/setproctitle.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,12 +25,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #ifndef HAVE_SETPROCTITLE #include Modified: trunk/varnish-cache/lib/libvarnishcompat/srandomdev.c =================================================================== --- trunk/varnish-cache/lib/libvarnishcompat/srandomdev.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnishcompat/srandomdev.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,12 +25,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #ifndef HAVE_SRANDOMDEV #include Modified: trunk/varnish-cache/lib/libvarnishcompat/strlcat.c =================================================================== --- trunk/varnish-cache/lib/libvarnishcompat/strlcat.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnishcompat/strlcat.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -19,6 +19,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #ifndef HAVE_STRLCAT #include Modified: trunk/varnish-cache/lib/libvarnishcompat/strlcpy.c =================================================================== --- trunk/varnish-cache/lib/libvarnishcompat/strlcpy.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnishcompat/strlcpy.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -19,6 +19,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #ifndef HAVE_STRLCPY #include Modified: trunk/varnish-cache/lib/libvarnishcompat/strndup.c =================================================================== --- trunk/varnish-cache/lib/libvarnishcompat/strndup.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnishcompat/strndup.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,12 +26,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #ifndef HAVE_STRNDUP #include Modified: trunk/varnish-cache/lib/libvarnishcompat/vasprintf.c =================================================================== --- trunk/varnish-cache/lib/libvarnishcompat/vasprintf.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvarnishcompat/vasprintf.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,12 +26,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #ifndef HAVE_VASPRINTF #include Modified: trunk/varnish-cache/lib/libvcl/vcc_acl.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_acl.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvcl/vcc_acl.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,12 +25,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_action.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvcl/vcc_action.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,12 +25,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/lib/libvcl/vcc_backend.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_backend.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvcl/vcc_backend.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,8 +26,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * A necessary explanation of a convoluted policy: * * In VCL we have backends and directors. @@ -52,6 +50,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ /* @@ -62,6 +60,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/lib/libvcl/vcc_dir_random.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_dir_random.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvcl/vcc_dir_random.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,12 +25,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/lib/libvcl/vcc_dir_round_robin.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_dir_round_robin.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvcl/vcc_dir_round_robin.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -24,12 +24,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -7,6 +7,9 @@ */ #include "config.h" + +#include "svnid.h" +SVNID("$Id$") #include #include #include "config.h" Modified: trunk/varnish-cache/lib/libvcl/vcc_obj.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_obj.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvcl/vcc_obj.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -7,6 +7,9 @@ */ #include "config.h" + +#include "svnid.h" +SVNID("$Id$") #include #include "vcc_compile.h" Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_parse.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvcl/vcc_parse.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,12 +25,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/lib/libvcl/vcc_string.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_string.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvcl/vcc_string.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,12 +25,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/lib/libvcl/vcc_token.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_token.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvcl/vcc_token.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,12 +25,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include #include Modified: trunk/varnish-cache/lib/libvcl/vcc_var.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_var.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvcl/vcc_var.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -25,12 +25,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id$ */ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include Modified: trunk/varnish-cache/lib/libvcl/vcc_xref.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_xref.c 2009-06-03 22:59:58 UTC (rev 4092) +++ trunk/varnish-cache/lib/libvcl/vcc_xref.c 2009-06-06 15:56:17 UTC (rev 4093) @@ -26,8 +26,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ - * * This file contains code for two cross-reference or consistency checks. * * The first check is simply that all functions, acls and backends are @@ -41,6 +39,9 @@ #include "config.h" +#include "svnid.h" +SVNID("$Id$") + #include #include "vsb.h" From des at projects.linpro.no Sat Jun 6 15:59:05 2009 From: des at projects.linpro.no (des at projects.linpro.no) Date: Sat, 6 Jun 2009 17:59:05 +0200 (CEST) Subject: r4094 - trunk/varnish-cache/lib/libvcl Message-ID: <20090606155905.BCDD01F7C4A@projects.linpro.no> Author: des Date: 2009-06-06 17:59:05 +0200 (Sat, 06 Jun 2009) New Revision: 4094 Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c trunk/varnish-cache/lib/libvcl/vcc_obj.c Log: Regenerate Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2009-06-06 15:56:17 UTC (rev 4093) +++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2009-06-06 15:59:05 UTC (rev 4094) @@ -7,9 +7,6 @@ */ #include "config.h" - -#include "svnid.h" -SVNID("$Id$") #include #include #include "config.h" @@ -325,7 +322,7 @@ /* ../../include/vrt_obj.h */ - vsb_cat(sb, "/*\n * $Id: vcc_gen_obj.tcl 3949 2009-03-18 12:10:46Z "); + vsb_cat(sb, "/*\n * $Id: vcc_gen_obj.tcl 4066 2009-05-10 21:21:36Z "); vsb_cat(sb, "sky $\n *\n * NB: This file is machine generated, DO "); vsb_cat(sb, "NOT EDIT!\n *\n * Edit vcc_gen_obj.tcl instead\n"); vsb_cat(sb, " */\n\nstruct sockaddr * VRT_r_client_ip(const struct "); Modified: trunk/varnish-cache/lib/libvcl/vcc_obj.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_obj.c 2009-06-06 15:56:17 UTC (rev 4093) +++ trunk/varnish-cache/lib/libvcl/vcc_obj.c 2009-06-06 15:59:05 UTC (rev 4094) @@ -7,9 +7,6 @@ */ #include "config.h" - -#include "svnid.h" -SVNID("$Id$") #include #include "vcc_compile.h" From des at projects.linpro.no Sat Jun 6 16:01:39 2009 From: des at projects.linpro.no (des at projects.linpro.no) Date: Sat, 6 Jun 2009 18:01:39 +0200 (CEST) Subject: r4095 - trunk/varnish-cache/lib/libvcl Message-ID: <20090606160139.8E2191F7C34@projects.linpro.no> Author: des Date: 2009-06-06 18:01:39 +0200 (Sat, 06 Jun 2009) New Revision: 4095 Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c trunk/varnish-cache/lib/libvcl/vcc_obj.c Log: Re-regenerate and remove svn:keywords, so the generated files now contain the version tag from the script that generated them. Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2009-06-06 15:59:05 UTC (rev 4094) +++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2009-06-06 16:01:39 UTC (rev 4095) @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: vcc_gen_fixed_token.tcl 3948 2009-03-18 11:25:43Z kristian $ * * NB: This file is machine generated, DO NOT EDIT! * Property changes on: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c ___________________________________________________________________ Name: svn:keywords - Id Modified: trunk/varnish-cache/lib/libvcl/vcc_obj.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_obj.c 2009-06-06 15:59:05 UTC (rev 4094) +++ trunk/varnish-cache/lib/libvcl/vcc_obj.c 2009-06-06 16:01:39 UTC (rev 4095) @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: vcc_gen_obj.tcl 4066 2009-05-10 21:21:36Z sky $ * * NB: This file is machine generated, DO NOT EDIT! * Property changes on: trunk/varnish-cache/lib/libvcl/vcc_obj.c ___________________________________________________________________ Name: svn:keywords - Id From des at projects.linpro.no Sat Jun 6 16:03:53 2009 From: des at projects.linpro.no (des at projects.linpro.no) Date: Sat, 6 Jun 2009 18:03:53 +0200 (CEST) Subject: r4096 - trunk/varnish-cache/lib/libvarnish Message-ID: <20090606160353.E80D41F7C4B@projects.linpro.no> Author: des Date: 2009-06-06 18:03:53 +0200 (Sat, 06 Jun 2009) New Revision: 4096 Modified: trunk/varnish-cache/lib/libvarnish/Makefile.am Log: Remove the svn_version hack, which was made redundant by r4093. Modified: trunk/varnish-cache/lib/libvarnish/Makefile.am =================================================================== --- trunk/varnish-cache/lib/libvarnish/Makefile.am 2009-06-06 16:01:39 UTC (rev 4095) +++ trunk/varnish-cache/lib/libvarnish/Makefile.am 2009-06-06 16:03:53 UTC (rev 4096) @@ -16,7 +16,6 @@ flopen.c \ inxorcise.c \ num.c \ - svn_version.c \ time.c \ tcp.c \ vct.c \ @@ -31,23 +30,6 @@ libvarnish_la_LIBADD = ${RT_LIBS} ${NET_LIBS} ${LIBM} -DISTCLEANFILES = svn_version.c -svn_version.c: FORCE - V="$$(git log -n 1 --pretty=format:%h 2>/dev/null || svnversion -n $(top_srcdir))" \ - H="$$(head -n 1 svn_version.c 2>/dev/null || true)"; \ - if [ "/* $$V */" != "$$H" ]; then \ - ( \ - echo "/* $$V */" ;\ - echo "#include " ;\ - echo "const char* svn_version(void)" ;\ - echo "{" ;\ - echo " const char* SVN_Version = \"$$V\";" ;\ - echo " return SVN_Version;" ;\ - echo "}" ;\ - ) > svn_version.c ; \ - fi -FORCE: - if ENABLE_TESTS TESTS = num_c_test From des at projects.linpro.no Sat Jun 6 18:42:43 2009 From: des at projects.linpro.no (des at projects.linpro.no) Date: Sat, 6 Jun 2009 20:42:43 +0200 (CEST) Subject: r4097 - trunk/varnish-cache/lib/libvarnish Message-ID: <20090606184243.DEB491F7BE3@projects.linpro.no> Author: des Date: 2009-06-06 20:42:43 +0200 (Sat, 06 Jun 2009) New Revision: 4097 Modified: trunk/varnish-cache/lib/libvarnish/version.c Log: Forgot this one. Modified: trunk/varnish-cache/lib/libvarnish/version.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/version.c 2009-06-06 16:03:53 UTC (rev 4096) +++ trunk/varnish-cache/lib/libvarnish/version.c 2009-06-06 18:42:43 UTC (rev 4097) @@ -41,8 +41,8 @@ void varnish_version(const char *progname) { - fprintf(stderr, "%s (%s-%s SVN %s)\n", progname, - PACKAGE_TARNAME, PACKAGE_VERSION, svn_version()); + fprintf(stderr, "%s (%s-%s)\n", progname, + PACKAGE_TARNAME, PACKAGE_VERSION); fprintf(stderr, "Copyright (c) 2006-2009 Linpro AS / Verdens Gang AS\n"); } From des at projects.linpro.no Sat Jun 6 18:43:28 2009 From: des at projects.linpro.no (des at projects.linpro.no) Date: Sat, 6 Jun 2009 20:43:28 +0200 (CEST) Subject: r4098 - in trunk/varnish-cache: . bin/varnishd bin/varnishlog bin/varnishncsa include lib/libvarnish Message-ID: <20090606184328.CE89A1F7C06@projects.linpro.no> Author: des Date: 2009-06-06 20:43:28 +0200 (Sat, 06 Jun 2009) New Revision: 4098 Removed: trunk/varnish-cache/lib/libvarnish/inxorcise.c Modified: trunk/varnish-cache/bin/varnishd/varnishd.c trunk/varnish-cache/bin/varnishlog/varnishlog.c trunk/varnish-cache/bin/varnishncsa/varnishncsa.c trunk/varnish-cache/configure.ac trunk/varnish-cache/include/libvarnish.h trunk/varnish-cache/lib/libvarnish/Makefile.am Log: We already had a perfectly good daemon(3) implementation in the tree. All we had to do was add a configure check for Mac OS X. Modified: trunk/varnish-cache/bin/varnishd/varnishd.c =================================================================== --- trunk/varnish-cache/bin/varnishd/varnishd.c 2009-06-06 18:42:43 UTC (rev 4097) +++ trunk/varnish-cache/bin/varnishd/varnishd.c 2009-06-06 18:43:28 UTC (rev 4098) @@ -716,7 +716,7 @@ if (d_flag == 1) DebugStunt(); if (d_flag < 2 && !F_flag) - AZ(inxorcise(1, d_flag)); + AZ(daemon(1, d_flag)); if (d_flag == 1) printf("%d\n", getpid()); Modified: trunk/varnish-cache/bin/varnishlog/varnishlog.c =================================================================== --- trunk/varnish-cache/bin/varnishlog/varnishlog.c 2009-06-06 18:42:43 UTC (rev 4097) +++ trunk/varnish-cache/bin/varnishlog/varnishlog.c 2009-06-06 18:43:28 UTC (rev 4098) @@ -373,7 +373,7 @@ exit(1); } - if (D_flag && inxorcise(0, 0) == -1) { + if (D_flag && daemon(0, 0) == -1) { perror("daemon()"); if (pfh != NULL) vpf_remove(pfh); Modified: trunk/varnish-cache/bin/varnishncsa/varnishncsa.c =================================================================== --- trunk/varnish-cache/bin/varnishncsa/varnishncsa.c 2009-06-06 18:42:43 UTC (rev 4097) +++ trunk/varnish-cache/bin/varnishncsa/varnishncsa.c 2009-06-06 18:43:28 UTC (rev 4098) @@ -570,7 +570,7 @@ exit(1); } - if (D_flag && inxorcise(0, 0) == -1) { + if (D_flag && daemon(0, 0) == -1) { perror("daemon()"); if (pfh != NULL) vpf_remove(pfh); Modified: trunk/varnish-cache/configure.ac =================================================================== --- trunk/varnish-cache/configure.ac 2009-06-06 18:42:43 UTC (rev 4097) +++ trunk/varnish-cache/configure.ac 2009-06-06 18:43:28 UTC (rev 4098) @@ -178,6 +178,19 @@ AC_CHECK_FUNCS([strlcat strlcpy]) AC_CHECK_FUNCS([strndup]) AC_CHECK_FUNCS([daemon]) +# white lie - we don't actually test it +AC_MSG_CHECKING([whether daemon() works]) +case $target in +*-*-darwin*) + # present but not functional + AC_MSG_RESULT([no]) + ac_cv_func_daemon=no + ;; +*) + AC_MSG_RESULT([yes]) + ;; +esac + AC_SYS_LARGEFILE save_LIBS="${LIBS}" Modified: trunk/varnish-cache/include/libvarnish.h =================================================================== --- trunk/varnish-cache/include/libvarnish.h 2009-06-06 18:42:43 UTC (rev 4097) +++ trunk/varnish-cache/include/libvarnish.h 2009-06-06 18:43:28 UTC (rev 4098) @@ -127,6 +127,4 @@ lbv_assert(__func__, __FILE__, __LINE__, expl, errno, 3); \ abort(); \ } while (0) - -int inxorcise(int nochdir, int noclose); const char* svn_version(void); Modified: trunk/varnish-cache/lib/libvarnish/Makefile.am =================================================================== --- trunk/varnish-cache/lib/libvarnish/Makefile.am 2009-06-06 18:42:43 UTC (rev 4097) +++ trunk/varnish-cache/lib/libvarnish/Makefile.am 2009-06-06 18:43:28 UTC (rev 4098) @@ -14,7 +14,6 @@ cli.c \ cli_common.c \ flopen.c \ - inxorcise.c \ num.c \ time.c \ tcp.c \ Deleted: trunk/varnish-cache/lib/libvarnish/inxorcise.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/inxorcise.c 2009-06-06 18:42:43 UTC (rev 4097) +++ trunk/varnish-cache/lib/libvarnish/inxorcise.c 2009-06-06 18:43:28 UTC (rev 4098) @@ -1,56 +0,0 @@ -/*- - * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2009 Linpro AS - * All rights reserved. - * - * Author: Poul-Henning Kamp - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file only exists because Apple has decided to break a - * function that has an age old tradition and force the user - * to use launchd instead. - * - * - */ - - -#include "config.h" - -#include "svnid.h" -SVNID("$Id$") - -#include -#include -#include -#include "libvarnish.h" - -#if __APPLE__ && __MAC_OS_X_VERSION_10_5 -int inxorcise(int nochdir __attribute__((unused)), int noclose __attribute__((unused))) { - fprintf(stderr, "Apple does not want programs to use daemon(3) and suggests using launchd(1). We don't agree, but their dad is bigger than our dad.\n"); - exit(1); -} -#else -int inxorcise(int nochdir, int noclose) { - return daemon(nochdir, noclose); -} -#endif From phk at projects.linpro.no Mon Jun 8 21:40:49 2009 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Mon, 8 Jun 2009 23:40:49 +0200 (CEST) Subject: r4099 - in trunk/varnish-cache: bin/varnishd include lib/libvcl Message-ID: <20090608214049.099552843E@projects.linpro.no> Author: phk Date: 2009-06-08 23:40:48 +0200 (Mon, 08 Jun 2009) New Revision: 4099 Modified: trunk/varnish-cache/bin/varnishd/cache_expire.c trunk/varnish-cache/bin/varnishd/default.vcl trunk/varnish-cache/include/vcl.h trunk/varnish-cache/include/vcl_returns.h trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl trunk/varnish-cache/lib/libvcl/vcc_obj.c Log: Remove the vcl_discard{} facility, it does not seem to bring benefits which outweigh the trouble it causes. The original idea was to allow intelligent purging for space reason in a size-constrained storage. In practice, storage is seldomly constrained. In the cases where it is, I have yet to see any documented benefit from using vcl_discard{}, likely because of the fragmentation such use would cause. The implementation of the vcl_discard callback had severe costs in code complexity (not fully unrolled by this commit) and locking activity. The straw that breaks the camels back, is that faithfull implementation of vcl_discard{} in -spersistence would force us to relocate objects, at a cost likely higher than picking them up from the backend. Modified: trunk/varnish-cache/bin/varnishd/cache_expire.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_expire.c 2009-06-06 18:43:28 UTC (rev 4098) +++ trunk/varnish-cache/bin/varnishd/cache_expire.c 2009-06-08 21:40:48 UTC (rev 4099) @@ -309,12 +309,6 @@ break; } if (oc != NULL) { - /* - * We hazzard the guess that the object is more likely to - * be tossed than kept, and forge ahead on the work to save - * a lock cycle. If the object is kept, we reverse these - * actions below. - */ VTAILQ_REMOVE(&lru, oc, lru_list); oc->flags &= ~OC_F_ONLRU; binheap_delete(exp_heap, oc->timer_idx); @@ -326,35 +320,9 @@ if (oc == NULL) return (-1); - /* - * Ask VCL in the context of the clients session, in order to allow - * client QoS considerations to inform the decision. Temporarily - * substitute the object we want to nuke for the sessions own object. - */ - o = sp->obj; - sp->obj = oc->obj; - VCL_discard_method(sp); - sp->obj = o; - o = oc->obj; - - if (sp->handling == VCL_RET_DISCARD) { - WSL(sp->wrk, SLT_ExpKill, 0, "%u LRU", o->xid); - HSH_Deref(sp->wrk, &o); - return (1); - } - - assert(sp->handling == VCL_RET_KEEP); - - /* Insert in binheap and lru again */ - Lck_Lock(&exp_mtx); - VSL_stats->n_lru_nuked--; /* It was premature */ - VSL_stats->n_lru_saved++; - binheap_insert(exp_heap, oc); - assert(oc->timer_idx != BINHEAP_NOIDX); - VTAILQ_INSERT_TAIL(&lru, oc, lru_list); - oc->flags |= OC_F_ONLRU; - Lck_Unlock(&exp_mtx); - return (0); + WSL(sp->wrk, SLT_ExpKill, 0, "%u LRU", o->xid); + HSH_Deref(sp->wrk, &o); + return (1); } /*-------------------------------------------------------------------- Modified: trunk/varnish-cache/bin/varnishd/default.vcl =================================================================== --- trunk/varnish-cache/bin/varnishd/default.vcl 2009-06-06 18:43:28 UTC (rev 4098) +++ trunk/varnish-cache/bin/varnishd/default.vcl 2009-06-08 21:40:48 UTC (rev 4099) @@ -110,11 +110,6 @@ return (deliver); } -sub vcl_discard { - /* XXX: Do not redefine vcl_discard{}, it is not yet supported */ - return (discard); -} - sub vcl_timeout { /* XXX: Do not redefine vcl_timeout{}, it is not yet supported */ return (discard); Modified: trunk/varnish-cache/include/vcl.h =================================================================== --- trunk/varnish-cache/include/vcl.h 2009-06-06 18:43:28 UTC (rev 4098) +++ trunk/varnish-cache/include/vcl.h 2009-06-08 21:40:48 UTC (rev 4099) @@ -23,10 +23,9 @@ #define VCL_MET_FETCH (1 << 6) #define VCL_MET_DELIVER (1 << 7) #define VCL_MET_TIMEOUT (1 << 8) -#define VCL_MET_DISCARD (1 << 9) -#define VCL_MET_ERROR (1 << 10) +#define VCL_MET_ERROR (1 << 9) -#define VCL_MET_MAX 11 +#define VCL_MET_MAX 10 /* VCL Returns */ #define VCL_RET_ERROR 0 @@ -71,6 +70,5 @@ vcl_func_f *fetch_func; vcl_func_f *deliver_func; vcl_func_f *timeout_func; - vcl_func_f *discard_func; vcl_func_f *error_func; }; Modified: trunk/varnish-cache/include/vcl_returns.h =================================================================== --- trunk/varnish-cache/include/vcl_returns.h 2009-06-06 18:43:28 UTC (rev 4098) +++ trunk/varnish-cache/include/vcl_returns.h 2009-06-08 21:40:48 UTC (rev 4099) @@ -64,10 +64,6 @@ ((1 << VCL_RET_FETCH) | (1 << VCL_RET_DISCARD) )) -VCL_MET_MAC(discard,DISCARD, - ((1 << VCL_RET_DISCARD) - | (1 << VCL_RET_KEEP) -)) VCL_MET_MAC(error,ERROR, ((1 << VCL_RET_RESTART) | (1 << VCL_RET_DELIVER) Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2009-06-06 18:43:28 UTC (rev 4098) +++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2009-06-08 21:40:48 UTC (rev 4099) @@ -175,9 +175,8 @@ vsb_cat(sb, "#define VCL_MET_FETCH\t\t(1 << 6)\n"); vsb_cat(sb, "#define VCL_MET_DELIVER\t\t(1 << 7)\n"); vsb_cat(sb, "#define VCL_MET_TIMEOUT\t\t(1 << 8)\n"); - vsb_cat(sb, "#define VCL_MET_DISCARD\t\t(1 << 9)\n"); - vsb_cat(sb, "#define VCL_MET_ERROR\t\t(1 << 10)\n"); - vsb_cat(sb, "\n#define VCL_MET_MAX\t\t11\n\n"); + vsb_cat(sb, "#define VCL_MET_ERROR\t\t(1 << 9)\n"); + vsb_cat(sb, "\n#define VCL_MET_MAX\t\t10\n\n"); vsb_cat(sb, "/* VCL Returns */\n#define VCL_RET_ERROR\t\t0\n"); vsb_cat(sb, "#define VCL_RET_LOOKUP\t\t1\n#define VCL_RET_HASH\t\t2"); vsb_cat(sb, "\n#define VCL_RET_PIPE\t\t3\n#define VCL_RET_PASS\t\t4"); @@ -199,8 +198,7 @@ vsb_cat(sb, "\tvcl_func_f\t*miss_func;\n\tvcl_func_f\t*hit_func;\n"); vsb_cat(sb, "\tvcl_func_f\t*fetch_func;\n\tvcl_func_f\t*deliver_fun"); vsb_cat(sb, "c;\n\tvcl_func_f\t*timeout_func;\n"); - vsb_cat(sb, "\tvcl_func_f\t*discard_func;\n\tvcl_func_f\t*error_fun"); - vsb_cat(sb, "c;\n};\n"); + vsb_cat(sb, "\tvcl_func_f\t*error_func;\n};\n"); /* ../../include/vrt.h */ Modified: trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl 2009-06-06 18:43:28 UTC (rev 4098) +++ trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl 2009-06-08 21:40:48 UTC (rev 4099) @@ -43,7 +43,6 @@ {fetch {error restart pass deliver}} {deliver {restart deliver}} {timeout {fetch discard}} - {discard {discard keep}} {error {restart deliver}} } Modified: trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl 2009-06-06 18:43:28 UTC (rev 4098) +++ trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl 2009-06-08 21:40:48 UTC (rev 4099) @@ -233,17 +233,17 @@ } { obj.ttl RW TIME - { hit discard timeout error} + { hit timeout error} "const struct sess *" } { obj.grace RW TIME - { hit discard timeout error} + { hit timeout error} "const struct sess *" } { obj.lastuse RO TIME - { hit deliver discard timeout error} + { hit deliver timeout error} "const struct sess *" } { obj.hash @@ -280,11 +280,11 @@ # XXX: or delta times in VCL programs, so this shouldn't be needed /phk { now RO TIME - {recv pipe pass hash miss hit fetch deliver discard timeout} + {recv pipe pass hash miss hit fetch deliver timeout} "const struct sess *" } { req.backend.healthy RO BOOL - {recv pipe pass hash miss hit fetch deliver discard timeout} + {recv pipe pass hash miss hit fetch deliver timeout} "const struct sess *" } Modified: trunk/varnish-cache/lib/libvcl/vcc_obj.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_obj.c 2009-06-06 18:43:28 UTC (rev 4098) +++ trunk/varnish-cache/lib/libvcl/vcc_obj.c 2009-06-08 21:40:48 UTC (rev 4099) @@ -215,18 +215,17 @@ { "obj.ttl", TIME, 7, "VRT_r_obj_ttl(sp)", "VRT_l_obj_ttl(sp, ", V_RW, 0, - VCL_MET_HIT | VCL_MET_DISCARD | VCL_MET_TIMEOUT | VCL_MET_ERROR + VCL_MET_HIT | VCL_MET_TIMEOUT | VCL_MET_ERROR }, { "obj.grace", TIME, 9, "VRT_r_obj_grace(sp)", "VRT_l_obj_grace(sp, ", V_RW, 0, - VCL_MET_HIT | VCL_MET_DISCARD | VCL_MET_TIMEOUT | VCL_MET_ERROR + VCL_MET_HIT | VCL_MET_TIMEOUT | VCL_MET_ERROR }, { "obj.lastuse", TIME, 11, "VRT_r_obj_lastuse(sp)", NULL, V_RO, 0, - VCL_MET_HIT | VCL_MET_DELIVER | VCL_MET_DISCARD | VCL_MET_TIMEOUT - | VCL_MET_ERROR + VCL_MET_HIT | VCL_MET_DELIVER | VCL_MET_TIMEOUT | VCL_MET_ERROR }, { "obj.hash", STRING, 8, "VRT_r_obj_hash(sp)", NULL, @@ -258,14 +257,14 @@ V_RO, 0, VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER - | VCL_MET_DISCARD | VCL_MET_TIMEOUT + | VCL_MET_TIMEOUT }, { "req.backend.healthy", BOOL, 19, "VRT_r_req_backend_healthy(sp)", NULL, V_RO, 0, VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER - | VCL_MET_DISCARD | VCL_MET_TIMEOUT + | VCL_MET_TIMEOUT }, { NULL } }; From phk at projects.linpro.no Tue Jun 9 10:41:39 2009 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Tue, 9 Jun 2009 12:41:39 +0200 (CEST) Subject: r4100 - in trunk/varnish-cache: bin/varnishd include lib/libvcl man Message-ID: <20090609104139.124B738C40@projects.linpro.no> Author: phk Date: 2009-06-09 12:41:38 +0200 (Tue, 09 Jun 2009) New Revision: 4100 Modified: trunk/varnish-cache/bin/varnishd/cache_expire.c trunk/varnish-cache/bin/varnishd/default.vcl trunk/varnish-cache/include/vcl.h trunk/varnish-cache/include/vcl_returns.h trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl trunk/varnish-cache/lib/libvcl/vcc_obj.c trunk/varnish-cache/man/vcl.7so Log: Remove the vcl_timeout{} VCL callback. We had big plans for this originally, but none of them have materialized because there are better ways to do those things. For instance: why invent a lot of code to do prefetch, when wget(1) can do the job already ? Getting rid of vcl_timeout{} (and vcl_discard{}, see yesterdays commit) simplifies the expiry codes locking and statekeeping significantly. Modified: trunk/varnish-cache/bin/varnishd/cache_expire.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_expire.c 2009-06-08 21:40:48 UTC (rev 4099) +++ trunk/varnish-cache/bin/varnishd/cache_expire.c 2009-06-09 10:41:38 UTC (rev 4100) @@ -31,20 +31,10 @@ * We have two data structures, a LRU-list and a binary heap for the timers * and two ways to kill objects: TTL-timeouts and LRU cleanups. * - * To avoid holding the mutex while we ponder the fate of objects, we - * have the following prototol: + * Any object on the LRU is also on the binheap and vice versa. * - * Any object on the LRU is also on the binheap (normal case) + * We hold one object reference for both data structures. * - * An object is taken off only the binheap but left on the LRU during timer - * processing because we have no easy way to put it back the right place - * in the LRU list. - * - * An object is taken off both LRU and binheap for LRU processing, (which - * implies that it must be on both, from where it follows that the timer - * is not chewing on it) because we expect the majority of objects to be - * discarded by LRU and save a lock cycle that way, and because we can - * properly replace it's position in the binheap. */ #include "config.h" @@ -112,6 +102,7 @@ struct objcore *oc; CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC); + AN(o->objhead); AN(ObjIsBusy(o)); assert(o->cacheable); HSH_Ref(o); @@ -151,6 +142,7 @@ oc = o->objcore; if (oc == NULL) return (retval); + AN(o->objhead); CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); if (Lck_Trylock(&exp_mtx)) return (retval); @@ -241,9 +233,12 @@ o = oc->obj; CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC); CHECK_OBJ_NOTNULL(o->objhead, OBJHEAD_MAGIC); + assert(oc->flags & OC_F_ONLRU); assert(oc->timer_idx != BINHEAP_NOIDX); binheap_delete(exp_heap, oc->timer_idx); assert(oc->timer_idx == BINHEAP_NOIDX); + VTAILQ_REMOVE(&lru, o->objcore, lru_list); + oc->flags &= ~OC_F_ONLRU; { /* Sanity checking */ struct objcore *oc2 = binheap_root(exp_heap); @@ -253,32 +248,17 @@ } } - assert(oc->flags & OC_F_ONLRU); - Lck_Unlock(&exp_mtx); - - WSL(sp->wrk, SLT_ExpPick, 0, "%u TTL", o->xid); - - sp->obj = o; - VCL_timeout_method(sp); - sp->obj = NULL; - - assert(sp->handling == VCL_RET_DISCARD); - WSL(sp->wrk, SLT_ExpKill, 0, - "%u %d", o->xid, (int)(o->ttl - t)); - Lck_Lock(&exp_mtx); - assert(oc->timer_idx == BINHEAP_NOIDX); - assert(oc->flags & OC_F_ONLRU); - VTAILQ_REMOVE(&lru, o->objcore, lru_list); - oc->flags &= ~OC_F_ONLRU; VSL_stats->n_expired++; Lck_Unlock(&exp_mtx); + WSL(sp->wrk, SLT_ExpKill, 0, "%u %d", + o->xid, (int)(o->ttl - t)); HSH_Deref(sp->wrk, &o); } } /*-------------------------------------------------------------------- - * Attempt to make space by nuking, with VCLs permission, the oldest - * object on the LRU list which isn't in use. + * Attempt to make space by nuking, the oldest object on the LRU list + * which isn't in use. * Returns: 1: did, 0: didn't, -1: can't */ @@ -291,14 +271,12 @@ /* * Find the first currently unused object on the LRU. * - * Ideally we would have the refcnt in the objcore so we the object does + * Ideally we would have the refcnt in the objcore so we object does * not need to get paged in for this check, but it does not pay off * the complexity: The chances of an object being in front of the LRU, * with active references, likely means that it is already in core. An * object with no active references will be prodded further anyway. * - * NB: Checking refcount here is no guarantee that it does not gain - * another ref while we ponder its destiny without the lock held. */ Lck_Lock(&exp_mtx); VTAILQ_FOREACH(oc, &lru, lru_list) { Modified: trunk/varnish-cache/bin/varnishd/default.vcl =================================================================== --- trunk/varnish-cache/bin/varnishd/default.vcl 2009-06-08 21:40:48 UTC (rev 4099) +++ trunk/varnish-cache/bin/varnishd/default.vcl 2009-06-09 10:41:38 UTC (rev 4100) @@ -110,11 +110,6 @@ return (deliver); } -sub vcl_timeout { - /* XXX: Do not redefine vcl_timeout{}, it is not yet supported */ - return (discard); -} - sub vcl_error { set obj.http.Content-Type = "text/html; charset=utf-8"; synthetic {" Modified: trunk/varnish-cache/include/vcl.h =================================================================== --- trunk/varnish-cache/include/vcl.h 2009-06-08 21:40:48 UTC (rev 4099) +++ trunk/varnish-cache/include/vcl.h 2009-06-09 10:41:38 UTC (rev 4100) @@ -22,10 +22,9 @@ #define VCL_MET_HIT (1 << 5) #define VCL_MET_FETCH (1 << 6) #define VCL_MET_DELIVER (1 << 7) -#define VCL_MET_TIMEOUT (1 << 8) -#define VCL_MET_ERROR (1 << 9) +#define VCL_MET_ERROR (1 << 8) -#define VCL_MET_MAX 10 +#define VCL_MET_MAX 9 /* VCL Returns */ #define VCL_RET_ERROR 0 @@ -69,6 +68,5 @@ vcl_func_f *hit_func; vcl_func_f *fetch_func; vcl_func_f *deliver_func; - vcl_func_f *timeout_func; vcl_func_f *error_func; }; Modified: trunk/varnish-cache/include/vcl_returns.h =================================================================== --- trunk/varnish-cache/include/vcl_returns.h 2009-06-08 21:40:48 UTC (rev 4099) +++ trunk/varnish-cache/include/vcl_returns.h 2009-06-09 10:41:38 UTC (rev 4100) @@ -60,10 +60,6 @@ ((1 << VCL_RET_RESTART) | (1 << VCL_RET_DELIVER) )) -VCL_MET_MAC(timeout,TIMEOUT, - ((1 << VCL_RET_FETCH) - | (1 << VCL_RET_DISCARD) -)) VCL_MET_MAC(error,ERROR, ((1 << VCL_RET_RESTART) | (1 << VCL_RET_DELIVER) Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2009-06-08 21:40:48 UTC (rev 4099) +++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2009-06-09 10:41:38 UTC (rev 4100) @@ -1,5 +1,5 @@ /* - * $Id: vcc_gen_fixed_token.tcl 3948 2009-03-18 11:25:43Z kristian $ + * $Id: vcc_gen_fixed_token.tcl 4099 2009-06-08 21:40:48Z phk $ * * NB: This file is machine generated, DO NOT EDIT! * @@ -159,10 +159,10 @@ /* ../../include/vcl.h */ - vsb_cat(sb, "/*\n * $Id: vcc_gen_fixed_token.tcl 3948 2009-03-18 11"); - vsb_cat(sb, ":25:43Z kristian $\n *\n * NB: This file is machine g"); - vsb_cat(sb, "enerated, DO NOT EDIT!\n *\n * Edit and run vcc_gen_fi"); - vsb_cat(sb, "xed_token.tcl instead\n */\n\nstruct sess;\n"); + vsb_cat(sb, "/*\n * $Id: vcc_gen_fixed_token.tcl 4099 2009-06-08 21"); + vsb_cat(sb, ":40:48Z phk $\n *\n * NB: This file is machine genera"); + vsb_cat(sb, "ted, DO NOT EDIT!\n *\n * Edit and run vcc_gen_fixed_t"); + vsb_cat(sb, "oken.tcl instead\n */\n\nstruct sess;\n"); vsb_cat(sb, "struct cli;\n\ntypedef void vcl_init_f(struct cli *);\n"); vsb_cat(sb, "typedef void vcl_fini_f(struct cli *);\n"); vsb_cat(sb, "typedef int vcl_func_f(struct sess *sp);\n"); @@ -174,17 +174,16 @@ vsb_cat(sb, "#define VCL_MET_HIT\t\t(1 << 5)\n"); vsb_cat(sb, "#define VCL_MET_FETCH\t\t(1 << 6)\n"); vsb_cat(sb, "#define VCL_MET_DELIVER\t\t(1 << 7)\n"); - vsb_cat(sb, "#define VCL_MET_TIMEOUT\t\t(1 << 8)\n"); - vsb_cat(sb, "#define VCL_MET_ERROR\t\t(1 << 9)\n"); - vsb_cat(sb, "\n#define VCL_MET_MAX\t\t10\n\n"); - vsb_cat(sb, "/* VCL Returns */\n#define VCL_RET_ERROR\t\t0\n"); - vsb_cat(sb, "#define VCL_RET_LOOKUP\t\t1\n#define VCL_RET_HASH\t\t2"); - vsb_cat(sb, "\n#define VCL_RET_PIPE\t\t3\n#define VCL_RET_PASS\t\t4"); - vsb_cat(sb, "\n#define VCL_RET_FETCH\t\t5\n#define VCL_RET_DELIVER\t"); - vsb_cat(sb, "\t6\n#define VCL_RET_DISCARD\t\t7\n"); - vsb_cat(sb, "#define VCL_RET_KEEP\t\t8\n#define VCL_RET_RESTART\t\t"); - vsb_cat(sb, "9\n\n#define VCL_RET_MAX\t\t10\n"); - vsb_cat(sb, "\nstruct VCL_conf {\n\tunsigned\tmagic;\n"); + vsb_cat(sb, "#define VCL_MET_ERROR\t\t(1 << 8)\n"); + vsb_cat(sb, "\n#define VCL_MET_MAX\t\t9\n\n/* VCL Returns */\n"); + vsb_cat(sb, "#define VCL_RET_ERROR\t\t0\n#define VCL_RET_LOOKUP\t\t"); + vsb_cat(sb, "1\n#define VCL_RET_HASH\t\t2\n#define VCL_RET_PIPE\t\t"); + vsb_cat(sb, "3\n#define VCL_RET_PASS\t\t4\n#define VCL_RET_FETCH\t\t"); + vsb_cat(sb, "5\n#define VCL_RET_DELIVER\t\t6\n"); + vsb_cat(sb, "#define VCL_RET_DISCARD\t\t7\n#define VCL_RET_KEEP\t\t"); + vsb_cat(sb, "8\n#define VCL_RET_RESTART\t\t9\n"); + vsb_cat(sb, "\n#define VCL_RET_MAX\t\t10\n\n"); + vsb_cat(sb, "struct VCL_conf {\n\tunsigned\tmagic;\n"); vsb_cat(sb, "#define VCL_CONF_MAGIC\t0x7406c509\t/* from /dev/rando"); vsb_cat(sb, "m */\n\n\tstruct director\t**director;\n"); vsb_cat(sb, "\tunsigned\tndirector;\n\tstruct vrt_ref\t*ref;\n"); @@ -197,8 +196,8 @@ vsb_cat(sb, "\tvcl_func_f\t*pass_func;\n\tvcl_func_f\t*hash_func;\n"); vsb_cat(sb, "\tvcl_func_f\t*miss_func;\n\tvcl_func_f\t*hit_func;\n"); vsb_cat(sb, "\tvcl_func_f\t*fetch_func;\n\tvcl_func_f\t*deliver_fun"); - vsb_cat(sb, "c;\n\tvcl_func_f\t*timeout_func;\n"); - vsb_cat(sb, "\tvcl_func_f\t*error_func;\n};\n"); + vsb_cat(sb, "c;\n\tvcl_func_f\t*error_func;\n"); + vsb_cat(sb, "};\n"); /* ../../include/vrt.h */ Modified: trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl 2009-06-08 21:40:48 UTC (rev 4099) +++ trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl 2009-06-09 10:41:38 UTC (rev 4100) @@ -42,7 +42,6 @@ {hit {error restart pass deliver}} {fetch {error restart pass deliver}} {deliver {restart deliver}} - {timeout {fetch discard}} {error {restart deliver}} } Modified: trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl 2009-06-08 21:40:48 UTC (rev 4099) +++ trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl 2009-06-09 10:41:38 UTC (rev 4100) @@ -233,17 +233,17 @@ } { obj.ttl RW TIME - { hit timeout error} + { hit error} "const struct sess *" } { obj.grace RW TIME - { hit timeout error} + { hit error} "const struct sess *" } { obj.lastuse RO TIME - { hit deliver timeout error} + { hit deliver error} "const struct sess *" } { obj.hash @@ -280,11 +280,11 @@ # XXX: or delta times in VCL programs, so this shouldn't be needed /phk { now RO TIME - {recv pipe pass hash miss hit fetch deliver timeout} + {recv pipe pass hash miss hit fetch deliver } "const struct sess *" } { req.backend.healthy RO BOOL - {recv pipe pass hash miss hit fetch deliver timeout} + {recv pipe pass hash miss hit fetch deliver } "const struct sess *" } Modified: trunk/varnish-cache/lib/libvcl/vcc_obj.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_obj.c 2009-06-08 21:40:48 UTC (rev 4099) +++ trunk/varnish-cache/lib/libvcl/vcc_obj.c 2009-06-09 10:41:38 UTC (rev 4100) @@ -1,5 +1,5 @@ /* - * $Id: vcc_gen_obj.tcl 4066 2009-05-10 21:21:36Z sky $ + * $Id: vcc_gen_obj.tcl 4099 2009-06-08 21:40:48Z phk $ * * NB: This file is machine generated, DO NOT EDIT! * @@ -215,17 +215,17 @@ { "obj.ttl", TIME, 7, "VRT_r_obj_ttl(sp)", "VRT_l_obj_ttl(sp, ", V_RW, 0, - VCL_MET_HIT | VCL_MET_TIMEOUT | VCL_MET_ERROR + VCL_MET_HIT | VCL_MET_ERROR }, { "obj.grace", TIME, 9, "VRT_r_obj_grace(sp)", "VRT_l_obj_grace(sp, ", V_RW, 0, - VCL_MET_HIT | VCL_MET_TIMEOUT | VCL_MET_ERROR + VCL_MET_HIT | VCL_MET_ERROR }, { "obj.lastuse", TIME, 11, "VRT_r_obj_lastuse(sp)", NULL, V_RO, 0, - VCL_MET_HIT | VCL_MET_DELIVER | VCL_MET_TIMEOUT | VCL_MET_ERROR + VCL_MET_HIT | VCL_MET_DELIVER | VCL_MET_ERROR }, { "obj.hash", STRING, 8, "VRT_r_obj_hash(sp)", NULL, @@ -257,14 +257,12 @@ V_RO, 0, VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER - | VCL_MET_TIMEOUT }, { "req.backend.healthy", BOOL, 19, "VRT_r_req_backend_healthy(sp)", NULL, V_RO, 0, VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER - | VCL_MET_TIMEOUT }, { NULL } }; Modified: trunk/varnish-cache/man/vcl.7so =================================================================== --- trunk/varnish-cache/man/vcl.7so 2009-06-08 21:40:48 UTC (rev 4099) +++ trunk/varnish-cache/man/vcl.7so 2009-06-09 10:41:38 UTC (rev 4100) @@ -444,37 +444,8 @@ .It Cm deliver Deliver the object to the client. .El -.\" vcl_timeout -.It Cm vcl_timeout -Called by the reaper thread shortly before a cached document reaches -its expiry time. -.Pp -The -.Cm vcl_timeout -subroutine may terminate with one of the following keywords: -.Bl -tag -width indent -.It Cm fetch -Request a fresh copy of the object from the backend. -.It Cm discard -Discard the object. .El -.\" vcl_discard -.It Cm vcl_discard -Called by the reaper thread when a cached document is about to be -discarded, either because it has expired or because space is running -low. .Pp -The -.Cm vcl_discard -subroutine may terminate with one of the following keywords: -.Bl -tag -width indent -.It Cm discard -Discard the object. -.It Cm keep -Keep the object in cache. -.El -.El -.Pp If one of these subroutines is left undefined or terminates without reaching a handling decision, control will be handed over to the builtin default. From phk at projects.linpro.no Wed Jun 10 09:20:21 2009 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 10 Jun 2009 11:20:21 +0200 (CEST) Subject: r4101 - trunk/varnish-cache/bin/varnishd Message-ID: <20090610092021.3AF441F7C19@projects.linpro.no> Author: phk Date: 2009-06-10 11:20:20 +0200 (Wed, 10 Jun 2009) New Revision: 4101 Modified: trunk/varnish-cache/bin/varnishd/heritage.h trunk/varnish-cache/bin/varnishd/mgt.h trunk/varnish-cache/bin/varnishd/mgt_child.c trunk/varnish-cache/bin/varnishd/mgt_cli.c trunk/varnish-cache/bin/varnishd/mgt_vcc.c Log: Include in once and for all. Modified: trunk/varnish-cache/bin/varnishd/heritage.h =================================================================== --- trunk/varnish-cache/bin/varnishd/heritage.h 2009-06-09 10:41:38 UTC (rev 4100) +++ trunk/varnish-cache/bin/varnishd/heritage.h 2009-06-10 09:20:20 UTC (rev 4101) @@ -33,8 +33,6 @@ #include -#include "vqueue.h" - struct listen_sock { VTAILQ_ENTRY(listen_sock) list; int sock; Modified: trunk/varnish-cache/bin/varnishd/mgt.h =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt.h 2009-06-09 10:41:38 UTC (rev 4100) +++ trunk/varnish-cache/bin/varnishd/mgt.h 2009-06-10 09:20:20 UTC (rev 4101) @@ -29,6 +29,8 @@ * $Id$ */ +#include + #include "common.h" #include "miniobj.h" Modified: trunk/varnish-cache/bin/varnishd/mgt_child.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_child.c 2009-06-09 10:41:38 UTC (rev 4100) +++ trunk/varnish-cache/bin/varnishd/mgt_child.c 2009-06-10 09:20:20 UTC (rev 4101) @@ -54,8 +54,8 @@ #include #endif +#include "mgt.h" #include "heritage.h" -#include "mgt.h" #include "cli.h" #include "cli_priv.h" #include "mgt_cli.h" Modified: trunk/varnish-cache/bin/varnishd/mgt_cli.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_cli.c 2009-06-09 10:41:38 UTC (rev 4100) +++ trunk/varnish-cache/bin/varnishd/mgt_cli.c 2009-06-10 09:20:20 UTC (rev 4101) @@ -58,16 +58,17 @@ #include "cli.h" #include "vsb.h" #include "cli_common.h" -#include "heritage.h" -#include "mgt.h" -#include "mgt_cli.h" #include "vev.h" #include "vsha256.h" #include "shmlog.h" - #include "vlu.h" #include "vss.h" + +#include "mgt.h" +#include "heritage.h" +#include "mgt_cli.h" + static int cli_i = -1, cli_o = -1; static const char *secret_file; Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2009-06-09 10:41:38 UTC (rev 4100) +++ trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2009-06-10 09:20:20 UTC (rev 4101) @@ -49,8 +49,6 @@ #endif #include "vsb.h" -#include "vqueue.h" - #include "libvcl.h" #include "cli.h" #include "cli_priv.h" From phk at projects.linpro.no Wed Jun 10 09:45:20 2009 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 10 Jun 2009 11:45:20 +0200 (CEST) Subject: r4102 - in trunk/varnish-cache: bin/varnishd include Message-ID: <20090610094520.A55051F7C2A@projects.linpro.no> Author: phk Date: 2009-06-10 11:45:20 +0200 (Wed, 10 Jun 2009) New Revision: 4102 Modified: trunk/varnish-cache/bin/varnishd/cache.h trunk/varnish-cache/bin/varnishd/cache_expire.c trunk/varnish-cache/bin/varnishd/common.h trunk/varnish-cache/bin/varnishd/flint.lnt trunk/varnish-cache/bin/varnishd/stevedore.c trunk/varnish-cache/bin/varnishd/stevedore.h trunk/varnish-cache/include/svnid.h Log: Properly constify svnid Modified: trunk/varnish-cache/bin/varnishd/cache.h =================================================================== --- trunk/varnish-cache/bin/varnishd/cache.h 2009-06-10 09:20:20 UTC (rev 4101) +++ trunk/varnish-cache/bin/varnishd/cache.h 2009-06-10 09:45:20 UTC (rev 4102) @@ -490,7 +490,7 @@ void EXP_Init(void); void EXP_Rearm(const struct object *o); int EXP_Touch(const struct object *o); -int EXP_NukeOne(struct sess *sp); +int EXP_NukeOne(struct sess *sp, struct objcore_head *lru); /* cache_fetch.c */ int FetchHdr(struct sess *sp); Modified: trunk/varnish-cache/bin/varnishd/cache_expire.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_expire.c 2009-06-10 09:20:20 UTC (rev 4101) +++ trunk/varnish-cache/bin/varnishd/cache_expire.c 2009-06-10 09:45:20 UTC (rev 4102) @@ -53,11 +53,11 @@ #include "cache.h" #include "vcl.h" #include "hash_slinger.h" +#include "stevedore.h" static pthread_t exp_thread; static struct binheap *exp_heap; static struct lock exp_mtx; -static VTAILQ_HEAD(,objcore) lru = VTAILQ_HEAD_INITIALIZER(lru); /* * This is a magic marker for the objects currently on the SIOP [look it up] @@ -100,6 +100,7 @@ EXP_Insert(struct object *o) { struct objcore *oc; + struct objcore_head *lru; CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC); AN(o->objhead); @@ -116,8 +117,11 @@ (void)update_object_when(o); binheap_insert(exp_heap, oc); assert(oc->timer_idx != BINHEAP_NOIDX); - VTAILQ_INSERT_TAIL(&lru, oc, lru_list); - oc->flags |= OC_F_ONLRU; + lru = STV_lru(o->objstore); + if (lru != NULL) { + VTAILQ_INSERT_TAIL(lru, oc, lru_list); + oc->flags |= OC_F_ONLRU; + } Lck_Unlock(&exp_mtx); if (o->smp_object != NULL) SMP_TTLchanged(o); @@ -137,18 +141,22 @@ { struct objcore *oc; int retval = 0; + struct objcore_head *lru; CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC); oc = o->objcore; if (oc == NULL) return (retval); + lru = STV_lru(o->objstore); + if (lru == NULL) + return (retval); AN(o->objhead); CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); if (Lck_Trylock(&exp_mtx)) return (retval); if (oc->flags & OC_F_ONLRU) { - VTAILQ_REMOVE(&lru, oc, lru_list); - VTAILQ_INSERT_TAIL(&lru, oc, lru_list); + VTAILQ_REMOVE(lru, oc, lru_list); + VTAILQ_INSERT_TAIL(lru, oc, lru_list); VSL_stats->n_lru_moved++; retval = 1; } @@ -211,6 +219,7 @@ struct objcore *oc; struct object *o; double t; + struct objcore_head *lru; (void)priv; AZ(sleep(10)); /* XXX: Takes time for VCL to arrive */ @@ -237,7 +246,9 @@ assert(oc->timer_idx != BINHEAP_NOIDX); binheap_delete(exp_heap, oc->timer_idx); assert(oc->timer_idx == BINHEAP_NOIDX); - VTAILQ_REMOVE(&lru, o->objcore, lru_list); + lru = STV_lru(o->objstore); + AN(lru); + VTAILQ_REMOVE(lru, o->objcore, lru_list); oc->flags &= ~OC_F_ONLRU; { /* Sanity checking */ @@ -263,7 +274,7 @@ */ int -EXP_NukeOne(struct sess *sp) +EXP_NukeOne(struct sess *sp, struct objcore_head *lru) { struct objcore *oc; struct object *o; @@ -279,7 +290,7 @@ * */ Lck_Lock(&exp_mtx); - VTAILQ_FOREACH(oc, &lru, lru_list) { + VTAILQ_FOREACH(oc, lru, lru_list) { CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); if (oc->timer_idx == BINHEAP_NOIDX) /* exp_timer has it */ continue; @@ -287,7 +298,7 @@ break; } if (oc != NULL) { - VTAILQ_REMOVE(&lru, oc, lru_list); + VTAILQ_REMOVE(lru, oc, lru_list); oc->flags &= ~OC_F_ONLRU; binheap_delete(exp_heap, oc->timer_idx); assert(oc->timer_idx == BINHEAP_NOIDX); Modified: trunk/varnish-cache/bin/varnishd/common.h =================================================================== --- trunk/varnish-cache/bin/varnishd/common.h 2009-06-10 09:20:20 UTC (rev 4101) +++ trunk/varnish-cache/bin/varnishd/common.h 2009-06-10 09:45:20 UTC (rev 4102) @@ -64,3 +64,8 @@ const char *name; void *ptr; }; + +/* Sort of hack-ish... */ +struct objcore; +VTAILQ_HEAD(objcore_head, objcore); + Modified: trunk/varnish-cache/bin/varnishd/flint.lnt =================================================================== --- trunk/varnish-cache/bin/varnishd/flint.lnt 2009-06-10 09:20:20 UTC (rev 4101) +++ trunk/varnish-cache/bin/varnishd/flint.lnt 2009-06-10 09:45:20 UTC (rev 4102) @@ -40,6 +40,7 @@ -esym(458, VSL_stats) -esym(458, heritage) -esym(458, name_key) +-esym(528, svnid) ////////////// -passes=3 Modified: trunk/varnish-cache/bin/varnishd/stevedore.c =================================================================== --- trunk/varnish-cache/bin/varnishd/stevedore.c 2009-06-10 09:20:20 UTC (rev 4101) +++ trunk/varnish-cache/bin/varnishd/stevedore.c 2009-06-10 09:45:20 UTC (rev 4102) @@ -81,7 +81,7 @@ break; /* no luck; try to free some space and keep trying */ - if (EXP_NukeOne(sp) == -1) + if (EXP_NukeOne(sp, &stv->lru) == -1) break; /* Enough is enough: try another if we have one */ @@ -124,6 +124,7 @@ *stv = *stv2; AN(stv->name); AN(stv->alloc); + VTAILQ_INIT(&stv->lru); if (stv->init != NULL) stv->init(stv, ac, av); @@ -158,6 +159,16 @@ } } +struct objcore_head * +STV_lru(struct storage *st) +{ + if (st == NULL) + return (NULL); + CHECK_OBJ(st, STORAGE_MAGIC); + + return (&st->stevedore->lru); +} + const struct choice STV_choice[] = { { "file", &smf_stevedore }, { "malloc", &sma_stevedore }, Modified: trunk/varnish-cache/bin/varnishd/stevedore.h =================================================================== --- trunk/varnish-cache/bin/varnishd/stevedore.h 2009-06-10 09:20:20 UTC (rev 4101) +++ trunk/varnish-cache/bin/varnishd/stevedore.h 2009-06-10 09:45:20 UTC (rev 4102) @@ -29,8 +29,6 @@ * $Id$ */ -#include "vqueue.h" - struct stevedore; struct sess; struct iovec; @@ -56,6 +54,8 @@ storage_object_f *object; storage_close_f *close; + struct objcore_head lru; + /* private fields */ void *priv; @@ -68,6 +68,7 @@ void STV_add(const struct stevedore *stv, int ac, char * const *av); void STV_open(void); void STV_close(void); +struct objcore_head *STV_lru(struct storage *st); int STV_GetFile(const char *fn, int *fdp, const char **fnp, const char *ctx); uintmax_t STV_FileSize(int fd, const char *size, unsigned *granularity, const char *ctx); Modified: trunk/varnish-cache/include/svnid.h =================================================================== --- trunk/varnish-cache/include/svnid.h 2009-06-10 09:20:20 UTC (rev 4101) +++ trunk/varnish-cache/include/svnid.h 2009-06-10 09:45:20 UTC (rev 4102) @@ -31,6 +31,6 @@ #define SVNID_H_INCLUDED #define SVNID(id) \ - static const char *svnid __attribute__((__unused__)) = id; + static const char * const svnid __attribute__((__unused__)) = id; #endif From phk at phk.freebsd.dk Wed Jun 10 09:49:09 2009 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Wed, 10 Jun 2009 09:49:09 +0000 Subject: r4102 - in trunk/varnish-cache: bin/varnishd include In-Reply-To: Your message of "Wed, 10 Jun 2009 11:45:20 +0200." <20090610094520.A55051F7C2A@projects.linpro.no> Message-ID: <34267.1244627349@critter.freebsd.dk> In message <20090610094520.A55051F7C2A at projects.linpro.no>, phk at projects.linpro .no writes: >Author: phk >Date: 2009-06-10 11:45:20 +0200 (Wed, 10 Jun 2009) >New Revision: 4102 >Log: >Properly constify svnid So, a few files got away from me here: The commit messages for those are: Make the LRU list per stevedore, so that we do not deplete one stevedore, trying to make space in another. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk at FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From des at projects.linpro.no Thu Jun 11 00:56:19 2009 From: des at projects.linpro.no (des at projects.linpro.no) Date: Thu, 11 Jun 2009 02:56:19 +0200 (CEST) Subject: r4103 - trunk/varnish-cache Message-ID: <20090611005619.657E81F7C2A@projects.linpro.no> Author: des Date: 2009-06-11 02:56:19 +0200 (Thu, 11 Jun 2009) New Revision: 4103 Modified: trunk/varnish-cache/configure.ac Log: Typo in copyright statement Modified: trunk/varnish-cache/configure.ac =================================================================== --- trunk/varnish-cache/configure.ac 2009-06-10 09:45:20 UTC (rev 4102) +++ trunk/varnish-cache/configure.ac 2009-06-11 00:56:19 UTC (rev 4103) @@ -2,7 +2,7 @@ AC_PREREQ(2.59) AC_COPYRIGHT([Copyright (c) 2006 Verdens Gang AS -Copyright (c) 2009-2009 Linpro AS]) +Copyright (c) 2006-2009 Linpro AS]) AC_REVISION([$Id$]) AC_INIT([Varnish], [trunk], [varnish-dev at projects.linpro.no]) AC_CONFIG_SRCDIR(include/varnishapi.h) From ssm at projects.linpro.no Sat Jun 13 21:33:37 2009 From: ssm at projects.linpro.no (ssm at projects.linpro.no) Date: Sat, 13 Jun 2009 23:33:37 +0200 (CEST) Subject: r4104 - trunk/varnish-cache/bin/varnishd Message-ID: <20090613213337.361CE1F7C73@projects.linpro.no> Author: ssm Date: 2009-06-13 23:33:36 +0200 (Sat, 13 Jun 2009) New Revision: 4104 Modified: trunk/varnish-cache/bin/varnishd/varnishd.1 Log: Update varnishd.1 Modified: trunk/varnish-cache/bin/varnishd/varnishd.1 =================================================================== --- trunk/varnish-cache/bin/varnishd/varnishd.1 2009-06-11 00:56:19 UTC (rev 4103) +++ trunk/varnish-cache/bin/varnishd/varnishd.1 2009-06-13 21:33:36 UTC (rev 4104) @@ -350,6 +350,38 @@ parameter. .It Cm ping Op Ns Ar timestamp Ping the child process. +.It Cm purge Ar field Ar operator Ar argument Op && Ar field Ar operator Ar argument Op ... +Immediately invalidate all documents matching the purge expression. +See +.Va Purge expressions +for more documentation and examples. +.It Cm purge.hash Ar regex +Immediately invalidate all documents where +.Va obj.hash +matches the +.Va regex . +The default object hash contains the values from +.Va req.url +and either +.Va req.http.host +or +.Va server.ip +depending on the presence of a Host: header in the request sent by the +client. The object hash may be modified further by +.Va VCL. +.It Cm purge.list +Display the purge list. +.Pp +All requests for objects from the cache are matched against items on +the purge list. If an object in the cache is older than a matching +purge list item, it is considered "purged", and will be fetched from +the backend instead. +.Pp +When a purge expression is older than all the objects in the cache, it +is removed from the list. +.It Cm purge.url Ar regexp +Immediately invalidate all documents whose URL matches the specified +regular expression. .It Cm start Start the child process if it is not already running. .It Cm stats @@ -363,8 +395,7 @@ .It Cm stop Stop the child process. .It Cm url.purge Ar regexp -Immediately invalidate all documents whos URL matches the specified -regular expression. +Deprecated, see purge.url instead .It Cm vcl.discard Ar configname Discard the configuration specified by .Ar configname . @@ -588,6 +619,46 @@ The default is .Dv off . .El +.Ss Purge expressions +A purge expression consists of one or more conditions. A condition +consists of a field, a operator, and an argument. Conditions can be +ANDed together with "&&". +.Pp +A field can be any of the variables from VCL, for instance +.Va req.url , +.Va req.http.host +or +.Va obj.set-cookie . +.Pp +Operators are "==" for direct comparision, "~" for a regular +expression match, and ">" or "<" for size comparisons. Prepending an +operator with "!" negates the expression. +.Pp +The argument could be a quoted string, a regexp, or an integer. +Integers can have "KB", "MB", "GB" or "TB" appended for size related +fields. +.Pp +Simple example: All requests where +.Va req.url +exactly matches the string +.Va /news +are purged from the cache. +.Bd -literal -offset 4n +req.url == "/news" +.Ed +.Pp +Example: Purge all documents where the name does not end with ".ogg", +and where the size of the object is greater than 10 megabytes. +.Bd -literal -offset 4n +req.url !~ "\.ogg" && obj.size > 10MB +.Ed +.Pp +Example: Purge all documents where the serving host is "example.com" +or "www.example.com", and where the Set-Cookie header received from +the backend contains "USERID=1663". +.Bd -literal -offset 4n +req.http.host ~ "^(www\.)example.com$" && obj.set-cookie ~ "USERID=1663" +.Ed .Sh SEE ALSO .Xr varnishlog 1 , .Xr varnishhist 1 , @@ -614,4 +685,6 @@ .An Poul-Henning Kamp Aq phk at phk.freebsd.dk in cooperation with Verdens Gang AS and Linpro AS. This manual page was written by -.An Dag-Erling Sm\(/orgrav Aq des at des.no . +.An Dag-Erling Sm\(/orgrav Aq des at des.no +with updates by +.An Stig Sandbeck Mathisen Aq ssm at debian.org From ssm at projects.linpro.no Sun Jun 14 10:15:10 2009 From: ssm at projects.linpro.no (ssm at projects.linpro.no) Date: Sun, 14 Jun 2009 12:15:10 +0200 (CEST) Subject: r4105 - trunk/varnish-cache/bin/varnishd Message-ID: <20090614101510.697651F7C71@projects.linpro.no> Author: ssm Date: 2009-06-14 12:15:10 +0200 (Sun, 14 Jun 2009) New Revision: 4105 Modified: trunk/varnish-cache/bin/varnishd/varnishd.1 Log: Update documentation for the varnishd management interface Modified: trunk/varnish-cache/bin/varnishd/varnishd.1 =================================================================== --- trunk/varnish-cache/bin/varnishd/varnishd.1 2009-06-13 21:33:36 UTC (rev 4104) +++ trunk/varnish-cache/bin/varnishd/varnishd.1 2009-06-14 10:15:10 UTC (rev 4105) @@ -326,8 +326,12 @@ address and port. The following commands are available: .Bl -tag -width 4n -.It Cm help +.It Cm help Op Ar command Display a list of available commands. +.Pp +If the +.Ar command +is specified, display help for this command. .It Cm param.set Ar param Ar value Set the parameter specified by .Ar param @@ -336,20 +340,24 @@ See .Sx Run-Time Parameters for a list of parameters. -.It Cm param.show Ar param -Display the value of the parameter specified by -.Ar param . -See -.Sx Run-Time Parameters -for a list of parameters. -.It Cm param.show Op Fl l -Display a list of run-time parameters and their values. +.It Xo +.Cm param.show +.Op Fl l +.Op Ar param +.Xc +Display a list if run-time parameters and their values. +.Pp If the .Fl l option is specified, the list includes a brief explanation of each parameter. +.Pp +If a +.Ar param +is specified, display only the value and explanation for this +parameter. .It Cm ping Op Ns Ar timestamp -Ping the child process. +Ping the Varnish cache process, keeping the connection alive. .It Cm purge Ar field Ar operator Ar argument Op && Ar field Ar operator Ar argument Op ... Immediately invalidate all documents matching the purge expression. See @@ -382,20 +390,25 @@ .It Cm purge.url Ar regexp Immediately invalidate all documents whose URL matches the specified regular expression. +.It Cm quit +Close the connection to the varnish admin port. .It Cm start -Start the child process if it is not already running. +Start the Varnish cache process if it is not already running. .It Cm stats -Display server statistics. +Show summary statistics. +.Pp All the numbers presented are totals since server startup; for a better idea of the current situation, use the .Xr varnishstat 1 utility. .It Cm status -Check the status of the child process. +Check the status of the Varnish cache process. .It Cm stop -Stop the child process. +Stop the Varnish cache process. .It Cm url.purge Ar regexp -Deprecated, see purge.url instead +Deprecated, see +.Cm purge.url +instead. .It Cm vcl.discard Ar configname Discard the configuration specified by .Ar configname . From ssm at projects.linpro.no Sun Jun 14 11:33:10 2009 From: ssm at projects.linpro.no (ssm at projects.linpro.no) Date: Sun, 14 Jun 2009 13:33:10 +0200 (CEST) Subject: r4106 - trunk/varnish-cache/bin/varnishd Message-ID: <20090614113310.5A6D81F7C71@projects.linpro.no> Author: ssm Date: 2009-06-14 13:33:10 +0200 (Sun, 14 Jun 2009) New Revision: 4106 Modified: trunk/varnish-cache/bin/varnishd/varnishd.1 Log: varnishd.1: fix regular expression examples Modified: trunk/varnish-cache/bin/varnishd/varnishd.1 =================================================================== --- trunk/varnish-cache/bin/varnishd/varnishd.1 2009-06-14 10:15:10 UTC (rev 4105) +++ trunk/varnish-cache/bin/varnishd/varnishd.1 2009-06-14 11:33:10 UTC (rev 4106) @@ -663,14 +663,14 @@ Example: Purge all documents where the name does not end with ".ogg", and where the size of the object is greater than 10 megabytes. .Bd -literal -offset 4n -req.url !~ "\.ogg" && obj.size > 10MB +req.url !~ "\\.ogg$" && obj.size > 10MB .Ed .Pp Example: Purge all documents where the serving host is "example.com" or "www.example.com", and where the Set-Cookie header received from the backend contains "USERID=1663". .Bd -literal -offset 4n -req.http.host ~ "^(www\.)example.com$" && obj.set-cookie ~ "USERID=1663" +req.http.host ~ "^(www\\.)example.com$" && obj.set-cookie ~ "USERID=1663" .Ed .Sh SEE ALSO .Xr varnishlog 1 , From des at des.no Wed Jun 17 01:21:07 2009 From: des at des.no (=?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?=) Date: Wed, 17 Jun 2009 03:21:07 +0200 Subject: r4104 - trunk/varnish-cache/bin/varnishd In-Reply-To: <20090613213337.361CE1F7C73@projects.linpro.no> (ssm@projects.linpro.no's message of "Sat, 13 Jun 2009 23:33:37 +0200 (CEST)") References: <20090613213337.361CE1F7C73@projects.linpro.no> Message-ID: <86ws7bk64c.fsf@ds4.des.no> ssm at projects.linpro.no writes: > +depending on the presence of a Host: header in the request sent by the > +client. The object hash may be modified further by Sentences must start on a new line so groff can tell the difference between the period at the end of a sentence and the period at the end of an abbreviation. DES -- Dag-Erling Sm?rgrav - des at des.no From ssm at projects.linpro.no Wed Jun 17 05:20:34 2009 From: ssm at projects.linpro.no (ssm at projects.linpro.no) Date: Wed, 17 Jun 2009 07:20:34 +0200 (CEST) Subject: r4107 - in trunk/varnish-cache/bin: varnishd varnishlog varnishtest varnishtop Message-ID: <20090617052034.A2A1C1F7C61@projects.linpro.no> Author: ssm Date: 2009-06-17 07:20:34 +0200 (Wed, 17 Jun 2009) New Revision: 4107 Modified: trunk/varnish-cache/bin/varnishd/varnishd.1 trunk/varnish-cache/bin/varnishlog/varnishlog.1 trunk/varnish-cache/bin/varnishtest/varnishtest.1 trunk/varnish-cache/bin/varnishtop/varnishtop.1 Log: Merge branch 'lintian/man' Conflicts: varnish-cache/bin/varnishd/varnishd.1 Modified: trunk/varnish-cache/bin/varnishd/varnishd.1 =================================================================== --- trunk/varnish-cache/bin/varnishd/varnishd.1 2009-06-14 11:33:10 UTC (rev 4106) +++ trunk/varnish-cache/bin/varnishd/varnishd.1 2009-06-17 05:20:34 UTC (rev 4107) @@ -563,7 +563,7 @@ Note that several operating systems have known bugs which make it inadvisable to use this. .Pp -The default is -1, which disables the use of sendfile altogether. +The default is \-1, which disables the use of sendfile altogether. .It Va send_timeout The time to wait before dropping the connection to a client which is not accepting data sent to it. Modified: trunk/varnish-cache/bin/varnishlog/varnishlog.1 =================================================================== --- trunk/varnish-cache/bin/varnishlog/varnishlog.1 2009-06-14 11:33:10 UTC (rev 4106) +++ trunk/varnish-cache/bin/varnishlog/varnishlog.1 2009-06-17 05:20:34 UTC (rev 4107) @@ -232,13 +232,13 @@ The following command line simply copies all log entries to a log file: .Bd -literal -offset 4n -$ varnishlog -w /var/log/varnish.log +$ varnishlog \-w /var/log/varnish.log .Ed .Pp The following command line reads that same log file and displays requests for the front page: .Bd -literal -offset 4n -$ varnishlog -r /var/log/varnish.log -c -o RxURL '^/$' +$ varnishlog \-r /var/log/varnish.log \-c \-o RxURL '^/$' .Ed .Sh SEE ALSO .Xr varnishd 1 , Modified: trunk/varnish-cache/bin/varnishtest/varnishtest.1 =================================================================== --- trunk/varnish-cache/bin/varnishtest/varnishtest.1 2009-06-14 11:33:10 UTC (rev 4106) +++ trunk/varnish-cache/bin/varnishtest/varnishtest.1 2009-06-17 05:20:34 UTC (rev 4107) @@ -69,23 +69,23 @@ .Ss Example script .Bd -literal -offset 4n # Start a varnish instance called "v1" -varnish v1 -arg "-b localhost:9080" -start +varnish v1 \-arg "\-b localhost:9080" \-start # Create a server thread called "s1" server s1 { # Receive a request rxreq # Send a standard response - txresp -hdr "Connection: close" -body "012345\\n" + txresp \-hdr "Connection: close" \-body "012345\\n" } # Start the server thread -server s1 -start +server s1 \-start # Create a client thread called "c1" client c1 { # Send a request - txreq -url "/" + txreq \-url "/" # Wait for a response rxresp # Insist that it be a success @@ -93,13 +93,13 @@ } # Run the client -client c1 -run +client c1 \-run # Wait for the server to die -server s1 -wait +server s1 \-wait # (Forcefully) Stop the varnish instance. -varnish v1 -stop +varnish v1 \-stop .Ed .Ss Example script output The output, running this script looks as follows. @@ -112,7 +112,7 @@ The rest of the line is anyones guess :-) .Bd -literal -offset 4n # TEST tests/b00000.vtc starting -### v1 CMD: cd ../varnishd && ./varnishd -d -d -n v1 -a :9081 -T :9001 -b localhost:9080 +### v1 CMD: cd ../varnishd && ./varnishd \-d \-d \-n v1 \-a :9081 \-T :9001 \-b localhost:9080 ### v1 opening CLI connection #### v1 debug| NB: Storage size limited to 2GB on 32 bit architecture,\\n #### v1 debug| NB: otherwise we could run out of address space.\\n Modified: trunk/varnish-cache/bin/varnishtop/varnishtop.1 =================================================================== --- trunk/varnish-cache/bin/varnishtop/varnishtop.1 2009-06-14 11:33:10 UTC (rev 4106) +++ trunk/varnish-cache/bin/varnishtop/varnishtop.1 2009-06-17 05:20:34 UTC (rev 4107) @@ -141,13 +141,13 @@ The following example displays a continuously updated list of the most frequently requested URLs: .Bd -literal -varnishtop -i RxURL +varnishtop \-i RxURL .Ed .Pp The following example displays a continuously updated list of the most commonly used user agents: .Bd -literal -varnishtop -i RxHeader -C -I \\^User-Agent +varnishtop \-i RxHeader \-C \-I \\^User-Agent .Ed .Sh SEE ALSO .Xr varnishd 1 , From sky at projects.linpro.no Wed Jun 17 10:59:05 2009 From: sky at projects.linpro.no (sky at projects.linpro.no) Date: Wed, 17 Jun 2009 12:59:05 +0200 (CEST) Subject: r4108 - / Message-ID: <20090617105905.8B8011F7C88@projects.linpro.no> Author: sky Date: 2009-06-17 12:59:05 +0200 (Wed, 17 Jun 2009) New Revision: 4108 Removed: branches/ Log: old branch From sky at projects.linpro.no Wed Jun 17 11:48:33 2009 From: sky at projects.linpro.no (sky at projects.linpro.no) Date: Wed, 17 Jun 2009 13:48:33 +0200 (CEST) Subject: r4108 - branches Message-ID: <20090617114833.BDCE01F7C83@projects.linpro.no> Author: sky Date: 2009-06-17 13:48:33 +0200 (Wed, 17 Jun 2009) New Revision: 4108 Removed: branches/gzip/ Log: old branch From sky at projects.linpro.no Wed Jun 17 11:49:25 2009 From: sky at projects.linpro.no (sky at projects.linpro.no) Date: Wed, 17 Jun 2009 13:49:25 +0200 (CEST) Subject: r4109 - branches Message-ID: <20090617114925.1B4B81F7C8A@projects.linpro.no> Author: sky Date: 2009-06-17 13:49:24 +0200 (Wed, 17 Jun 2009) New Revision: 4109 Removed: branches/nuke/ Log: old branch From sky at projects.linpro.no Wed Jun 17 12:33:43 2009 From: sky at projects.linpro.no (sky at projects.linpro.no) Date: Wed, 17 Jun 2009 14:33:43 +0200 (CEST) Subject: r4109 - branches Message-ID: <20090617123343.8F2751F7C78@projects.linpro.no> Author: sky Date: 2009-06-17 14:33:43 +0200 (Wed, 17 Jun 2009) New Revision: 4109 Removed: branches/gzip/ Log: old branch to be replaced From sky at projects.linpro.no Wed Jun 17 12:34:15 2009 From: sky at projects.linpro.no (sky at projects.linpro.no) Date: Wed, 17 Jun 2009 14:34:15 +0200 (CEST) Subject: r4110 - branches Message-ID: <20090617123415.6700A1F7C8D@projects.linpro.no> Author: sky Date: 2009-06-17 14:34:15 +0200 (Wed, 17 Jun 2009) New Revision: 4110 Added: branches/sky/ Log: to keep track of my patches From sky at projects.linpro.no Wed Jun 17 12:36:20 2009 From: sky at projects.linpro.no (sky at projects.linpro.no) Date: Wed, 17 Jun 2009 14:36:20 +0200 (CEST) Subject: r4111 - branches/sky Message-ID: <20090617123620.C0A111F7C90@projects.linpro.no> Author: sky Date: 2009-06-17 14:36:20 +0200 (Wed, 17 Jun 2009) New Revision: 4111 Added: branches/sky/if-none-match/ Log: if-none-match support based of r4110 Copied: branches/sky/if-none-match (from rev 4110, trunk) From sky at projects.linpro.no Wed Jun 17 13:16:46 2009 From: sky at projects.linpro.no (sky at projects.linpro.no) Date: Wed, 17 Jun 2009 15:16:46 +0200 (CEST) Subject: r4112 - in trunk/varnish-cache: . bin/varnishd bin/varnishlog bin/varnishncsa include/compat lib/libvarnishcompat Message-ID: <20090617131646.1FBBF1F7C8F@projects.linpro.no> Author: sky Date: 2009-06-17 15:16:45 +0200 (Wed, 17 Jun 2009) New Revision: 4112 Modified: trunk/varnish-cache/bin/varnishd/varnishd.c trunk/varnish-cache/bin/varnishlog/varnishlog.c trunk/varnish-cache/bin/varnishncsa/varnishncsa.c trunk/varnish-cache/configure.ac trunk/varnish-cache/include/compat/daemon.h trunk/varnish-cache/lib/libvarnishcompat/daemon.c Log: make -werror work on OSX again .. check for daemon only if it isn't OSX as well as rename the function to varnish_daemon not to clash with the OSX daemon definition, tested on linux and osx Modified: trunk/varnish-cache/bin/varnishd/varnishd.c =================================================================== --- trunk/varnish-cache/bin/varnishd/varnishd.c 2009-06-17 12:36:20 UTC (rev 4111) +++ trunk/varnish-cache/bin/varnishd/varnishd.c 2009-06-17 13:16:45 UTC (rev 4112) @@ -50,9 +50,7 @@ #include #include -#ifndef HAVE_DAEMON #include "compat/daemon.h" -#endif #ifndef HAVE_STRLCPY #include "compat/strlcpy.h" @@ -716,7 +714,7 @@ if (d_flag == 1) DebugStunt(); if (d_flag < 2 && !F_flag) - AZ(daemon(1, d_flag)); + AZ(varnish_daemon(1, d_flag)); if (d_flag == 1) printf("%d\n", getpid()); Modified: trunk/varnish-cache/bin/varnishlog/varnishlog.c =================================================================== --- trunk/varnish-cache/bin/varnishlog/varnishlog.c 2009-06-17 12:36:20 UTC (rev 4111) +++ trunk/varnish-cache/bin/varnishlog/varnishlog.c 2009-06-17 13:16:45 UTC (rev 4112) @@ -44,9 +44,7 @@ #include #include -#ifndef HAVE_DAEMON #include "compat/daemon.h" -#endif #include "vsb.h" #include "vpf.h" @@ -373,7 +371,7 @@ exit(1); } - if (D_flag && daemon(0, 0) == -1) { + if (D_flag && varnish_daemon(0, 0) == -1) { perror("daemon()"); if (pfh != NULL) vpf_remove(pfh); Modified: trunk/varnish-cache/bin/varnishncsa/varnishncsa.c =================================================================== --- trunk/varnish-cache/bin/varnishncsa/varnishncsa.c 2009-06-17 12:36:20 UTC (rev 4111) +++ trunk/varnish-cache/bin/varnishncsa/varnishncsa.c 2009-06-17 13:16:45 UTC (rev 4112) @@ -72,9 +72,7 @@ #include #include -#ifndef HAVE_DAEMON #include "compat/daemon.h" -#endif #include "vsb.h" #include "vpf.h" @@ -570,7 +568,7 @@ exit(1); } - if (D_flag && daemon(0, 0) == -1) { + if (D_flag && varnish_daemon(0, 0) == -1) { perror("daemon()"); if (pfh != NULL) vpf_remove(pfh); Modified: trunk/varnish-cache/configure.ac =================================================================== --- trunk/varnish-cache/configure.ac 2009-06-17 12:36:20 UTC (rev 4111) +++ trunk/varnish-cache/configure.ac 2009-06-17 13:16:45 UTC (rev 4112) @@ -177,7 +177,6 @@ AC_CHECK_FUNCS([srandomdev]) AC_CHECK_FUNCS([strlcat strlcpy]) AC_CHECK_FUNCS([strndup]) -AC_CHECK_FUNCS([daemon]) # white lie - we don't actually test it AC_MSG_CHECKING([whether daemon() works]) case $target in @@ -187,7 +186,7 @@ ac_cv_func_daemon=no ;; *) - AC_MSG_RESULT([yes]) + AC_CHECK_FUNCS([daemon]) ;; esac Modified: trunk/varnish-cache/include/compat/daemon.h =================================================================== --- trunk/varnish-cache/include/compat/daemon.h 2009-06-17 12:36:20 UTC (rev 4111) +++ trunk/varnish-cache/include/compat/daemon.h 2009-06-17 13:16:45 UTC (rev 4112) @@ -33,7 +33,9 @@ #define COMPAT_DAEMON_H_INCLUDED #ifndef HAVE_DAEMON -int daemon(int nochdir, int noclose); +int varnish_daemon(int nochdir, int noclose); +#else +#define varnish_daemon(a,b) daemon(a,b) #endif #endif Modified: trunk/varnish-cache/lib/libvarnishcompat/daemon.c =================================================================== --- trunk/varnish-cache/lib/libvarnishcompat/daemon.c 2009-06-17 12:36:20 UTC (rev 4111) +++ trunk/varnish-cache/lib/libvarnishcompat/daemon.c 2009-06-17 13:16:45 UTC (rev 4112) @@ -45,7 +45,7 @@ #include "compat/daemon.h" int -daemon(int nochdir, int noclose) +varnish_daemon(int nochdir, int noclose) { struct sigaction osa, sa; int fd; From sky at projects.linpro.no Wed Jun 17 13:18:40 2009 From: sky at projects.linpro.no (sky at projects.linpro.no) Date: Wed, 17 Jun 2009 15:18:40 +0200 (CEST) Subject: r4113 - branches/sky Message-ID: <20090617131840.80F911F7C94@projects.linpro.no> Author: sky Date: 2009-06-17 15:18:40 +0200 (Wed, 17 Jun 2009) New Revision: 4113 Removed: branches/sky/if-none-match/ Log: rebase From sky at projects.linpro.no Wed Jun 17 13:18:56 2009 From: sky at projects.linpro.no (sky at projects.linpro.no) Date: Wed, 17 Jun 2009 15:18:56 +0200 (CEST) Subject: r4114 - branches/sky Message-ID: <20090617131856.D84631F7C96@projects.linpro.no> Author: sky Date: 2009-06-17 15:18:56 +0200 (Wed, 17 Jun 2009) New Revision: 4114 Added: branches/sky/if-none-match/ Log: if-none-match support based of r4113 Copied: branches/sky/if-none-match (from rev 4113, trunk) From sky at projects.linpro.no Wed Jun 17 13:28:17 2009 From: sky at projects.linpro.no (sky at projects.linpro.no) Date: Wed, 17 Jun 2009 15:28:17 +0200 (CEST) Subject: r4115 - in branches/sky/if-none-match/varnish-cache/bin: varnishd varnishtest/tests Message-ID: <20090617132817.9D50B1F7C89@projects.linpro.no> Author: sky Date: 2009-06-17 15:28:16 +0200 (Wed, 17 Jun 2009) New Revision: 4115 Added: branches/sky/if-none-match/varnish-cache/bin/varnishtest/tests/c00025.vtc branches/sky/if-none-match/varnish-cache/bin/varnishtest/tests/c00026.vtc Modified: branches/sky/if-none-match/varnish-cache/bin/varnishd/cache_response.c Log: Add if-none-match support to allow people with compliant browsers to save a decent chunk of bandwidth Modified: branches/sky/if-none-match/varnish-cache/bin/varnishd/cache_response.c =================================================================== --- branches/sky/if-none-match/varnish-cache/bin/varnishd/cache_response.c 2009-06-17 13:18:56 UTC (rev 4114) +++ branches/sky/if-none-match/varnish-cache/bin/varnishd/cache_response.c 2009-06-17 13:28:16 UTC (rev 4115) @@ -57,8 +57,10 @@ http_PrintfHeader(sp->wrk, sp->fd, sp->wrk->resp, "Date: %s", lm); http_SetHeader(sp->wrk, sp->fd, sp->wrk->resp, "Via: 1.1 varnish"); http_PrintfHeader(sp->wrk, sp->fd, sp->wrk->resp, "X-Varnish: %u", sp->xid); - TIM_format(sp->obj->last_modified, lm); - http_PrintfHeader(sp->wrk, sp->fd, sp->wrk->resp, "Last-Modified: %s", lm); + if (sp->obj->last_modified) { + TIM_format(sp->obj->last_modified, lm); + http_PrintfHeader(sp->wrk, sp->fd, sp->wrk->resp, "Last-Modified: %s", lm); + } http_PrintfHeader(sp->wrk, sp->fd, sp->wrk->resp, "Connection: %s", sp->doclose ? "close" : "keep-alive"); sp->wantbody = 0; @@ -69,17 +71,33 @@ static int res_do_conds(struct sess *sp) { - char *p; + char *p, *e; double ims; + int do_cond = 0; - if (sp->obj->last_modified > 0 && - http_GetHdr(sp->http, H_If_Modified_Since, &p)) { + /* RFC 2616 13.3.4 states we need to match both ETag + and If-Modified-Since if present*/ + + if (http_GetHdr(sp->http, H_If_Modified_Since, &p) ) { + if (!sp->obj->last_modified) + return (0); ims = TIM_parse(p); if (ims > sp->t_req) /* [RFC2616 14.25] */ return (0); if (sp->obj->last_modified > ims) { return (0); } + do_cond = 1; + } + + if (http_GetHdr(sp->http, H_If_None_Match, &p) && + http_GetHdr(sp->obj->http, H_ETag, &e)) { + if (strcmp(p,e) != 0) + return (0); + do_cond = 1; + } + + if (do_cond == 1) { res_do_304(sp); return (1); } Added: branches/sky/if-none-match/varnish-cache/bin/varnishtest/tests/c00025.vtc =================================================================== --- branches/sky/if-none-match/varnish-cache/bin/varnishtest/tests/c00025.vtc (rev 0) +++ branches/sky/if-none-match/varnish-cache/bin/varnishtest/tests/c00025.vtc 2009-06-17 13:28:16 UTC (rev 4115) @@ -0,0 +1,33 @@ +# $Id$ + +test "Test If-None-Match" + +server s1 { + rxreq + expect req.url == "/foo" + txresp -hdr "ETag: 123456789" \ + -body "11111\n" +} -start + +varnish v1 -vcl+backend { } -start + +client c1 { + txreq -url "/foo" + rxresp + expect resp.status == 200 + expect resp.http.content-length == 6 + + txreq -url "/foo" \ + -hdr "If-None-Match: 12345678" + rxresp + expect resp.status == 200 + + txreq -url "/foo" \ + -hdr "If-None-Match: 123456789" + rxresp + expect resp.status == 304 +} + +client c1 -run + +client c1 -run Added: branches/sky/if-none-match/varnish-cache/bin/varnishtest/tests/c00026.vtc =================================================================== --- branches/sky/if-none-match/varnish-cache/bin/varnishtest/tests/c00026.vtc (rev 0) +++ branches/sky/if-none-match/varnish-cache/bin/varnishtest/tests/c00026.vtc 2009-06-17 13:28:16 UTC (rev 4115) @@ -0,0 +1,53 @@ +# $Id$ + +test "Test Combination of If-None-Match and If-Modified-Since" + +server s1 { + rxreq + expect req.url == "/foo" + txresp -hdr "ETag: 123456789" \ + -hdr "Last-Modified: Thu, 26 Jun 2008 12:00:01 GMT" \ + -body "11111\n" +} -start + +varnish v1 -vcl+backend { } -start + +client c1 { + txreq -url "/foo" + rxresp + expect resp.status == 200 + expect resp.http.content-length == 6 + + txreq -url "/foo" \ + -hdr "If-None-Match: 123456789" + rxresp + expect resp.status == 304 + + txreq -url "/foo" \ + -hdr "If-Modified-Since: Thu, 26 Jun 2008 12:00:01 GMT" + rxresp + expect resp.status == 304 + + txreq -url "/foo" \ + -hdr "If-Modified-Since: Thu, 26 Jun 2008 12:00:00 GMT" \ + -hdr "If-None-Match: 123456789" + rxresp + expect resp.status == 200 + + txreq -url "/foo" \ + -hdr "If-Modified-Since: Thu, 26 Jun 2008 12:00:01 GMT" \ + -hdr "If-None-Match: 12345678" + rxresp + expect resp.status == 200 + + txreq -url "/foo" \ + -hdr "If-Modified-Since: Thu, 26 Jun 2008 12:00:01 GMT" \ + -hdr "If-None-Match: 123456789" + rxresp + expect resp.status == 304 + +} + +client c1 -run + +client c1 -run From sky at projects.linpro.no Wed Jun 17 13:36:25 2009 From: sky at projects.linpro.no (sky at projects.linpro.no) Date: Wed, 17 Jun 2009 15:36:25 +0200 (CEST) Subject: r4116 - branches/sky Message-ID: <20090617133625.96ACD1F7C89@projects.linpro.no> Author: sky Date: 2009-06-17 15:36:25 +0200 (Wed, 17 Jun 2009) New Revision: 4116 Added: branches/sky/wrw_context_gzip/ Log: rewrite wrw to use a context struct to be able to add gzip based off r4113 Copied: branches/sky/wrw_context_gzip (from rev 4115, trunk) From sky at projects.linpro.no Wed Jun 17 13:50:26 2009 From: sky at projects.linpro.no (sky at projects.linpro.no) Date: Wed, 17 Jun 2009 15:50:26 +0200 (CEST) Subject: r4117 - branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd Message-ID: <20090617135026.8B71D1F7C91@projects.linpro.no> Author: sky Date: 2009-06-17 15:50:26 +0200 (Wed, 17 Jun 2009) New Revision: 4117 Modified: branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache.h branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_center.c branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_esi.c branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_fetch.c branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_http.c branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_pipe.c branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_pool.c branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_response.c branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_wrw.c Log: add a WRW context struct so we can a) abstract gzip into wrw b) have multiple wrw outstanding if we so see fit in the future Modified: branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache.h =================================================================== --- branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache.h 2009-06-17 13:36:25 UTC (rev 4116) +++ branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache.h 2009-06-17 13:50:26 UTC (rev 4117) @@ -95,6 +95,8 @@ struct ban; struct SHA256Context; +struct wrw_context; + struct smp_object; struct smp_seg; @@ -194,6 +196,18 @@ /*--------------------------------------------------------------------*/ + +struct wrw_context { + unsigned magic; +#define WRW_MAGIC 0x6395adce + + int *fd; + unsigned err; /* valid after WRK_Flush() */ + struct iovec iov[MAX_IOVS]; + int niov; + ssize_t liov; +}; + struct worker { unsigned magic; #define WORKER_MAGIC 0x6391adcf @@ -208,12 +222,6 @@ VTAILQ_ENTRY(worker) list; struct workreq *wrq; - int *wfd; - unsigned werr; /* valid after WRK_Flush() */ - struct iovec iov[MAX_IOVS]; - int niov; - ssize_t liov; - struct VCL_conf *vcl; unsigned char *wlb, *wlp, *wle; @@ -352,6 +360,10 @@ struct worker *wrk; + /* used for the delivery phase */ + struct wrw_context *wrw; + struct wrw_context *resp_wrw; + socklen_t sockaddrlen; socklen_t mysockaddrlen; struct sockaddr *sockaddr; @@ -502,7 +514,7 @@ const char *http_StatusMessage(unsigned); void HTTP_Init(void); void http_ClrHeader(struct http *to); -unsigned http_Write(struct worker *w, const struct http *hp, int resp); +unsigned http_Write(struct worker *w, struct wrw_context *wrw, const struct http *hp, int resp); void http_CopyResp(struct http *to, const struct http *fm); void http_SetResp(struct http *to, const char *proto, const char *status, const char *response); @@ -583,11 +595,12 @@ void WRK_QueueSession(struct sess *sp); void WRK_SumStat(const struct worker *w); -void WRW_Reserve(struct worker *w, int *fd); -unsigned WRW_Flush(struct worker *w); -unsigned WRW_FlushRelease(struct worker *w); -unsigned WRW_Write(struct worker *w, const void *ptr, int len); -unsigned WRW_WriteH(struct worker *w, const txt *hh, const char *suf); +struct wrw_context *WRW_New(struct sess *sp, int *fd); +void WRW_Reserve(struct wrw_context *wrw, int *fd); +unsigned WRW_Flush(struct wrw_context *wrw, struct worker *w); +unsigned WRW_FlushRelease(struct wrw_context *wrw, struct worker *w); +unsigned WRW_Write(struct wrw_context *wrw, struct worker *w, const void *ptr, int len); +unsigned WRW_WriteH(struct wrw_context *wrw, struct worker *w, const txt *hh, const char *suf); #ifdef SENDFILE_WORKS void WRW_Sendfile(struct worker *w, int fd, off_t off, unsigned len); #endif /* SENDFILE_WORKS */ Modified: branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_center.c =================================================================== --- branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_center.c 2009-06-17 13:36:25 UTC (rev 4116) +++ branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_center.c 2009-06-17 13:50:26 UTC (rev 4117) @@ -199,7 +199,7 @@ sp->restarts = 0; RES_WriteObj(sp); - AZ(sp->wrk->wfd); + // AZ(sp->wrk->wfd); HSH_Deref(sp->wrk, &sp->obj); sp->wrk->resp = NULL; sp->step = STP_DONE; @@ -531,7 +531,7 @@ sp->obj->last_modified = TIM_parse(b); i = FetchBody(sp); - AZ(sp->wrk->wfd); + // AZ(sp->wrk->wfd); AZ(sp->vbe); AN(sp->director); @@ -936,7 +936,7 @@ assert(sp->handling == VCL_RET_PIPE); PipeSession(sp); - AZ(sp->wrk->wfd); + // AZ(sp->wrk->wfd); sp->wrk->bereq = NULL; sp->step = STP_DONE; return (0); @@ -1174,7 +1174,7 @@ CHECK_OBJ_ORNULL(w->nobjhead, OBJHEAD_MAGIC); } WSL_Flush(w, 0); - AZ(w->wfd); + // AZ(w->wfd); } /* Modified: branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_esi.c =================================================================== --- branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_esi.c 2009-06-17 13:36:25 UTC (rev 4116) +++ branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_esi.c 2009-06-17 13:50:26 UTC (rev 4117) @@ -760,27 +760,29 @@ { struct esi_bit *eb; struct object *obj; + struct wrw_context *wrw; struct worker *w; char *ws_wm; struct http http_save; w = sp->wrk; - WRW_Reserve(w, &sp->fd); + wrw = sp->resp_wrw; + http_save.magic = 0; VTAILQ_FOREACH(eb, &sp->obj->esibits, list) { if (Tlen(eb->verbatim)) { if (sp->http->protover >= 1.1) - (void)WRW_Write(w, eb->chunk_length, -1); - sp->acct_req.bodybytes += WRW_Write(w, + (void)WRW_Write(wrw, w, eb->chunk_length, -1); + sp->acct_req.bodybytes += WRW_Write(wrw, w, eb->verbatim.b, Tlen(eb->verbatim)); if (sp->http->protover >= 1.1) - (void)WRW_Write(w, "\r\n", -1); + (void)WRW_Write(wrw, w, "\r\n", -1); } if (eb->include.b == NULL || sp->esis >= params->max_esi_includes) continue; - if (WRW_FlushRelease(w)) { + if (WRW_Flush(wrw, w)) { vca_close_session(sp, "remote closed"); return; } @@ -839,7 +841,6 @@ /* Reset the workspace */ WS_Reset(sp->ws, ws_wm); - WRW_Reserve(sp->wrk, &sp->fd); if (sp->fd < 0) break; } @@ -847,8 +848,8 @@ if (http_save.magic) *sp->http = http_save; if (sp->esis == 0 && sp->http->protover >= 1.1) - (void)WRW_Write(sp->wrk, "0\r\n\r\n", -1); - if (WRW_FlushRelease(sp->wrk)) + (void)WRW_Write(wrw, w, "0\r\n\r\n", -1); + if (WRW_Flush(sp->resp_wrw, sp->wrk)) vca_close_session(sp, "remote closed"); } Modified: branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_fetch.c =================================================================== --- branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_fetch.c 2009-06-17 13:36:25 UTC (rev 4116) +++ branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_fetch.c 2009-06-17 13:50:26 UTC (rev 4117) @@ -293,8 +293,8 @@ content_length -= rdcnt; if (!sp->sendbody) continue; - (void)WRW_Write(sp->wrk, buf, rdcnt); /* XXX: stats ? */ - if (WRW_Flush(sp->wrk)) + (void)WRW_Write(sp->wrw, sp->wrk, buf, rdcnt); /* XXX: stats ? */ + if (WRW_Flush(sp->wrw, sp->wrk)) return (2); } } @@ -313,6 +313,7 @@ { struct vbe_conn *vc; struct worker *w; + char *b; struct http *hp; int i; @@ -348,12 +349,12 @@ VBE_AddHostHeader(sp); TCP_blocking(vc->fd); /* XXX: we should timeout instead */ - WRW_Reserve(w, &vc->fd); - (void)http_Write(w, hp, 0); /* XXX: stats ? */ + sp->wrw = WRW_New(sp, &vc->fd); + (void)http_Write(w, sp->wrw, hp, 0); /* XXX: stats ? */ /* Deal with any message-body the request might have */ i = FetchReqBody(sp); - if (WRW_FlushRelease(w) || i > 0) { + if (WRW_FlushRelease(sp->wrw, w) || i > 0) { VBE_ClosedFd(sp); /* XXX: other cleanup ? */ return (__LINE__); Modified: branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_http.c =================================================================== --- branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_http.c 2009-06-17 13:36:25 UTC (rev 4116) +++ branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_http.c 2009-06-17 13:50:26 UTC (rev 4117) @@ -828,36 +828,36 @@ /*--------------------------------------------------------------------*/ unsigned -http_Write(struct worker *w, const struct http *hp, int resp) +http_Write(struct worker *w, struct wrw_context *wrw, const struct http *hp, int resp) { unsigned u, l; if (resp) { AN(hp->hd[HTTP_HDR_STATUS].b); - l = WRW_WriteH(w, &hp->hd[HTTP_HDR_PROTO], " "); - WSLH(w, *w->wfd, hp, HTTP_HDR_PROTO); - l += WRW_WriteH(w, &hp->hd[HTTP_HDR_STATUS], " "); - WSLH(w, *w->wfd, hp, HTTP_HDR_STATUS); - l += WRW_WriteH(w, &hp->hd[HTTP_HDR_RESPONSE], "\r\n"); - WSLH(w, *w->wfd, hp, HTTP_HDR_RESPONSE); + l = WRW_WriteH(wrw, w, &hp->hd[HTTP_HDR_PROTO], " "); + WSLH(w, *wrw->fd, hp, HTTP_HDR_PROTO); + l += WRW_WriteH(wrw, w, &hp->hd[HTTP_HDR_STATUS], " "); + WSLH(w, *wrw->fd, hp, HTTP_HDR_STATUS); + l += WRW_WriteH(wrw, w, &hp->hd[HTTP_HDR_RESPONSE], "\r\n"); + WSLH(w, *wrw->fd, hp, HTTP_HDR_RESPONSE); } else { AN(hp->hd[HTTP_HDR_URL].b); - l = WRW_WriteH(w, &hp->hd[HTTP_HDR_REQ], " "); - WSLH(w, *w->wfd, hp, HTTP_HDR_REQ); - l += WRW_WriteH(w, &hp->hd[HTTP_HDR_URL], " "); - WSLH(w, *w->wfd, hp, HTTP_HDR_URL); - l += WRW_WriteH(w, &hp->hd[HTTP_HDR_PROTO], "\r\n"); - WSLH(w, *w->wfd, hp, HTTP_HDR_PROTO); + l = WRW_WriteH(wrw, w, &hp->hd[HTTP_HDR_REQ], " "); + WSLH(w, *wrw->fd, hp, HTTP_HDR_REQ); + l += WRW_WriteH(wrw, w, &hp->hd[HTTP_HDR_URL], " "); + WSLH(w, *wrw->fd, hp, HTTP_HDR_URL); + l += WRW_WriteH(wrw, w, &hp->hd[HTTP_HDR_PROTO], "\r\n"); + WSLH(w, *wrw->fd, hp, HTTP_HDR_PROTO); } for (u = HTTP_HDR_FIRST; u < hp->nhd; u++) { if (hp->hd[u].b == NULL) continue; AN(hp->hd[u].b); AN(hp->hd[u].e); - l += WRW_WriteH(w, &hp->hd[u], "\r\n"); - WSLH(w, *w->wfd, hp, u); + l += WRW_WriteH(wrw, w, &hp->hd[u], "\r\n"); + WSLH(w, *wrw->fd, hp, u); } - l += WRW_Write(w, "\r\n", -1); + l += WRW_Write(wrw, w, "\r\n", -1); return (l); } Modified: branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_pipe.c =================================================================== --- branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_pipe.c 2009-06-17 13:36:25 UTC (rev 4116) +++ branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_pipe.c 2009-06-17 13:50:26 UTC (rev 4117) @@ -68,6 +68,7 @@ { struct vbe_conn *vc; struct worker *w; + struct wrw_context *wrw; struct pollfd fds[2]; int i; @@ -81,14 +82,15 @@ vc = sp->vbe; TCP_blocking(vc->fd); - WRW_Reserve(w, &vc->fd); - sp->acct_req.hdrbytes += http_Write(w, sp->wrk->bereq, 0); + + wrw = WRW_New(sp, &vc->fd); + sp->acct_req.hdrbytes += http_Write(w, wrw, sp->wrk->bereq, 0); if (sp->htc->pipeline.b != NULL) sp->acct_req.bodybytes += - WRW_Write(w, sp->htc->pipeline.b, Tlen(sp->htc->pipeline)); + WRW_Write(wrw, w, sp->htc->pipeline.b, Tlen(sp->htc->pipeline)); - i = WRW_FlushRelease(w); + i = WRW_FlushRelease(wrw, w); if (i) { vca_close_session(sp, "pipe"); Modified: branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_pool.c =================================================================== --- branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_pool.c 2009-06-17 13:36:25 UTC (rev 4116) +++ branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_pool.c 2009-06-17 13:50:26 UTC (rev 4117) @@ -179,7 +179,6 @@ AZ(w->beresp); AZ(w->resp); WS_Assert(w->ws); - AZ(w->wfd); assert(w->wlp == w->wlb); w->wrq = NULL; if (!Lck_Trylock(&wstat_mtx)) { Modified: branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_response.c =================================================================== --- branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_response.c 2009-06-17 13:36:25 UTC (rev 4116) +++ branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_response.c 2009-06-17 13:50:26 UTC (rev 4117) @@ -139,15 +139,15 @@ char lenbuf[20]; CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - WRW_Reserve(sp->wrk, &sp->fd); + if (!sp->resp_wrw) + sp->resp_wrw = WRW_New(sp, &sp->fd); if (sp->disable_esi || !sp->esis) - sp->acct_req.hdrbytes += http_Write(sp->wrk, sp->wrk->resp, 1); + sp->acct_req.hdrbytes += http_Write(sp->wrk, sp->resp_wrw, sp->wrk->resp, 1); if (!sp->disable_esi && sp->wantbody && !VTAILQ_EMPTY(&sp->obj->esibits)) { - if (WRW_FlushRelease(sp->wrk)) { + if (WRW_Flush(sp->resp_wrw, sp->wrk)) { vca_close_session(sp, "remote closed"); return; } @@ -161,7 +161,7 @@ sp->http->protover >= 1.1 && sp->obj->len > 0) { sprintf(lenbuf, "%x\r\n", sp->obj->len); - (void)WRW_Write(sp->wrk, lenbuf, -1); + (void)WRW_Write(sp->resp_wrw, sp->wrk, lenbuf, -1); } VTAILQ_FOREACH(st, &sp->obj->store, list) { @@ -185,15 +185,18 @@ } #endif /* SENDFILE_WORKS */ VSL_stats->n_objwrite++; - (void)WRW_Write(sp->wrk, st->ptr, st->len); + (void)WRW_Write(sp->resp_wrw, sp->wrk, st->ptr, st->len); } assert(u == sp->obj->len); if (!sp->disable_esi && sp->esis > 0 && sp->http->protover >= 1.1 && sp->obj->len > 0) - (void)WRW_Write(sp->wrk, "\r\n", -1); + (void)WRW_Write(sp->resp_wrw, sp->wrk, "\r\n", -1); } - if (WRW_FlushRelease(sp->wrk)) + if (WRW_Flush(sp->resp_wrw, sp->wrk)) vca_close_session(sp, "remote closed"); + + if (!sp->esis) + sp->resp_wrw = 0; } Modified: branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_wrw.c =================================================================== --- branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_wrw.c 2009-06-17 13:36:25 UTC (rev 4116) +++ branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_wrw.c 2009-06-17 13:50:26 UTC (rev 4117) @@ -70,95 +70,114 @@ * thread to complete the request without holding stuff locked. */ +struct wrw_context * +WRW_New(struct sess *sp, int *fd) +{ + struct wrw_context *wrw; + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + + wrw = (struct wrw_context *) WS_Alloc(sp->ws, (unsigned int) sizeof(struct wrw_context)); + wrw->magic = WRW_MAGIC; + wrw->fd = fd; + wrw->err = 0; + wrw->liov = 0; + wrw->niov = 0; + + return wrw; +} + void -WRW_Reserve(struct worker *w, int *fd) +WRW_Reserve(struct wrw_context *wrw, int *fd) { - CHECK_OBJ_NOTNULL(w, WORKER_MAGIC); - AZ(w->wfd); - w->werr = 0; - w->liov = 0; - w->niov = 0; - w->wfd = fd; + CHECK_OBJ_NOTNULL(wrw, WRW_MAGIC); + AZ(wrw->fd); + wrw->err = 0; + wrw->liov = 0; + wrw->niov = 0; + wrw->fd = fd; } static void -WRW_Release(struct worker *w) +WRW_Release(struct wrw_context *wrw) { - CHECK_OBJ_NOTNULL(w, WORKER_MAGIC); - w->werr = 0; - w->liov = 0; - w->niov = 0; - w->wfd = NULL; + CHECK_OBJ_NOTNULL(wrw, WRW_MAGIC); + wrw->err = 0; + wrw->liov = 0; + wrw->niov = 0; + wrw->fd = NULL; } unsigned -WRW_Flush(struct worker *w) +WRW_Flush(struct wrw_context *wrw, struct worker *w) { ssize_t i; + CHECK_OBJ_NOTNULL(wrw, WRW_MAGIC); CHECK_OBJ_NOTNULL(w, WORKER_MAGIC); - AN(w->wfd); - if (*w->wfd >= 0 && w->niov > 0 && w->werr == 0) { - i = writev(*w->wfd, w->iov, w->niov); - if (i != w->liov) { - w->werr++; - WSL(w, SLT_Debug, *w->wfd, + AN(wrw->fd); + if (*wrw->fd >= 0 && wrw->niov > 0 && wrw->err == 0) { + i = writev(*wrw->fd, wrw->iov, wrw->niov); + if (i != wrw->liov) { + wrw->err++; + WSL(w, SLT_Debug, *wrw->fd, "Write error, len = %d/%d, errno = %s", - i, w->liov, strerror(errno)); + i, wrw->liov, strerror(errno)); } } - w->liov = 0; - w->niov = 0; - return (w->werr); + wrw->liov = 0; + wrw->niov = 0; + return (wrw->err); } unsigned -WRW_FlushRelease(struct worker *w) +WRW_FlushRelease(struct wrw_context *wrw, struct worker *w) { unsigned u; - CHECK_OBJ_NOTNULL(w, WORKER_MAGIC); - AN(w->wfd); - u = WRW_Flush(w); - WRW_Release(w); + CHECK_OBJ_NOTNULL(wrw, WRW_MAGIC); + AN(wrw->fd); + u = WRW_Flush(wrw, w); + WRW_Release(wrw); return (u); } unsigned -WRW_WriteH(struct worker *w, const txt *hh, const char *suf) +WRW_WriteH(struct wrw_context *wrw, struct worker *w, const txt *hh, const char *suf) { unsigned u; - CHECK_OBJ_NOTNULL(w, WORKER_MAGIC); - AN(w->wfd); - AN(w); + CHECK_OBJ_NOTNULL(wrw, WRW_MAGIC); + AN(wrw->fd); + AN(wrw); AN(hh); AN(hh->b); AN(hh->e); - u = WRW_Write(w, hh->b, hh->e - hh->b); + u = WRW_Write(wrw, w, hh->b, hh->e - hh->b); if (suf != NULL) - u += WRW_Write(w, suf, -1); + u += WRW_Write(wrw, w, suf, -1); return (u); } unsigned -WRW_Write(struct worker *w, const void *ptr, int len) +WRW_Write(struct wrw_context *wrw, struct worker *w, const void *ptr, int len) { CHECK_OBJ_NOTNULL(w, WORKER_MAGIC); - AN(w->wfd); - if (len == 0 || *w->wfd < 0) + CHECK_OBJ_NOTNULL(wrw, WRW_MAGIC); + + AN(wrw->fd); + if (len == 0 || *wrw->fd < 0) return (0); if (len == -1) len = strlen(ptr); - if (w->niov == MAX_IOVS) - (void)WRW_Flush(w); - w->iov[w->niov].iov_base = TRUST_ME(ptr); - w->iov[w->niov].iov_len = len; - w->liov += len; - w->niov++; + if (wrw->niov == MAX_IOVS) + (void)WRW_Flush(wrw, w); + wrw->iov[wrw->niov].iov_base = TRUST_ME(ptr); + wrw->iov[wrw->niov].iov_len = len; + wrw->liov += len; + wrw->niov++; return (len); } From sky at projects.linpro.no Wed Jun 17 13:55:49 2009 From: sky at projects.linpro.no (sky at projects.linpro.no) Date: Wed, 17 Jun 2009 15:55:49 +0200 (CEST) Subject: r4118 - branches/sky Message-ID: <20090617135549.84D531F7C96@projects.linpro.no> Author: sky Date: 2009-06-17 15:55:49 +0200 (Wed, 17 Jun 2009) New Revision: 4118 Added: branches/sky/esi_last_modified/ Log: implement last-modified and if-modified-since correctly for ESI objects ; based off r4113 Copied: branches/sky/esi_last_modified (from rev 4117, trunk) From sky at projects.linpro.no Wed Jun 17 14:16:59 2009 From: sky at projects.linpro.no (sky at projects.linpro.no) Date: Wed, 17 Jun 2009 16:16:59 +0200 (CEST) Subject: r4119 - in branches/sky/esi_last_modified/varnish-cache/bin: varnishd varnishtest/tests Message-ID: <20090617141659.9C6841F7C93@projects.linpro.no> Author: sky Date: 2009-06-17 16:16:59 +0200 (Wed, 17 Jun 2009) New Revision: 4119 Added: branches/sky/esi_last_modified/varnish-cache/bin/varnishtest/tests/e00017.vtc branches/sky/esi_last_modified/varnish-cache/bin/varnishtest/tests/e00018.vtc branches/sky/esi_last_modified/varnish-cache/bin/varnishtest/tests/e00019.vtc branches/sky/esi_last_modified/varnish-cache/bin/varnishtest/tests/e00020.vtc Modified: branches/sky/esi_last_modified/varnish-cache/bin/varnishd/cache.h branches/sky/esi_last_modified/varnish-cache/bin/varnishd/cache_center.c branches/sky/esi_last_modified/varnish-cache/bin/varnishd/cache_esi.c branches/sky/esi_last_modified/varnish-cache/bin/varnishd/cache_response.c Log: Implement if-modified-since correctly for ESI We don't actually know the last-modified value of an ESI document until we have assembled it. At this point it is too late to give a correct value. This patch starts off by giving the first requestor of an object the last-modified of the container. This is safe because the worse that can happen is that a fragment has a higher last-modified and we waste some bandwidth. (Boy, trailers would be nice) As we assemble the fragments, we keep track of the highest last-modified value and store that in the object. Next time the object is requested, we return that last-modified. If we get an IMS and we have never assembled the object we assemble the object and then return it. (A future optimisation is to assemble it and then send not-modified if it isn't, purely to save bandwidth) If we have a cached value then we base the IMS of it. There is a race here that if a fragment is updated and noone has requested the entire object the cached value is stale and we will return not modified. I think this is fine for now since otherwise we have to a) keep reverse dependencies or b) pull all fragments together if it isn't needed A user can always get the latest version by doing a force reload, since the browser doesn't send if-modified-since on those. An improvement would be to keep track of the time any fragment expires an only cache the last-modified that long. Which would solve the problem for anyone who doesn't purge fragments to get them to update. This should probably have a parameter Modified: branches/sky/esi_last_modified/varnish-cache/bin/varnishd/cache.h =================================================================== --- branches/sky/esi_last_modified/varnish-cache/bin/varnishd/cache.h 2009-06-17 13:55:49 UTC (rev 4118) +++ branches/sky/esi_last_modified/varnish-cache/bin/varnishd/cache.h 2009-06-17 14:16:59 UTC (rev 4119) @@ -324,6 +324,8 @@ double grace; double last_modified; + double cache_last_modified; + double last_lru; struct http http[1]; @@ -387,6 +389,9 @@ /* Acceptable grace period */ double grace; + /* Cache last-modified for ESI purposes */ + double cache_last_modified; + enum step step; unsigned cur_method; unsigned handling; Modified: branches/sky/esi_last_modified/varnish-cache/bin/varnishd/cache_center.c =================================================================== --- branches/sky/esi_last_modified/varnish-cache/bin/varnishd/cache_center.c 2009-06-17 13:55:49 UTC (rev 4118) +++ branches/sky/esi_last_modified/varnish-cache/bin/varnishd/cache_center.c 2009-06-17 14:16:59 UTC (rev 4119) @@ -976,6 +976,8 @@ AN(sp->director); sp->disable_esi = 0; + if(!sp->esis) + sp->cache_last_modified = 0; VCL_recv_method(sp); if (sp->restarts >= params->max_restarts) { Modified: branches/sky/esi_last_modified/varnish-cache/bin/varnishd/cache_esi.c =================================================================== --- branches/sky/esi_last_modified/varnish-cache/bin/varnishd/cache_esi.c 2009-06-17 13:55:49 UTC (rev 4118) +++ branches/sky/esi_last_modified/varnish-cache/bin/varnishd/cache_esi.c 2009-06-17 14:16:59 UTC (rev 4119) @@ -836,6 +836,8 @@ sp->esis--; sp->obj = obj; + sp->obj->cache_last_modified = sp->cache_last_modified; + /* Reset the workspace */ WS_Reset(sp->ws, ws_wm); Modified: branches/sky/esi_last_modified/varnish-cache/bin/varnishd/cache_response.c =================================================================== --- branches/sky/esi_last_modified/varnish-cache/bin/varnishd/cache_response.c 2009-06-17 13:55:49 UTC (rev 4118) +++ branches/sky/esi_last_modified/varnish-cache/bin/varnishd/cache_response.c 2009-06-17 14:16:59 UTC (rev 4119) @@ -57,7 +57,9 @@ http_PrintfHeader(sp->wrk, sp->fd, sp->wrk->resp, "Date: %s", lm); http_SetHeader(sp->wrk, sp->fd, sp->wrk->resp, "Via: 1.1 varnish"); http_PrintfHeader(sp->wrk, sp->fd, sp->wrk->resp, "X-Varnish: %u", sp->xid); - TIM_format(sp->obj->last_modified, lm); + TIM_format(sp->obj->cache_last_modified ? + sp->obj->cache_last_modified : + sp->obj->last_modified, lm); http_PrintfHeader(sp->wrk, sp->fd, sp->wrk->resp, "Last-Modified: %s", lm); http_PrintfHeader(sp->wrk, sp->fd, sp->wrk->resp, "Connection: %s", sp->doclose ? "close" : "keep-alive"); @@ -77,6 +79,13 @@ ims = TIM_parse(p); if (ims > sp->t_req) /* [RFC2616 14.25] */ return (0); + + /* If we don't know the correct last-modified it is better to just send + back the full page -- else we risk stale displays on the client side */ + if (!sp->disable_esi && !VTAILQ_EMPTY(&sp->obj->esibits) && !sp->obj->cache_last_modified) + return (0); + if (sp->obj->cache_last_modified > ims) + return (0); if (sp->obj->last_modified > ims) { return (0); } @@ -137,12 +146,32 @@ struct storage *st; unsigned u = 0; char lenbuf[20]; + char lm[64]; CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); WRW_Reserve(sp->wrk, &sp->fd); + /* Assemble the highest modified in ESI chains */ + if (sp->obj->last_modified > sp->cache_last_modified) + sp->cache_last_modified = sp->obj->last_modified; + + /* We don't actually always have the correct last-modified + * If we have a cached version, then we use it + * Otherwise the worst case is we send a older header + * Which is fine + */ + + if (!sp->disable_esi && + !VTAILQ_EMPTY(&sp->obj->esibits) && + sp->esis == 0 && + sp->obj->cache_last_modified) { + TIM_format(sp->obj->cache_last_modified, lm); + http_Unset(sp->wrk->resp, H_Last_Modified); + http_PrintfHeader(sp->wrk, sp->fd, sp->wrk->resp, "Last-Modified: %s", lm); + } + if (sp->disable_esi || !sp->esis) sp->acct_req.hdrbytes += http_Write(sp->wrk, sp->wrk->resp, 1); Added: branches/sky/esi_last_modified/varnish-cache/bin/varnishtest/tests/e00017.vtc =================================================================== --- branches/sky/esi_last_modified/varnish-cache/bin/varnishtest/tests/e00017.vtc (rev 0) +++ branches/sky/esi_last_modified/varnish-cache/bin/varnishtest/tests/e00017.vtc 2009-06-17 14:16:59 UTC (rev 4119) @@ -0,0 +1,44 @@ +# $Id$ + +test "Cache the last-modified of ESI pages so we can do the right thing with them" + +server s1 { + rxreq + txresp -hdr "Last-Modified: Mon, 18 May 2009 23:33:01 GMT" -body { + + Before include + + After include + } + rxreq + expect req.url == "/body" + txresp -hdr "Last-Modified: Mon, 18 May 2009 23:34:01 GMT" -body { + Inside ESI + } +} -start + +varnish v1 -vcl+backend { + sub vcl_fetch { + set beresp.ttl = 600s; + esi; + } +} -start + +client c1 { + txreq + rxresp + expect resp.http.last-modified == "Mon, 18 May 2009 23:33:01 GMT" + delay 1 + txreq + rxresp + expect resp.http.last-modified == "Mon, 18 May 2009 23:34:01 GMT" + txreq -hdr "If-Modified-Since: Mon, 18 May 2009 23:33:01 GMT" + rxresp + expect resp.status == 200 + txreq -hdr "If-Modified-Since: Mon, 18 May 2009 23:34:01 GMT" + rxresp + expect resp.status == 304 +} + +client c1 -run +varnish v1 -expect esi_errors == 0 Property changes on: branches/sky/esi_last_modified/varnish-cache/bin/varnishtest/tests/e00017.vtc ___________________________________________________________________ Name: svn:keywords + Id Added: branches/sky/esi_last_modified/varnish-cache/bin/varnishtest/tests/e00018.vtc =================================================================== --- branches/sky/esi_last_modified/varnish-cache/bin/varnishtest/tests/e00018.vtc (rev 0) +++ branches/sky/esi_last_modified/varnish-cache/bin/varnishtest/tests/e00018.vtc 2009-06-17 14:16:59 UTC (rev 4119) @@ -0,0 +1,37 @@ +# $Id: e00015.vtc 4068 2009-05-11 08:50:45Z sky $ + +test "Test last-modified with intial ESI payload where there is no cached-last modified in which case we can't 304" + +server s1 { + rxreq + txresp -hdr "Last-Modified: Mon, 18 May 2009 23:33:01 GMT" -body { + + Before include + + After include + } + rxreq + expect req.url == "/body" + txresp -hdr "Last-Modified: Mon, 18 May 2009 23:34:01 GMT" -body { + Inside ESI + } +} -start + +varnish v1 -vcl+backend { + sub vcl_fetch { + set beresp.ttl = 600s; + esi; + } +} -start + +client c1 { + txreq -hdr "If-Modified-Since: Mon, 18 May 2009 23:33:01 GMT" + rxresp + expect resp.status == 200 + txreq -hdr "If-Modified-Since: Mon, 18 May 2009 23:34:01 GMT" + rxresp + expect resp.status == 304 +} + +client c1 -run +varnish v1 -expect esi_errors == 0 Added: branches/sky/esi_last_modified/varnish-cache/bin/varnishtest/tests/e00019.vtc =================================================================== --- branches/sky/esi_last_modified/varnish-cache/bin/varnishtest/tests/e00019.vtc (rev 0) +++ branches/sky/esi_last_modified/varnish-cache/bin/varnishtest/tests/e00019.vtc 2009-06-17 14:16:59 UTC (rev 4119) @@ -0,0 +1,44 @@ +# $Id$ + +test "Cache the last-modified of ESI pages so we can do the right thing with them" + +server s1 { + rxreq + txresp -hdr "Last-Modified: Mon, 18 May 2009 23:34:01 GMT" -body { + + Before include + + After include + } + rxreq + expect req.url == "/body" + txresp -hdr "Last-Modified: Mon, 18 May 2009 23:33:01 GMT" -body { + Inside ESI + } +} -start + +varnish v1 -vcl+backend { + sub vcl_fetch { + set beresp.ttl = 600s; + esi; + } +} -start + +client c1 { + txreq + rxresp + expect resp.http.last-modified == "Mon, 18 May 2009 23:34:01 GMT" + delay 1 + txreq + rxresp + expect resp.http.last-modified == "Mon, 18 May 2009 23:34:01 GMT" + txreq -hdr "If-Modified-Since: Mon, 18 May 2009 23:33:01 GMT" + rxresp + expect resp.status == 200 + txreq -hdr "If-Modified-Since: Mon, 18 May 2009 23:34:01 GMT" + rxresp + expect resp.status == 304 +} + +client c1 -run +varnish v1 -expect esi_errors == 0 Property changes on: branches/sky/esi_last_modified/varnish-cache/bin/varnishtest/tests/e00019.vtc ___________________________________________________________________ Name: svn:keywords + Id Added: branches/sky/esi_last_modified/varnish-cache/bin/varnishtest/tests/e00020.vtc =================================================================== --- branches/sky/esi_last_modified/varnish-cache/bin/varnishtest/tests/e00020.vtc (rev 0) +++ branches/sky/esi_last_modified/varnish-cache/bin/varnishtest/tests/e00020.vtc 2009-06-17 14:16:59 UTC (rev 4119) @@ -0,0 +1,50 @@ +# $Id$ + +test "Nested last-modified with ESI" + +server s1 { + rxreq + txresp -hdr "Last-Modified: Mon, 18 May 2009 23:34:01 GMT" -body { + + Before include + + After include + } + rxreq + expect req.url == "/body" + txresp -hdr "Last-Modified: Mon, 18 May 2009 23:33:01 GMT" -body { + Inside ESI + + } + rxreq + expect req.url == "/body2" + txresp -hdr "Last-Modified: Mon, 18 May 2009 23:35:01 GMT" -body { + Inside ESI2 + } +} -start + +varnish v1 -vcl+backend { + sub vcl_fetch { + set beresp.ttl = 600s; + esi; + } +} -start + +client c1 { + txreq + rxresp + expect resp.http.last-modified == "Mon, 18 May 2009 23:34:01 GMT" + delay 1 + txreq + rxresp + expect resp.http.last-modified == "Mon, 18 May 2009 23:35:01 GMT" + txreq -hdr "If-Modified-Since: Mon, 18 May 2009 23:34:01 GMT" + rxresp + expect resp.status == 200 + txreq -hdr "If-Modified-Since: Mon, 18 May 2009 23:35:01 GMT" + rxresp + expect resp.status == 304 +} + +client c1 -run +varnish v1 -expect esi_errors == 0 Property changes on: branches/sky/esi_last_modified/varnish-cache/bin/varnishtest/tests/e00020.vtc ___________________________________________________________________ Name: svn:keywords + Id From sky at projects.linpro.no Wed Jun 17 14:30:42 2009 From: sky at projects.linpro.no (sky at projects.linpro.no) Date: Wed, 17 Jun 2009 16:30:42 +0200 (CEST) Subject: r4120 - branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd Message-ID: <20090617143042.4991B1F7C9D@projects.linpro.no> Author: sky Date: 2009-06-17 16:30:42 +0200 (Wed, 17 Jun 2009) New Revision: 4120 Modified: branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_wrw.c Log: comment does not belong here Modified: branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_wrw.c =================================================================== --- branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_wrw.c 2009-06-17 14:16:59 UTC (rev 4119) +++ branches/sky/wrw_context_gzip/varnish-cache/bin/varnishd/cache_wrw.c 2009-06-17 14:30:42 UTC (rev 4120) @@ -26,18 +26,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * We maintain a number of worker thread pools, to spread lock contention. - * - * Pools can be added on the fly, as a means to mitigate lock contention, - * but can only be removed again by a restart. (XXX: we could fix that) - * - * Two threads herd the pools, one eliminates idle threads and aggregates - * statistics for all the pools, the other thread creates new threads - * on demand, subject to various numerical constraints. - * - * The algorithm for when to create threads needs to be reactive enough - * to handle startup spikes, but sufficiently attenuated to not cause - * thread pileups. This remains subject for improvement. */ #include "config.h" From ssm at redpill-linpro.com Thu Jun 18 07:05:59 2009 From: ssm at redpill-linpro.com (ssm) Date: Thu, 18 Jun 2009 09:05:59 +0200 Subject: r4104 - trunk/varnish-cache/bin/varnishd In-Reply-To: <86ws7bk64c.fsf@ds4.des.no> ("Dag-Erling =?utf-8?Q?Sm=C3=B8rg?= =?utf-8?Q?rav=22's?= message of "Wed, 17 Jun 2009 03:21:07 +0200") References: <20090613213337.361CE1F7C73@projects.linpro.no> <86ws7bk64c.fsf@ds4.des.no> Message-ID: <7xprd2nhrc.fsf@redpill-linpro.com> Dag-Erling Sm?rgrav writes: > Sentences must start on a new line so groff can tell the difference > between the period at the end of a sentence and the period at the end > of an abbreviation. Thanks, I'll fix. -- Stig Sandbeck Mathisen From ssm at projects.linpro.no Thu Jun 18 08:03:34 2009 From: ssm at projects.linpro.no (ssm at projects.linpro.no) Date: Thu, 18 Jun 2009 10:03:34 +0200 (CEST) Subject: r4121 - trunk/varnish-cache/bin/varnishd Message-ID: <20090618080334.30F7F1F7C9A@projects.linpro.no> Author: ssm Date: 2009-06-18 10:03:33 +0200 (Thu, 18 Jun 2009) New Revision: 4121 Modified: trunk/varnish-cache/bin/varnishd/varnishd.1 Log: Use correct syntax for quotes, emphasis and punctuation in varnishd.1 Modified: trunk/varnish-cache/bin/varnishd/varnishd.1 =================================================================== --- trunk/varnish-cache/bin/varnishd/varnishd.1 2009-06-17 14:30:42 UTC (rev 4120) +++ trunk/varnish-cache/bin/varnishd/varnishd.1 2009-06-18 08:03:33 UTC (rev 4121) @@ -375,15 +375,18 @@ or .Va server.ip depending on the presence of a Host: header in the request sent by the -client. The object hash may be modified further by +client. +The object hash may be modified further by .Va VCL. .It Cm purge.list Display the purge list. .Pp All requests for objects from the cache are matched against items on -the purge list. If an object in the cache is older than a matching -purge list item, it is considered "purged", and will be fetched from -the backend instead. +the purge list. +If an object in the cache is older than a matching purge list item, it +is considered +.Qq purged , +and will be fetched from the backend instead. .Pp When a purge expression is older than all the objects in the cache, it is removed from the list. @@ -633,9 +636,10 @@ .Dv off . .El .Ss Purge expressions -A purge expression consists of one or more conditions. A condition -consists of a field, a operator, and an argument. Conditions can be -ANDed together with "&&". +A purge expression consists of one or more conditions. +A condition consists of a field, an operator, and an argument. +Conditions can be ANDed together with +.Qq && . .Pp A field can be any of the variables from VCL, for instance .Va req.url , @@ -643,13 +647,27 @@ or .Va obj.set-cookie . .Pp -Operators are "==" for direct comparision, "~" for a regular -expression match, and ">" or "<" for size comparisons. Prepending an -operator with "!" negates the expression. +Operators are +.Qq == +for direct comparision, +.Qq ~ +for a regular expression match, and +.Qq > +or +.Qq < +for size comparisons. +Prepending an operator with +.Qq \&! +negates the expression. .Pp The argument could be a quoted string, a regexp, or an integer. -Integers can have "KB", "MB", "GB" or "TB" appended for size related -fields. +Integers can have +.Qq KB , +.Qq MB , +.Qq GB +or +.Qq TB +appended for size related fields. .Pp Simple example: All requests where .Va req.url @@ -660,15 +678,19 @@ req.url == "/news" .Ed .Pp -Example: Purge all documents where the name does not end with ".ogg", +Example: Purge all documents where the name does not end with +.Qq .ogg , and where the size of the object is greater than 10 megabytes. .Bd -literal -offset 4n req.url !~ "\\.ogg$" && obj.size > 10MB .Ed .Pp -Example: Purge all documents where the serving host is "example.com" -or "www.example.com", and where the Set-Cookie header received from -the backend contains "USERID=1663". +Example: Purge all documents where the serving host is +.Qq example.com +or +.Qq www.example.com , +and where the Set-Cookie header received from the backend contains +.Qq USERID=1663 . .Bd -literal -offset 4n req.http.host ~ "^(www\\.)example.com$" && obj.set-cookie ~ "USERID=1663" .Ed From phk at projects.linpro.no Thu Jun 18 16:13:24 2009 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Thu, 18 Jun 2009 18:13:24 +0200 (CEST) Subject: r4122 - trunk/varnish-cache/bin/varnishd Message-ID: <20090618161324.43F751F7C89@projects.linpro.no> Author: phk Date: 2009-06-18 18:13:24 +0200 (Thu, 18 Jun 2009) New Revision: 4122 Modified: trunk/varnish-cache/bin/varnishd/cache_ban.c trunk/varnish-cache/bin/varnishd/cache_ban.h Log: Do proper duplicate detection when we load the bans from the silo. Modified: trunk/varnish-cache/bin/varnishd/cache_ban.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_ban.c 2009-06-18 08:03:33 UTC (rev 4121) +++ trunk/varnish-cache/bin/varnishd/cache_ban.c 2009-06-18 16:13:24 UTC (rev 4122) @@ -60,8 +60,8 @@ #include "cache_ban.h" -struct banhead ban_head = VTAILQ_HEAD_INITIALIZER(ban_head); -struct lock ban_mtx; +static VTAILQ_HEAD(banhead,ban) ban_head = VTAILQ_HEAD_INITIALIZER(ban_head); +static struct lock ban_mtx; static struct ban *ban_magic; /*-------------------------------------------------------------------- @@ -529,23 +529,31 @@ } /*-------------------------------------------------------------------- - * Put a skeleton ban in the list, unless there is an indentical one - * already. + * Put a skeleton ban in the list, unless there is an identical, + * time & condition, ban already in place. + * + * If a newer ban has same condition, mark the new ban GONE, and + * mark any older bans, with the same condition, GONE as well. */ void BAN_Reload(double t0, unsigned flags, const char *ban) { struct ban *b, *b2; + int gone = 0; ASSERT_CLI(); (void)flags; /* for future use */ + VTAILQ_FOREACH(b, &ban_head, list) { - if (b->t0 > t0) + if (!strcmp(b->test, ban)) { + if (b->t0 > t0) + gone |= BAN_F_GONE; + else if (b->t0 == t0) + return; + } else if (b->t0 > t0) continue; - if (b->t0 == t0 && !strcmp(b->test, ban)) - return; if (b->t0 < t0) break; } @@ -558,17 +566,23 @@ b2->test = strdup(ban); AN(b2->test); b2->t0 = t0; - b2->flags |= BAN_F_PENDING; + b2->flags |= BAN_F_PENDING | gone; if (b == NULL) VTAILQ_INSERT_TAIL(&ban_head, b2, list); else VTAILQ_INSERT_BEFORE(b, b2, list); - /* XXX: Hunt duplicates down */ + /* Hunt down older duplicates */ + for (b = VTAILQ_NEXT(b2, list); b != NULL; b = VTAILQ_NEXT(b, list)) { + if (b->flags & BAN_F_GONE) + continue; + if (!strcmp(b->test, b2->test)) + b->flags |= BAN_F_GONE; + } } /*-------------------------------------------------------------------- - * All silos have read their bans now compile them. + * All silos have read their bans, now compile them. */ void @@ -585,6 +599,8 @@ if (!(b->flags & BAN_F_PENDING)) continue; b->flags &= ~BAN_F_PENDING; + if (b->flags & BAN_F_GONE) + continue; av = ParseArgv(b->test, 0); XXXAN(av); XXXAZ(av[0]); Modified: trunk/varnish-cache/bin/varnishd/cache_ban.h =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_ban.h 2009-06-18 08:03:33 UTC (rev 4121) +++ trunk/varnish-cache/bin/varnishd/cache_ban.h 2009-06-18 16:13:24 UTC (rev 4122) @@ -62,8 +62,3 @@ struct vsb *vsb; char *test; }; - -VTAILQ_HEAD(banhead,ban); - -extern struct banhead ban_head; -extern struct lock ban_mtx; From des at des.no Sat Jun 20 09:20:52 2009 From: des at des.no (=?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?=) Date: Sat, 20 Jun 2009 11:20:52 +0200 Subject: r4112 - in trunk/varnish-cache: . bin/varnishd bin/varnishlog bin/varnishncsa include/compat lib/libvarnishcompat In-Reply-To: <20090617131646.1FBBF1F7C8F@projects.linpro.no> (sky@projects.linpro.no's message of "Wed, 17 Jun 2009 15:16:46 +0200 (CEST)") References: <20090617131646.1FBBF1F7C8F@projects.linpro.no> Message-ID: <86ljnn5ki3.fsf@ds4.des.no> sky at projects.linpro.no writes: > Log: > make -werror work on OSX again .. check for daemon only if it isn't > OSX as well as rename the function to varnish_daemon not to clash with > the OSX daemon definition, tested on linux and osx How about you ask me first, so we can figure out the correct solution? It worked fine before you started messing with it. DES -- Dag-Erling Sm?rgrav - des at des.no From phk at projects.linpro.no Sun Jun 21 08:50:30 2009 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Sun, 21 Jun 2009 10:50:30 +0200 (CEST) Subject: r4123 - trunk/varnish-cache/bin/varnishd Message-ID: <20090621085030.785481F7C93@projects.linpro.no> Author: phk Date: 2009-06-21 10:50:30 +0200 (Sun, 21 Jun 2009) New Revision: 4123 Modified: trunk/varnish-cache/bin/varnishd/mgt_child.c Log: If we fail to start the child, set it to state stopping to prevent auto_restart from looping over what is almost guaranteed to be a problem it cannot solve. Modified: trunk/varnish-cache/bin/varnishd/mgt_child.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_child.c 2009-06-18 16:13:24 UTC (rev 4122) +++ trunk/varnish-cache/bin/varnishd/mgt_child.c 2009-06-21 08:50:30 UTC (rev 4123) @@ -344,7 +344,6 @@ e->callback = child_listener; AZ(vev_add(mgt_evb, e)); ev_listen = e; - AZ(ev_poker); if (params->ping_interval > 0) { e = vev_new(); @@ -361,11 +360,10 @@ if (mgt_push_vcls_and_start(&u, &p)) { REPORT(LOG_ERR, "Pushing vcls failed: %s", p); free(p); - /* Pick up any stuff lingering on stdout/stderr */ - (void)child_listener(NULL, EV_RD); - exit(2); - } - child_state = CH_RUNNING; + child_state = CH_RUNNING; + mgt_stop_child(); + } else + child_state = CH_RUNNING; } /*--------------------------------------------------------------------*/ From phk at projects.linpro.no Sun Jun 21 08:57:00 2009 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Sun, 21 Jun 2009 10:57:00 +0200 (CEST) Subject: r4124 - trunk/varnish-cache/bin/varnishd Message-ID: <20090621085700.99D8F1F7C99@projects.linpro.no> Author: phk Date: 2009-06-21 10:57:00 +0200 (Sun, 21 Jun 2009) New Revision: 4124 Modified: trunk/varnish-cache/bin/varnishd/storage_persistent.c Log: Add a missing assert to make sure we don't overrun the sg->objs array. Modified: trunk/varnish-cache/bin/varnishd/storage_persistent.c =================================================================== --- trunk/varnish-cache/bin/varnishd/storage_persistent.c 2009-06-21 08:50:30 UTC (rev 4123) +++ trunk/varnish-cache/bin/varnishd/storage_persistent.c 2009-06-21 08:57:00 UTC (rev 4124) @@ -345,7 +345,6 @@ return (1); si = sc->ident; -printf("VALID: %p\n", si); if (strcmp(si->ident, SMP_IDENT_STRING)) return (2); if (si->byte_order != 0x12345678) @@ -864,11 +863,13 @@ (void)sp; CAST_OBJ_NOTNULL(sc, priv, SMP_SC_MAGIC); + /* First, load all the objects from all segments */ VTAILQ_FOREACH(sg, &sc->segments, list) smp_load_seg(sp, sc, sg); sc->flags |= SMP_F_LOADED; BAN_Deref(&sc->tailban); + sc->tailban = NULL; while (1) sleep (1); return (NULL); @@ -907,9 +908,12 @@ /* XXX: save segments to ensure consistency between seg1 & seg2 ? */ + /* XXX: abandon early segments to make sure we have free space ? */ + /* Open a new segment, so we are ready to write */ smp_new_seg(sc); + /* Start the worker silo worker thread, it will load the objects */ WRK_BgThread(&sc->thread, "persistence", smp_thread, sc); VTAILQ_INSERT_TAIL(&silos, sc, list); @@ -950,6 +954,7 @@ Lck_Lock(&sc->mtx); sg = sc->cur_seg; + assert(sg->nalloc < sg->maxobj); so = &sg->objs[sg->nalloc++]; memcpy(so->hash, sp->obj->objhead->digest, DIGEST_LEN); so->ttl = sp->obj->ttl; From phk at projects.linpro.no Sun Jun 21 09:44:33 2009 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Sun, 21 Jun 2009 11:44:33 +0200 (CEST) Subject: r4125 - in trunk/varnish-cache: bin/varnishd include Message-ID: <20090621094433.98E031F7C9B@projects.linpro.no> Author: phk Date: 2009-06-21 11:44:33 +0200 (Sun, 21 Jun 2009) New Revision: 4125 Modified: trunk/varnish-cache/bin/varnishd/storage_persistent.c trunk/varnish-cache/include/persistent.h Log: Remove unused struct size macros Modified: trunk/varnish-cache/bin/varnishd/storage_persistent.c =================================================================== --- trunk/varnish-cache/bin/varnishd/storage_persistent.c 2009-06-21 08:57:00 UTC (rev 4124) +++ trunk/varnish-cache/bin/varnishd/storage_persistent.c 2009-06-21 09:44:33 UTC (rev 4125) @@ -411,9 +411,6 @@ #undef SIZOF assert(sizeof(struct smp_ident) == SMP_IDENT_SIZE); - /* XXX: assert(sizeof(struct smp_sign) == SMP_SIGN_SIZE); */ - /* XXX: assert(sizeof(struct smp_object) == SMP_OBJECT_SIZE); */ - /* XXX: assert(sizeof smp_object.hash == DIGEST_LEN); */ /* Allocate softc */ ALLOC_OBJ(sc, SMP_SC_MAGIC); Modified: trunk/varnish-cache/include/persistent.h =================================================================== --- trunk/varnish-cache/include/persistent.h 2009-06-21 08:57:00 UTC (rev 4124) +++ trunk/varnish-cache/include/persistent.h 2009-06-21 09:44:33 UTC (rev 4125) @@ -96,7 +96,11 @@ #define SMP_END_STUFF 5 }; -#define SMP_IDENT_SIZE (32 + 4 + 4 + 4 + 4 + 4 + 8 + 4 + 6 * 8) +/* + * The size of smp_ident should be fixed and constant across all platforms. + * We enforce that with the following #define and an assert in smp_init() + */ +#define SMP_IDENT_SIZE 112 #define SMP_IDENT_STRING "Varnish Persistent Storage Silo" @@ -111,7 +115,6 @@ uint64_t length; /* NB: Must be last */ }; -#define SMP_SIGN_SIZE (8 + 4 + 8 + 8) #define SMP_SIGN_SPACE (sizeof(struct smp_sign) + SHA256_LEN) /* @@ -123,8 +126,6 @@ uint64_t length; }; -#define SMP_SEGMENT_SIZE (8+8) - /* * Ban description */ @@ -147,8 +148,6 @@ uint64_t len; /* XXX: madvise */ }; -#define SMP_OBJECT_SIZE (32 + 8 + 8 + sizeof(void *) + 8) - /* * Segment */ From phk at projects.linpro.no Mon Jun 22 09:58:32 2009 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Mon, 22 Jun 2009 11:58:32 +0200 (CEST) Subject: r4126 - trunk/varnish-cache/bin/varnishd Message-ID: <20090622095832.6B1C51F7C74@projects.linpro.no> Author: phk Date: 2009-06-22 11:58:31 +0200 (Mon, 22 Jun 2009) New Revision: 4126 Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c trunk/varnish-cache/bin/varnishd/storage_persistent.c Log: Add level of segment/cleaner logic. Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_hash.c 2009-06-21 09:44:33 UTC (rev 4125) +++ trunk/varnish-cache/bin/varnishd/cache_hash.c 2009-06-22 09:58:31 UTC (rev 4126) @@ -407,6 +407,7 @@ VTAILQ_INSERT_TAIL(&oh->objcs, oc, list); /* NB: do not deref objhead the new object inherits our reference */ Lck_Unlock(&oh->mtx); + sp->wrk->stats->n_object++; /* XXX: Insert in EXP */ return (oc); Modified: trunk/varnish-cache/bin/varnishd/storage_persistent.c =================================================================== --- trunk/varnish-cache/bin/varnishd/storage_persistent.c 2009-06-21 09:44:33 UTC (rev 4125) +++ trunk/varnish-cache/bin/varnishd/storage_persistent.c 2009-06-22 09:58:31 UTC (rev 4126) @@ -37,6 +37,7 @@ SVNID("$Id$") #include +#include #include #include #include @@ -141,6 +142,18 @@ struct ban *tailban; struct lock mtx; + + /* Cleaner metrics */ + + unsigned min_nseg; + unsigned aim_nseg; + unsigned max_nseg; + + unsigned aim_nobj; + + uint64_t min_segl; + uint64_t aim_segl; + uint64_t max_segl; }; /* @@ -282,6 +295,21 @@ } /*-------------------------------------------------------------------- + * Caculate payload of some stuff + */ + +static uint64_t +smp_stuff_len(const struct smp_sc *sc, unsigned stuff) +{ + uint64_t l; + + assert(stuff < SMP_END_STUFF); + l = sc->ident->stuff[stuff + 1] - sc->ident->stuff[stuff]; + l -= SMP_SIGN_SPACE; + return (l); +} + +/*-------------------------------------------------------------------- * Initialize a Silo with a valid but empty structure. * * XXX: more intelligent sizing of things. @@ -361,15 +389,23 @@ return (8); sc->unique = si->unique; - /* XXX: Sanity check stuff[4] */ + /* XXX: Sanity check stuff[6] */ assert(si->stuff[SMP_BAN1_STUFF] > sizeof *si + SHA256_LEN); - assert(si->stuff[SMP_BAN2_STUFF] > si->stuff[0]); - assert(si->stuff[SMP_SEG1_STUFF] > si->stuff[1]); - assert(si->stuff[SMP_SEG2_STUFF] > si->stuff[2]); - assert(si->stuff[SMP_SPC_STUFF] > si->stuff[3]); + assert(si->stuff[SMP_BAN2_STUFF] > si->stuff[SMP_BAN1_STUFF]); + assert(si->stuff[SMP_SEG1_STUFF] > si->stuff[SMP_BAN2_STUFF]); + assert(si->stuff[SMP_SEG2_STUFF] > si->stuff[SMP_SEG1_STUFF]); + assert(si->stuff[SMP_SPC_STUFF] > si->stuff[SMP_SEG2_STUFF]); assert(si->stuff[SMP_END_STUFF] == sc->mediasize); + assert(smp_stuff_len(sc, SMP_SEG1_STUFF) > 65536); + assert(smp_stuff_len(sc, SMP_SEG1_STUFF) == + smp_stuff_len(sc, SMP_SEG2_STUFF)); + + assert(smp_stuff_len(sc, SMP_BAN1_STUFF) > 65536); + assert(smp_stuff_len(sc, SMP_BAN1_STUFF) == + smp_stuff_len(sc, SMP_BAN2_STUFF)); + smp_def_sign(sc, &sc->ban1, si->stuff[SMP_BAN1_STUFF], "BAN 1"); smp_def_sign(sc, &sc->ban2, si->stuff[SMP_BAN2_STUFF], "BAN 2"); smp_def_sign(sc, &sc->seg1, si->stuff[SMP_SEG1_STUFF], "SEG 1"); @@ -390,6 +426,69 @@ } /*-------------------------------------------------------------------- + * Calculate cleaner metrics from silo dimensions + */ + +static void +smp_metrics(struct smp_sc *sc) +{ + + /* + * We do not want to loose too big chunks of the silos + * content when we are forced to clean a segment. + * + * For now insist that a segment covers no more than 1% of the silo. + * + * XXX: This should possibly depend on the size of the silo so + * XXX: trivially small silos do not run into trouble along + * XXX: the lines of "one object per silo". + */ + + sc->min_nseg = 100; + sc->max_segl = smp_stuff_len(sc, SMP_SPC_STUFF) / sc->min_nseg; + + fprintf(stderr, "min_nseg = %u, max_segl = %ju\n", + sc->min_nseg, (uintmax_t)sc->max_segl); + + /* + * The number of segments are limited by the size of the segment + * table(s) and from that follows the minimum size of a segmement. + */ + + sc->max_nseg = smp_stuff_len(sc, SMP_SEG1_STUFF) / sc->min_nseg; + sc->min_segl = smp_stuff_len(sc, SMP_SPC_STUFF) / sc->max_nseg; + + fprintf(stderr, "max_nseg = %u, min_segl = %ju\n", + sc->max_nseg, (uintmax_t)sc->min_segl); + + /* + * Set our initial aim point at the exponential average of the + * two extremes. + * + * XXX: This is a pretty arbitrary choice, but having no idea + * XXX: object count, size distribution or ttl pattern at this + * XXX: point, we have to do something. + */ + + sc->aim_nseg = + (unsigned) exp((log(sc->min_nseg) + log(sc->max_nseg))*.5); + sc->aim_segl = smp_stuff_len(sc, SMP_SPC_STUFF) / sc->aim_nseg; + + fprintf(stderr, "aim_nseg = %u, aim_segl = %ju\n", + sc->aim_nseg, (uintmax_t)sc->aim_segl); + + /* + * Objects per segment + * + * XXX: calculate size of minimum object (workspace, http etc) + */ + + sc->aim_nobj = sc->max_segl / 4000; + + fprintf(stderr, "aim_nobj = %u\n", sc->aim_nobj); +} + +/*-------------------------------------------------------------------- * Set up persistent storage silo in the master process. */ @@ -447,12 +546,15 @@ smp_newsilo(sc); AZ(smp_valid_silo(sc)); + smp_metrics(sc); + parent->priv = sc; /* XXX: only for sendfile I guess... */ mgt_child_inherit(sc->fd, "storage_persistent"); } + /*-------------------------------------------------------------------- * Write the segmentlist back to the silo. * @@ -725,6 +827,7 @@ (void)HSH_Insert(sp); sg->nalloc++; } + WRK_SumStat(sp->wrk); } /*-------------------------------------------------------------------- @@ -772,7 +875,7 @@ ALLOC_OBJ(sg, SMP_SEG_MAGIC); AN(sg); - sg->maxobj = 16; /* XXX: param ? */ + sg->maxobj = sc->aim_nobj; sg->objs = malloc(sizeof *sg->objs * sg->maxobj); AN(sg->objs); @@ -786,7 +889,8 @@ sg->offset = sg2->offset + sg2->length; assert(sg->offset < sc->mediasize); } - sg->length = sc->ident->stuff[SMP_END_STUFF] - sg->offset; + sg->length = sc->aim_segl; + sg->length &= ~7; assert(sg->offset + sg->length <= sc->mediasize); @@ -951,6 +1055,12 @@ Lck_Lock(&sc->mtx); sg = sc->cur_seg; + if (sg->nalloc >= sg->maxobj) { + smp_close_seg(sc, sc->cur_seg); + smp_new_seg(sc); + fprintf(stderr, "New Segment\n"); + sg = sc->cur_seg; + } assert(sg->nalloc < sg->maxobj); so = &sg->objs[sg->nalloc++]; memcpy(so->hash, sp->obj->objhead->digest, DIGEST_LEN); From phk at projects.linpro.no Mon Jun 22 10:36:30 2009 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Mon, 22 Jun 2009 12:36:30 +0200 (CEST) Subject: r4127 - in trunk/varnish-cache/bin: varnishd varnishtest/tests Message-ID: <20090622103630.5F54B1F7C74@projects.linpro.no> Author: phk Date: 2009-06-22 12:36:30 +0200 (Mon, 22 Jun 2009) New Revision: 4127 Added: trunk/varnish-cache/bin/varnishtest/tests/p00004.vtc Modified: trunk/varnish-cache/bin/varnishd/storage_persistent.c Log: Insert persistent objects with a refcount of one for the hash-tree. Modified: trunk/varnish-cache/bin/varnishd/storage_persistent.c =================================================================== --- trunk/varnish-cache/bin/varnishd/storage_persistent.c 2009-06-22 09:58:31 UTC (rev 4126) +++ trunk/varnish-cache/bin/varnishd/storage_persistent.c 2009-06-22 10:36:30 UTC (rev 4127) @@ -620,7 +620,8 @@ AN(oc->flags & OC_F_PERSISTENT); oc->flags &= ~OC_F_PERSISTENT; - oc->obj->refcnt = 0; + /* refcnt is one because the object is in the hash */ + oc->obj->refcnt = 1; oc->obj->objcore = oc; oc->obj->objhead = oh; oc->obj->ban = oc->ban; Added: trunk/varnish-cache/bin/varnishtest/tests/p00004.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/p00004.vtc (rev 0) +++ trunk/varnish-cache/bin/varnishtest/tests/p00004.vtc 2009-06-22 10:36:30 UTC (rev 4127) @@ -0,0 +1,62 @@ +# $Id$ + +test "Check object references" + +shell "rm -f /tmp/__v1/_.per" + +server s1 { + rxreq + txresp -hdr "Foo: foo" + rxreq + txresp -hdr "Bar: bar" +} -start + +varnish v1 \ + -arg "-pdiag_bitmap=0x20000" \ + -arg "-spersistent,/tmp/__v1/_.per,10m" \ + -vcl+backend { } -start + +client c1 { + txreq -url "/foo" + rxresp + expect resp.status == 200 + expect resp.http.X-Varnish == "1001" + expect resp.http.foo == "foo" +} -run + +varnish v1 -expect n_object == 1 + +client c1 { + txreq -url "/bar" + rxresp + expect resp.status == 200 + expect resp.http.X-Varnish == "1002" + expect resp.http.bar == "bar" +} -run + +varnish v1 -expect n_object == 2 + +varnish v1 -cliok stop +varnish v1 -cliok start -cliok "debug.xid 2000" + +varnish v1 -expect n_object == 2 + +client c1 { + txreq -url "/foo" + rxresp + expect resp.status == 200 + expect resp.http.X-Varnish == "2001 1001" + expect resp.http.foo == "foo" +} -run + +varnish v1 -expect n_object == 2 + +client c1 { + txreq -url "/bar" + rxresp + expect resp.status == 200 + expect resp.http.X-Varnish == "2002 1002" + expect resp.http.bar == "bar" +} -run + +varnish v1 -expect n_object == 2 From phk at projects.linpro.no Mon Jun 22 10:56:30 2009 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Mon, 22 Jun 2009 12:56:30 +0200 (CEST) Subject: r4128 - trunk/varnish-cache/bin/varnishd Message-ID: <20090622105630.89BCB1F7C74@projects.linpro.no> Author: phk Date: 2009-06-22 12:56:30 +0200 (Mon, 22 Jun 2009) New Revision: 4128 Modified: trunk/varnish-cache/bin/varnishd/cache.h trunk/varnish-cache/bin/varnishd/cache_expire.c trunk/varnish-cache/bin/varnishd/cache_hash.c trunk/varnish-cache/bin/varnishd/storage_persistent.c Log: Inject persistent objects into the EXP engine. Modified: trunk/varnish-cache/bin/varnishd/cache.h =================================================================== --- trunk/varnish-cache/bin/varnishd/cache.h 2009-06-22 10:36:30 UTC (rev 4127) +++ trunk/varnish-cache/bin/varnishd/cache.h 2009-06-22 10:56:30 UTC (rev 4128) @@ -487,6 +487,7 @@ /* cache_expiry.c */ void EXP_Insert(struct object *o); +void EXP_Inject(struct objcore *oc, struct objcore_head *lru, double ttl); void EXP_Init(void); void EXP_Rearm(const struct object *o); int EXP_Touch(const struct object *o); Modified: trunk/varnish-cache/bin/varnishd/cache_expire.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_expire.c 2009-06-22 10:36:30 UTC (rev 4127) +++ trunk/varnish-cache/bin/varnishd/cache_expire.c 2009-06-22 10:56:30 UTC (rev 4128) @@ -97,6 +97,31 @@ */ void +EXP_Inject(struct objcore *oc, struct objcore_head *lru, double ttl) +{ + + CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); + + Lck_Lock(&exp_mtx); + assert(oc->timer_idx == BINHEAP_NOIDX); + oc->timer_when = ttl; + binheap_insert(exp_heap, oc); + assert(oc->timer_idx != BINHEAP_NOIDX); + if (lru != NULL) { + VTAILQ_INSERT_TAIL(lru, oc, lru_list); + oc->flags |= OC_F_ONLRU; + } + Lck_Unlock(&exp_mtx); +} + +/*-------------------------------------------------------------------- + * Object has been added to cache, record in lru & binheap. + * + * We grab a reference to the object, which will keep it around until + * we decide its time to let it go. + */ + +void EXP_Insert(struct object *o) { struct objcore *oc; Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_hash.c 2009-06-22 10:36:30 UTC (rev 4127) +++ trunk/varnish-cache/bin/varnishd/cache_hash.c 2009-06-22 10:56:30 UTC (rev 4128) @@ -408,8 +408,6 @@ /* NB: do not deref objhead the new object inherits our reference */ Lck_Unlock(&oh->mtx); sp->wrk->stats->n_object++; - - /* XXX: Insert in EXP */ return (oc); } Modified: trunk/varnish-cache/bin/varnishd/storage_persistent.c =================================================================== --- trunk/varnish-cache/bin/varnishd/storage_persistent.c 2009-06-22 10:36:30 UTC (rev 4127) +++ trunk/varnish-cache/bin/varnishd/storage_persistent.c 2009-06-22 10:56:30 UTC (rev 4128) @@ -800,6 +800,7 @@ uint64_t length; struct smp_segment *ss; struct smp_object *so; + struct objcore *oc; uint32_t no; double t_now = TIM_real(); struct smp_signctx ctx[1]; @@ -819,13 +820,15 @@ if (so->ttl < t_now) continue; HSH_Prealloc(sp); - sp->wrk->nobjcore->flags |= OC_F_PERSISTENT; - sp->wrk->nobjcore->flags &= ~OC_F_BUSY; - sp->wrk->nobjcore->obj = (void*)so; - sp->wrk->nobjcore->smp_seg = sg; - sp->wrk->nobjcore->ban = BAN_RefBan(so->ban, sc->tailban); + oc = sp->wrk->nobjcore; + oc->flags |= OC_F_PERSISTENT; + oc->flags &= ~OC_F_BUSY; + oc->obj = (void*)so; + oc->smp_seg = sg; + oc->ban = BAN_RefBan(so->ban, sc->tailban); memcpy(sp->wrk->nobjhead->digest, so->hash, SHA256_LEN); (void)HSH_Insert(sp); + EXP_Inject(oc, NULL, so->ttl); sg->nalloc++; } WRK_SumStat(sp->wrk); From phk at projects.linpro.no Mon Jun 22 11:24:03 2009 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Mon, 22 Jun 2009 13:24:03 +0200 (CEST) Subject: r4129 - trunk/varnish-cache/bin/varnishtest/tests Message-ID: <20090622112403.DC5F31F7C74@projects.linpro.no> Author: phk Date: 2009-06-22 13:24:03 +0200 (Mon, 22 Jun 2009) New Revision: 4129 Modified: trunk/varnish-cache/bin/varnishtest/tests/p00004.vtc Log: Use the correct -start & -stop args. Modified: trunk/varnish-cache/bin/varnishtest/tests/p00004.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/p00004.vtc 2009-06-22 10:56:30 UTC (rev 4128) +++ trunk/varnish-cache/bin/varnishtest/tests/p00004.vtc 2009-06-22 11:24:03 UTC (rev 4129) @@ -36,8 +36,9 @@ varnish v1 -expect n_object == 2 -varnish v1 -cliok stop -varnish v1 -cliok start -cliok "debug.xid 2000" +varnish v1 -stop +varnish v1 -start +varnish v1 -cliok "debug.xid 2000" varnish v1 -expect n_object == 2