From des at projects.linpro.no Fri Feb 10 12:48:04 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Fri, 10 Feb 2006 13:48:04 +0100 (CET) Subject: r2 - trunk Message-ID: <20060210124804.C0DDB1ED464@projects.linpro.no> Author: des Date: 2006-02-10 13:48:04 +0100 (Fri, 10 Feb 2006) New Revision: 2 Added: trunk/LICENSE Log: Two-clause BSD license. Assign copyright to Linpro for now. Added: trunk/LICENSE =================================================================== --- trunk/LICENSE 2006-02-01 18:54:53 UTC (rev 1) +++ trunk/LICENSE 2006-02-10 12:48:04 UTC (rev 2) @@ -0,0 +1,24 @@ +Copyright (c) 2006 Linpro AS +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 LINPRO AND ITS 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. From des at projects.linpro.no Fri Feb 10 14:41:36 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Fri, 10 Feb 2006 15:41:36 +0100 (CET) Subject: r3 - trunk Message-ID: <20060210144136.B75901ED499@projects.linpro.no> Author: des Date: 2006-02-10 15:41:36 +0100 (Fri, 10 Feb 2006) New Revision: 3 Added: trunk/Makefile.am trunk/autogen.sh trunk/configure.ac trunk/connection.c trunk/connection.h trunk/listener.c trunk/listener.h trunk/log.c trunk/request.c trunk/request.h trunk/varnish.c trunk/varnish.h Log: This is the skeleton code I wrote on my way back from Basel last fall. The code itself is probably not worth much, but I've put quite a lot of work into two portions of it: the autoconf framework and the listener code. Added: trunk/Makefile.am =================================================================== --- trunk/Makefile.am 2006-02-10 12:48:04 UTC (rev 2) +++ trunk/Makefile.am 2006-02-10 14:41:36 UTC (rev 3) @@ -0,0 +1,10 @@ +# $Id$ + +bin_PROGRAMS = varnish + +varnish_SOURCES = \ + connection.c \ + listener.c \ + log.c \ + request.c \ + varnish.c Property changes on: trunk/Makefile.am ___________________________________________________________________ Name: svn:keywords + Id Added: trunk/autogen.sh =================================================================== --- trunk/autogen.sh 2006-02-10 12:48:04 UTC (rev 2) +++ trunk/autogen.sh 2006-02-10 14:41:36 UTC (rev 3) @@ -0,0 +1,9 @@ +#!/bin/sh +# +# $Id$ +# + +aclocal +autoheader +automake --add-missing --copy --force --foreign +autoconf Property changes on: trunk/autogen.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + Id Added: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-02-10 12:48:04 UTC (rev 2) +++ trunk/configure.ac 2006-02-10 14:41:36 UTC (rev 3) @@ -0,0 +1,64 @@ +# $Id$ + +AC_PREREQ(2.59) +AC_COPYRIGHT([Copyright (c) 2006 Linpro AS]) +AC_REVISION([$Id$]) +AC_INIT([Varnish], [0.1], [varnish-dev at projects.linpro.no]) +AC_CONFIG_SRCDIR([varnish.c]) +AC_CONFIG_HEADER([config.h]) + +AC_CANONICAL_SYSTEM +AC_LANG(C) + +AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) + +# Compiler flags (assume GCC). +# This section *must* come before AC_PROG_CC / AC_PROG_CPP. +CFLAGS="${CFLAGS:--O2}" +AC_ARG_ENABLE(wall, + AS_HELP_STRING([--enable-wall],[use -Wall (default is NO)]), + CFLAGS="${CFLAGS} -Wall") +AC_ARG_ENABLE(pedantic, + AS_HELP_STRING([--enable-pedantic],[enable pedantic warnings (default is NO)]), + CFLAGS="${CFLAGS} -pedantic") +AC_ARG_ENABLE(werror, + AS_HELP_STRING([--enable-werror],[use -Werror (default is NO)]), + CFLAGS="${CFLAGS} -Werror") + +# Checks for programs. +AC_PROG_CC +AC_PROG_CPP +AC_PROG_INSTALL +AC_PROG_MAKE_SET + +# Checks for libraries. + +# Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS([sys/socket.h]) +AC_CHECK_HEADERS([netinet/in.h]) +AC_CHECK_HEADERS([stddef.h]) +AC_CHECK_HEADERS([stdlib.h]) +AC_CHECK_HEADERS([unistd.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_CHECK_MEMBERS([struct sockaddr.sa_len],,,[ +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +]) + +# Checks for library functions. +AC_TYPE_SIGNAL +AC_TYPE_SIZE_T +AC_FUNC_VPRINTF +AC_CHECK_FUNCS([strerror]) +AC_FUNC_STRERROR_R +AC_CHECK_FUNCS([socket]) + +AC_CONFIG_FILES([ + Makefile +]) +AC_OUTPUT Property changes on: trunk/configure.ac ___________________________________________________________________ Name: svn:keywords + Id Added: trunk/connection.c =================================================================== --- trunk/connection.c 2006-02-10 12:48:04 UTC (rev 2) +++ trunk/connection.c 2006-02-10 14:41:36 UTC (rev 3) @@ -0,0 +1,22 @@ +/* + * $Id$ + */ + +#include +#include + +#include + +#include +#include + +#include "varnish.h" +#include "connection.h" + +void +connection_destroy(struct connection *c) +{ + close(c->sd); + /* bzero(c, sizeof *c); */ + free(c); +} Property changes on: trunk/connection.c ___________________________________________________________________ Name: svn:keywords + Id Added: trunk/connection.h =================================================================== --- trunk/connection.h 2006-02-10 12:48:04 UTC (rev 2) +++ trunk/connection.h 2006-02-10 14:41:36 UTC (rev 3) @@ -0,0 +1,13 @@ +/* + * $Id$ + */ + +#ifndef CONNECTION_H_INCLUDED +#define CONNECTION_H_INCLUDED + +struct connection { + int sd; + struct sockaddr_storage addr; +}; + +#endif Property changes on: trunk/connection.h ___________________________________________________________________ Name: svn:keywords + Id Added: trunk/listener.c =================================================================== --- trunk/listener.c 2006-02-10 12:48:04 UTC (rev 2) +++ trunk/listener.c 2006-02-10 14:41:36 UTC (rev 3) @@ -0,0 +1,136 @@ +/* + * $Id$ + */ + +#include +#include + +#include + +#include +#include +#include +#include + +#include "varnish.h" +#include "listener.h" +#include "connection.h" + +/* + * Create a socket that listens on the specified port. We use an IPv6 TCP + * socket and clear the IPV6_V6ONLY option to accept IPv4 connections on + * the same socket. + */ +struct listener * +listener_create(int port) +{ + struct listener *l; + socklen_t addr_len; + int zero = 0; + + l = calloc(1, sizeof *l); + if (l == NULL) { + log_syserr("calloc()"); + return (NULL); + } + l->sd = -1; +#if defined(AF_INET6) && defined(IPV6_V6ONLY) + if ((l->sd = socket(AF_INET6, SOCK_STREAM, 0)) > 0) { + struct sockaddr_in6 *addr = (struct sockaddr_in6 *)&l->addr; +#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN + addr->sin6_len = +#endif + addr_len = sizeof *addr; + addr->sin6_family = AF_INET6; + addr->sin6_port = htons(port); + if (setsockopt(l->sd, IPPROTO_IPV6, IPV6_V6ONLY, &zero, sizeof zero) != 0) { + log_syserr("setsockopt()"); + return (NULL); + } + } else if (errno != EPROTONOSUPPORT) { + log_syserr("socket()"); + return (NULL); + } else +#endif + if ((l->sd = socket(AF_INET, SOCK_STREAM, 0)) > 0) { + struct sockaddr_in *addr = (struct sockaddr_in *)&l->addr; +#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN + addr->sin_len = +#endif + addr_len = sizeof *addr; + addr->sin_family = AF_INET; + addr->sin_port = htons(port); + } else { + log_syserr("socket()"); + return (NULL); + } + if (bind(l->sd, (struct sockaddr *)&l->addr, addr_len) != 0) { + log_syserr("bind()"); + return (NULL); + } + if (listen(l->sd, 16) != 0) { + log_syserr("listen()"); + return (NULL); + } + return (l); +} + +void +listener_destroy(struct listener *l) +{ + close(l->sd); + /* bzero(l, sizeof *l); */ + free(l); +} + +struct connection * +listener_accept(struct listener *l) +{ + struct connection *c; + socklen_t len; + + c = calloc(1, sizeof *c); + for (;;) { + len = sizeof c->addr; + c->sd = accept(l->sd, (struct sockaddr *)&c->addr, &len); + if (c->sd != -1) { + switch (c->addr.ss_family) { +#if defined(AF_INET6) + case AF_INET6: { + struct sockaddr_in6 *addr = + (struct sockaddr_in6 *)&c->addr; + uint16_t *ip = (uint16_t *)&addr->sin6_addr; + + log_info("%s(): [%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x]:%u", + __func__, + ntohs(ip[0]), ntohs(ip[1]), + ntohs(ip[2]), ntohs(ip[3]), + ntohs(ip[4]), ntohs(ip[5]), + ntohs(ip[6]), ntohs(ip[7]), + ntohs(addr->sin6_port)); + break; + } +#endif + case AF_INET: { + struct sockaddr_in *addr = + (struct sockaddr_in *)&c->addr; + uint8_t *ip = (uint8_t *)&addr->sin_addr; + + log_info("%s(): %u.%u.%u.%u:%u", + __func__, + ip[0], ip[1], ip[2], ip[3], + ntohs(addr->sin_port)); + break; + } + default: + LOG_UNREACHABLE(); + } + return (c); + } + if (errno != EINTR) { + log_syserr("accept()"); + free(c); + return (NULL); + } + } +} Property changes on: trunk/listener.c ___________________________________________________________________ Name: svn:keywords + Id Added: trunk/listener.h =================================================================== --- trunk/listener.h 2006-02-10 12:48:04 UTC (rev 2) +++ trunk/listener.h 2006-02-10 14:41:36 UTC (rev 3) @@ -0,0 +1,13 @@ +/* + * $Id$ + */ + +#ifndef LISTENER_H_INCLUDED +#define LISTENER_H_INCLUDED + +struct listener { + int sd; + struct sockaddr_storage addr; +}; + +#endif Property changes on: trunk/listener.h ___________________________________________________________________ Name: svn:keywords + Id Added: trunk/log.c =================================================================== --- trunk/log.c 2006-02-10 12:48:04 UTC (rev 2) +++ trunk/log.c 2006-02-10 14:41:36 UTC (rev 3) @@ -0,0 +1,94 @@ +/* + * $Id$ + */ + +#include + +#include +#include +#include +#include +#include +#include + +#include "varnish.h" + +static void +emit(const char *fmt, va_list ap) +{ + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); +} + +static void +sysemit(const char *fmt, va_list ap) +{ + char errstr[64]; + +#if defined(HAVE_STRERROR_R) + strerror_r(errno, errstr, sizeof errstr); +#else + snprintf(errstr, sizeof errstr, "%s", strerror(errno)); +#endif + vfprintf(stderr, fmt, ap); + fprintf(stderr, ": %s\n", errstr); +} + +static void +panic(void) +{ + signal(SIGABRT, SIG_DFL); + kill(getpid(), SIGABRT); +} + +void +log_info(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + emit(fmt, ap); + va_end(ap); +} + +void +log_err(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + emit(fmt, ap); + va_end(ap); +} + +void +log_syserr(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + sysemit(fmt, ap); + va_end(ap); +} + +void +log_panic(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + emit(fmt, ap); + va_end(ap); + panic(); +} + +void +log_syspanic(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + sysemit(fmt, ap); + va_end(ap); + panic(); +} Property changes on: trunk/log.c ___________________________________________________________________ Name: svn:keywords + Id Added: trunk/request.c =================================================================== --- trunk/request.c 2006-02-10 12:48:04 UTC (rev 2) +++ trunk/request.c 2006-02-10 14:41:36 UTC (rev 3) @@ -0,0 +1,31 @@ +/* + * $Id$ + */ + +#include + +#include "varnish.h" +#include "request.h" + +request_t * +request_wait(connection_t *c, unsigned int timeout) +{ + request_t *r; + + r = calloc(1, sizeof *r); + if (r == NULL) { + log_syserr("calloc()"); + return (NULL); + } + + /* ... */ + + return (r); +} + +void +request_destroy(request_t *r) +{ + /* bzero(r, sizeof *r); */ + free(r); +} Property changes on: trunk/request.c ___________________________________________________________________ Name: svn:keywords + Id Added: trunk/request.h =================================================================== --- trunk/request.h 2006-02-10 12:48:04 UTC (rev 2) +++ trunk/request.h 2006-02-10 14:41:36 UTC (rev 3) @@ -0,0 +1,12 @@ +/* + * $Id$ + */ + +#ifndef REQUEST_H_INCLUDED +#define REQUEST_H_INCLUDED + +struct request { + struct connection *conn; +}; + +#endif Property changes on: trunk/request.h ___________________________________________________________________ Name: svn:keywords + Id Added: trunk/varnish.c =================================================================== --- trunk/varnish.c 2006-02-10 12:48:04 UTC (rev 2) +++ trunk/varnish.c 2006-02-10 14:41:36 UTC (rev 3) @@ -0,0 +1,55 @@ +/* + * $Id$ + */ + +#include +#include +#include + +#include "varnish.h" + +static void +varnish(void) +{ + listener_t *l; + connection_t *c; + request_t *r; + + l = listener_create(8080); + while ((c = listener_accept(l)) != NULL) { + r = request_wait(c, 0); + /* ... */ + request_destroy(r); + connection_destroy(c); + } +} + +static void +usage(void) +{ + fprintf(stderr, "usage: varnish\n"); + exit(1); +} + +int +main(int argc, char *argv[]) +{ + int o; + + while ((o = getopt(argc, argv, "")) != -1) + switch (o) { + default: + usage(); + } + + argc -= optind; + argv += optind; + + if (argc != 0) + usage(); + + varnish(); + + LOG_UNREACHABLE(); + exit(1); +} Property changes on: trunk/varnish.c ___________________________________________________________________ Name: svn:keywords + Id Added: trunk/varnish.h =================================================================== --- trunk/varnish.h 2006-02-10 12:48:04 UTC (rev 2) +++ trunk/varnish.h 2006-02-10 14:41:36 UTC (rev 3) @@ -0,0 +1,38 @@ +/* + * $Id$ + */ + +#ifndef VARNISH_H_INCLUDED +#define VARNISH_H_INCLUDED + +#include "config.h" + +/* opaque structures */ +typedef struct listener listener_t; +typedef struct connection connection_t; +typedef struct request request_t; + +/* connection.c */ +void connection_destroy(connection_t *c); + +/* listener.c */ +listener_t *listener_create(int port); +void listener_destroy(listener_t *l); +connection_t *listener_accept(listener_t *l); + +/* log.c */ +void log_info(const char *fmt, ...); +void log_err(const char *fmt, ...); +void log_syserr(const char *fmt, ...); +void log_panic(const char *fmt, ...); +void log_syspanic(const char *fmt, ...); + +#define LOG_UNREACHABLE() \ + log_panic("%s(%d): %s(): unreachable code reached", \ + __FILE__, __LINE__, __func__) + +/* request.c */ +request_t *request_wait(connection_t *c, unsigned int timeout); +void request_destroy(request_t *r); + +#endif Property changes on: trunk/varnish.h ___________________________________________________________________ Name: svn:keywords + Id From des at projects.linpro.no Fri Feb 10 14:42:34 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Fri, 10 Feb 2006 15:42:34 +0100 (CET) Subject: r4 - trunk Message-ID: <20060210144234.29C901ED493@projects.linpro.no> Author: des Date: 2006-02-10 15:42:34 +0100 (Fri, 10 Feb 2006) New Revision: 4 Modified: trunk/Makefile.am trunk/autogen.sh trunk/configure.ac trunk/connection.c trunk/connection.h trunk/listener.c trunk/listener.h trunk/log.c trunk/request.c trunk/request.h trunk/varnish.c trunk/varnish.h Log: Enable keyword expansion. From des at projects.linpro.no Fri Feb 10 16:05:07 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Fri, 10 Feb 2006 17:05:07 +0100 (CET) Subject: r5 - trunk Message-ID: <20060210160507.AC3DA1ED1CC@projects.linpro.no> Author: des Date: 2006-02-10 17:05:07 +0100 (Fri, 10 Feb 2006) New Revision: 5 Modified: trunk/ Log: Ignore generated files. Property changes on: trunk ___________________________________________________________________ Name: svn:ignore + .deps Makefile Makefile.in aclocal.m4 autom4te.cache compile config.guess config.h config.h.in config.log config.status config.sub configure depcomp install-sh missing stamp-h1 varnish From des at projects.linpro.no Fri Feb 10 16:05:32 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Fri, 10 Feb 2006 17:05:32 +0100 (CET) Subject: r6 - trunk Message-ID: <20060210160532.B73D01ED4AF@projects.linpro.no> Author: des Date: 2006-02-10 17:05:32 +0100 (Fri, 10 Feb 2006) New Revision: 6 Added: trunk/log.h trunk/system-common.c trunk/system-linux-gnu.c trunk/system.h Modified: trunk/Makefile.am trunk/configure.ac trunk/connection.c trunk/connection.h trunk/listener.c trunk/listener.h trunk/log.c trunk/request.c trunk/request.h trunk/varnish.c trunk/varnish.h Log: Disentangle listener and connection, allowing the struct definitions to move out of the headers into the code, reducing header dependencies. Add code to detect the number of CPU cores on Linux. Fork as many listening child processes as we have CPU cores. Add timestamps and the current PID to log messages. Modified: trunk/Makefile.am =================================================================== --- trunk/Makefile.am 2006-02-10 16:05:07 UTC (rev 5) +++ trunk/Makefile.am 2006-02-10 16:05:32 UTC (rev 6) @@ -7,4 +7,6 @@ listener.c \ log.c \ request.c \ + system-common.c \ + system- at target_os@.c \ varnish.c Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-02-10 16:05:07 UTC (rev 5) +++ trunk/configure.ac 2006-02-10 16:05:32 UTC (rev 6) @@ -35,6 +35,8 @@ # Checks for header files. AC_HEADER_STDC +AC_HEADER_SYS_WAIT +AC_HEADER_TIME AC_CHECK_HEADERS([sys/socket.h]) AC_CHECK_HEADERS([netinet/in.h]) AC_CHECK_HEADERS([stddef.h]) Modified: trunk/connection.c =================================================================== --- trunk/connection.c 2006-02-10 16:05:07 UTC (rev 5) +++ trunk/connection.c 2006-02-10 16:05:32 UTC (rev 6) @@ -11,8 +11,66 @@ #include #include "varnish.h" +#include "log.h" #include "connection.h" +struct connection { + int sd; + struct sockaddr_storage addr; +}; + +/* + * Accepts a connection from the provided listening descriptor. Does not + * loop to handle EINTR or other similar conditions. + */ +connection_t * +connection_accept(int ld) +{ + connection_t *c; + socklen_t len; + + if ((c = calloc(1, sizeof *c)) == NULL) + return (NULL); + + len = sizeof c->addr; + if ((c->sd = accept(ld, (struct sockaddr *)&c->addr, &len)) == -1) { + free(c); + return (NULL); + } + switch (c->addr.ss_family) { +#if defined(AF_INET6) + case AF_INET6: { + struct sockaddr_in6 *addr = + (struct sockaddr_in6 *)&c->addr; + uint16_t *ip = (uint16_t *)&addr->sin6_addr; + + log_info("%s(): [%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x]:%u", + __func__, + ntohs(ip[0]), ntohs(ip[1]), + ntohs(ip[2]), ntohs(ip[3]), + ntohs(ip[4]), ntohs(ip[5]), + ntohs(ip[6]), ntohs(ip[7]), + ntohs(addr->sin6_port)); + break; + } +#endif + case AF_INET: { + struct sockaddr_in *addr = + (struct sockaddr_in *)&c->addr; + uint8_t *ip = (uint8_t *)&addr->sin_addr; + + log_info("%s(): %u.%u.%u.%u:%u", + __func__, + ip[0], ip[1], ip[2], ip[3], + ntohs(addr->sin_port)); + break; + } + default: + LOG_UNREACHABLE(); + } + return (c); +} + void connection_destroy(struct connection *c) { Modified: trunk/connection.h =================================================================== --- trunk/connection.h 2006-02-10 16:05:07 UTC (rev 5) +++ trunk/connection.h 2006-02-10 16:05:32 UTC (rev 6) @@ -5,9 +5,9 @@ #ifndef CONNECTION_H_INCLUDED #define CONNECTION_H_INCLUDED -struct connection { - int sd; - struct sockaddr_storage addr; -}; +typedef struct connection connection_t; +connection_t *connection_accept(int ld); +void connection_destroy(connection_t *c); + #endif Modified: trunk/listener.c =================================================================== --- trunk/listener.c 2006-02-10 16:05:07 UTC (rev 5) +++ trunk/listener.c 2006-02-10 16:05:32 UTC (rev 6) @@ -13,9 +13,15 @@ #include #include "varnish.h" -#include "listener.h" #include "connection.h" +#include "listener.h" +#include "log.h" +struct listener { + int sd; + struct sockaddr_storage addr; +}; + /* * Create a socket that listens on the specified port. We use an IPv6 TCP * socket and clear the IPV6_V6ONLY option to accept IPv4 connections on @@ -83,50 +89,14 @@ free(l); } -struct connection * +connection_t * listener_accept(struct listener *l) { - struct connection *c; - socklen_t len; + connection_t *c; - c = calloc(1, sizeof *c); for (;;) { - len = sizeof c->addr; - c->sd = accept(l->sd, (struct sockaddr *)&c->addr, &len); - if (c->sd != -1) { - switch (c->addr.ss_family) { -#if defined(AF_INET6) - case AF_INET6: { - struct sockaddr_in6 *addr = - (struct sockaddr_in6 *)&c->addr; - uint16_t *ip = (uint16_t *)&addr->sin6_addr; - - log_info("%s(): [%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x]:%u", - __func__, - ntohs(ip[0]), ntohs(ip[1]), - ntohs(ip[2]), ntohs(ip[3]), - ntohs(ip[4]), ntohs(ip[5]), - ntohs(ip[6]), ntohs(ip[7]), - ntohs(addr->sin6_port)); - break; - } -#endif - case AF_INET: { - struct sockaddr_in *addr = - (struct sockaddr_in *)&c->addr; - uint8_t *ip = (uint8_t *)&addr->sin_addr; - - log_info("%s(): %u.%u.%u.%u:%u", - __func__, - ip[0], ip[1], ip[2], ip[3], - ntohs(addr->sin_port)); - break; - } - default: - LOG_UNREACHABLE(); - } + if ((c = connection_accept(l->sd)) != NULL) return (c); - } if (errno != EINTR) { log_syserr("accept()"); free(c); Modified: trunk/listener.h =================================================================== --- trunk/listener.h 2006-02-10 16:05:07 UTC (rev 5) +++ trunk/listener.h 2006-02-10 16:05:32 UTC (rev 6) @@ -5,9 +5,12 @@ #ifndef LISTENER_H_INCLUDED #define LISTENER_H_INCLUDED -struct listener { - int sd; - struct sockaddr_storage addr; -}; +#include "connection.h" +typedef struct listener listener_t; + +listener_t *listener_create(int port); +void listener_destroy(listener_t *l); +connection_t *listener_accept(listener_t *l); + #endif Modified: trunk/log.c =================================================================== --- trunk/log.c 2006-02-10 16:05:07 UTC (rev 5) +++ trunk/log.c 2006-02-10 16:05:32 UTC (rev 6) @@ -2,20 +2,41 @@ * $Id$ */ +#include #include +#include #include #include #include #include #include +#ifdef TIME_WITH_SYS_TIME +#include +#endif #include #include "varnish.h" +#include "log.h" +#include "system.h" static void +timestamp(void) +{ + struct timeval now; + + if (gettimeofday(&now, NULL) == -1) + now.tv_sec = now.tv_usec = 0; + fprintf(stderr, "%lu.%06lu [%lu] ", + (unsigned long)now.tv_sec, + (unsigned long)now.tv_usec, + (unsigned long)sys.pid); +} + +static void emit(const char *fmt, va_list ap) { + timestamp(); vfprintf(stderr, fmt, ap); fprintf(stderr, "\n"); } @@ -30,6 +51,7 @@ #else snprintf(errstr, sizeof errstr, "%s", strerror(errno)); #endif + timestamp(); vfprintf(stderr, fmt, ap); fprintf(stderr, ": %s\n", errstr); } Added: trunk/log.h =================================================================== --- trunk/log.h 2006-02-10 16:05:07 UTC (rev 5) +++ trunk/log.h 2006-02-10 16:05:32 UTC (rev 6) @@ -0,0 +1,19 @@ +/* + * $Id$ + */ + +#ifndef LOG_H_INCLUDED +#define LOG_H_INCLUDED + + +void log_info(const char *fmt, ...); +void log_err(const char *fmt, ...); +void log_syserr(const char *fmt, ...); +void log_panic(const char *fmt, ...); +void log_syspanic(const char *fmt, ...); + +#define LOG_UNREACHABLE() \ + log_panic("%s(%d): %s(): unreachable code reached", \ + __FILE__, __LINE__, __func__) + +#endif Modified: trunk/request.c =================================================================== --- trunk/request.c 2006-02-10 16:05:07 UTC (rev 5) +++ trunk/request.c 2006-02-10 16:05:32 UTC (rev 6) @@ -5,8 +5,14 @@ #include #include "varnish.h" +#include "connection.h" +#include "log.h" #include "request.h" +struct request { + connection_t *conn; +}; + request_t * request_wait(connection_t *c, unsigned int timeout) { Modified: trunk/request.h =================================================================== --- trunk/request.h 2006-02-10 16:05:07 UTC (rev 5) +++ trunk/request.h 2006-02-10 16:05:32 UTC (rev 6) @@ -5,8 +5,9 @@ #ifndef REQUEST_H_INCLUDED #define REQUEST_H_INCLUDED -struct request { - struct connection *conn; -}; +typedef struct request request_t; +request_t *request_wait(connection_t *c, unsigned int timeout); +void request_destroy(request_t *r); + #endif Added: trunk/system-common.c =================================================================== --- trunk/system-common.c 2006-02-10 16:05:07 UTC (rev 5) +++ trunk/system-common.c 2006-02-10 16:05:32 UTC (rev 6) @@ -0,0 +1,35 @@ +/* + * $Id$ + */ + +#include + +#include + +#include "varnish.h" +#include "system.h" + +system_t sys; + +/* + * gather system information at startup + */ +void +system_init(void) +{ + sys.pid = getpid(); + system_init_ncpu(); +} + +/* + * fork() wrapper, updates sys.pid + */ +pid_t +system_fork(void) +{ + pid_t pid; + + if ((pid = fork()) == 0) + sys.pid = getpid(); + return (pid); +} Property changes on: trunk/system-common.c ___________________________________________________________________ Name: svn:keywords + Id Added: trunk/system-linux-gnu.c =================================================================== --- trunk/system-linux-gnu.c 2006-02-10 16:05:07 UTC (rev 5) +++ trunk/system-linux-gnu.c 2006-02-10 16:05:32 UTC (rev 6) @@ -0,0 +1,31 @@ +/* + * $Id$ + */ + +#include + +#include + +#include "varnish.h" +#include "log.h" +#include "system.h" + +void +system_init_ncpu(void) +{ + FILE *cpuinfo; + char line[256]; + int n; + + sys.ncpu = 0; + if ((cpuinfo = fopen("/proc/cpuinfo", "r")) == NULL) + return; + while (fgets(line, sizeof line, cpuinfo) != NULL) { + if (sscanf(line, "processor : %d", &n) == 1) + sys.ncpu++; + } + fclose(cpuinfo); + if (sys.ncpu == 0) + sys.ncpu = 1; + log_info("%d cpu(s)", sys.ncpu); +} Property changes on: trunk/system-linux-gnu.c ___________________________________________________________________ Name: svn:keywords + Id Added: trunk/system.h =================================================================== --- trunk/system.h 2006-02-10 16:05:07 UTC (rev 5) +++ trunk/system.h 2006-02-10 16:05:32 UTC (rev 6) @@ -0,0 +1,21 @@ +/* + * $Id$ + */ + +#ifndef SYSTEM_H_INCLUDED +#define SYSTEM_H_INCLUDED + +typedef struct system system_t; + +struct system { + int ncpu; + pid_t pid; +}; + +extern system_t sys; + +void system_init_ncpu(void); +void system_init(void); +pid_t system_fork(void); + +#endif Property changes on: trunk/system.h ___________________________________________________________________ Name: svn:keywords + Id Modified: trunk/varnish.c =================================================================== --- trunk/varnish.c 2006-02-10 16:05:07 UTC (rev 5) +++ trunk/varnish.c 2006-02-10 16:05:32 UTC (rev 6) @@ -2,29 +2,70 @@ * $Id$ */ +#include + +#include #include #include #include #include "varnish.h" +#include "connection.h" +#include "listener.h" +#include "log.h" +#include "request.h" +#include "system.h" static void -varnish(void) +varnish_child(listener_t *l) { - listener_t *l; connection_t *c; request_t *r; - l = listener_create(8080); while ((c = listener_accept(l)) != NULL) { r = request_wait(c, 0); /* ... */ request_destroy(r); connection_destroy(c); } + LOG_UNREACHABLE(); } static void +varnish(void) +{ + listener_t *l; + int i, status; + pid_t pid; + + system_init(); + log_info("starting Varnish"); + l = listener_create(8080); + for (i = 0; i < sys.ncpu; ++i) { + switch ((pid = system_fork())) { + case -1: + log_panic("fork()"); + break; + case 0: + varnish_child(l); + _exit(1); + break; + default: + log_info("forked child %lu", (unsigned long)pid); + break; + } + } + for (;;) { + if ((pid = wait(&status)) == -1) { + if (errno == ECHILD) + return; + } else { + log_info("child %lu exited", (unsigned long)pid); + } + } +} + +static void usage(void) { fprintf(stderr, "usage: varnish\n"); @@ -50,6 +91,5 @@ varnish(); - LOG_UNREACHABLE(); exit(1); } Modified: trunk/varnish.h =================================================================== --- trunk/varnish.h 2006-02-10 16:05:07 UTC (rev 5) +++ trunk/varnish.h 2006-02-10 16:05:32 UTC (rev 6) @@ -7,32 +7,4 @@ #include "config.h" -/* opaque structures */ -typedef struct listener listener_t; -typedef struct connection connection_t; -typedef struct request request_t; - -/* connection.c */ -void connection_destroy(connection_t *c); - -/* listener.c */ -listener_t *listener_create(int port); -void listener_destroy(listener_t *l); -connection_t *listener_accept(listener_t *l); - -/* log.c */ -void log_info(const char *fmt, ...); -void log_err(const char *fmt, ...); -void log_syserr(const char *fmt, ...); -void log_panic(const char *fmt, ...); -void log_syspanic(const char *fmt, ...); - -#define LOG_UNREACHABLE() \ - log_panic("%s(%d): %s(): unreachable code reached", \ - __FILE__, __LINE__, __func__) - -/* request.c */ -request_t *request_wait(connection_t *c, unsigned int timeout); -void request_destroy(request_t *r); - #endif From des at projects.linpro.no Sat Feb 11 00:04:28 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Sat, 11 Feb 2006 01:04:28 +0100 (CET) Subject: r7 - trunk Message-ID: <20060211000428.E585B1ED4A8@projects.linpro.no> Author: des Date: 2006-02-11 01:04:28 +0100 (Sat, 11 Feb 2006) New Revision: 7 Added: trunk/system-freebsd.c trunk/system-freebsd5.0.c trunk/system-freebsd6.0.c trunk/system-freebsd7.0.c Log: Add FreeBSD implementation of system_init_ncpu(). Added: trunk/system-freebsd.c =================================================================== --- trunk/system-freebsd.c 2006-02-10 16:05:32 UTC (rev 6) +++ trunk/system-freebsd.c 2006-02-11 00:04:28 UTC (rev 7) @@ -0,0 +1,21 @@ +/* + * $Id$ + */ + +#include +#include + +#include "varnish.h" +#include "log.h" +#include "system.h" + +void +system_init_ncpu(void) +{ + size_t size; + + size = sizeof sys.ncpu; + if (sysctlbyname("hw.ncpu", &sys.ncpu, &size, 0, 0) == -1) + sys.ncpu = 1; + log_info("%d cpu(s)", sys.ncpu); +} Added: trunk/system-freebsd5.0.c =================================================================== --- trunk/system-freebsd5.0.c 2006-02-10 16:05:32 UTC (rev 6) +++ trunk/system-freebsd5.0.c 2006-02-11 00:04:28 UTC (rev 7) @@ -0,0 +1 @@ +link system-freebsd.c \ No newline at end of file Property changes on: trunk/system-freebsd5.0.c ___________________________________________________________________ Name: svn:special + * Added: trunk/system-freebsd6.0.c =================================================================== --- trunk/system-freebsd6.0.c 2006-02-10 16:05:32 UTC (rev 6) +++ trunk/system-freebsd6.0.c 2006-02-11 00:04:28 UTC (rev 7) @@ -0,0 +1 @@ +link system-freebsd.c \ No newline at end of file Property changes on: trunk/system-freebsd6.0.c ___________________________________________________________________ Name: svn:special + * Added: trunk/system-freebsd7.0.c =================================================================== --- trunk/system-freebsd7.0.c 2006-02-10 16:05:32 UTC (rev 6) +++ trunk/system-freebsd7.0.c 2006-02-11 00:04:28 UTC (rev 7) @@ -0,0 +1 @@ +link system-freebsd.c \ No newline at end of file Property changes on: trunk/system-freebsd7.0.c ___________________________________________________________________ Name: svn:special + * From des at projects.linpro.no Mon Feb 20 10:11:10 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Mon, 20 Feb 2006 11:11:10 +0100 (CET) Subject: r8 - trunk Message-ID: <20060220101110.C78ED1ED50F@projects.linpro.no> Author: des Date: 2006-02-20 11:11:10 +0100 (Mon, 20 Feb 2006) New Revision: 8 Modified: trunk/LICENSE Log: Use dual copyright (Verdens Gang AS and Linpro AS) and the exact same license text as used by FreeBSD and OpenBSD. Modified: trunk/LICENSE =================================================================== --- trunk/LICENSE 2006-02-11 00:04:28 UTC (rev 7) +++ trunk/LICENSE 2006-02-20 10:11:10 UTC (rev 8) @@ -1,3 +1,4 @@ +Copyright (c) 2006 Verdens Gang AS Copyright (c) 2006 Linpro AS All rights reserved. @@ -5,16 +6,15 @@ 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. + 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 LINPRO AND ITS CONTRIBUTORS ``AS IS'' AND +THIS SOFTWARE IS PROVIDED BY 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 +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) From des at projects.linpro.no Wed Feb 22 14:31:40 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Wed, 22 Feb 2006 15:31:40 +0100 (CET) Subject: r9 - trunk Message-ID: <20060222143140.0F6751ED46F@projects.linpro.no> Author: des Date: 2006-02-22 15:31:39 +0100 (Wed, 22 Feb 2006) New Revision: 9 Added: trunk/varnish-cache/ trunk/varnish-doc/ trunk/varnish-proto/ trunk/varnish-tools/ Log: Additional subdivisions. From des at projects.linpro.no Wed Feb 22 14:38:21 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Wed, 22 Feb 2006 15:38:21 +0100 (CET) Subject: r10 - in trunk: . varnish-proto Message-ID: <20060222143821.764E41ED51C@projects.linpro.no> Author: des Date: 2006-02-22 15:38:21 +0100 (Wed, 22 Feb 2006) New Revision: 10 Added: trunk/varnish-proto/LICENSE trunk/varnish-proto/Makefile.am trunk/varnish-proto/autogen.sh trunk/varnish-proto/configure.ac trunk/varnish-proto/connection.c trunk/varnish-proto/connection.h trunk/varnish-proto/listener.c trunk/varnish-proto/listener.h trunk/varnish-proto/log.c trunk/varnish-proto/log.h trunk/varnish-proto/request.c trunk/varnish-proto/request.h trunk/varnish-proto/system-common.c trunk/varnish-proto/system-freebsd.c trunk/varnish-proto/system-freebsd5.0.c trunk/varnish-proto/system-freebsd6.0.c trunk/varnish-proto/system-freebsd7.0.c trunk/varnish-proto/system-linux-gnu.c trunk/varnish-proto/system.h trunk/varnish-proto/varnish.c trunk/varnish-proto/varnish.h Removed: trunk/LICENSE trunk/Makefile.am trunk/autogen.sh trunk/configure.ac trunk/connection.c trunk/connection.h trunk/listener.c trunk/listener.h trunk/log.c trunk/log.h trunk/request.c trunk/request.h trunk/system-common.c trunk/system-freebsd.c trunk/system-freebsd5.0.c trunk/system-freebsd6.0.c trunk/system-freebsd7.0.c trunk/system-linux-gnu.c trunk/system.h trunk/varnish.c trunk/varnish.h Modified: trunk/varnish-proto/ Log: Move prototype code into varnish-proto. Deleted: trunk/LICENSE =================================================================== --- trunk/LICENSE 2006-02-22 14:31:39 UTC (rev 9) +++ trunk/LICENSE 2006-02-22 14:38:21 UTC (rev 10) @@ -1,24 +0,0 @@ -Copyright (c) 2006 Verdens Gang AS -Copyright (c) 2006 Linpro AS -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. -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 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. Deleted: trunk/Makefile.am =================================================================== --- trunk/Makefile.am 2006-02-22 14:31:39 UTC (rev 9) +++ trunk/Makefile.am 2006-02-22 14:38:21 UTC (rev 10) @@ -1,12 +0,0 @@ -# $Id$ - -bin_PROGRAMS = varnish - -varnish_SOURCES = \ - connection.c \ - listener.c \ - log.c \ - request.c \ - system-common.c \ - system- at target_os@.c \ - varnish.c Deleted: trunk/autogen.sh =================================================================== --- trunk/autogen.sh 2006-02-22 14:31:39 UTC (rev 9) +++ trunk/autogen.sh 2006-02-22 14:38:21 UTC (rev 10) @@ -1,9 +0,0 @@ -#!/bin/sh -# -# $Id$ -# - -aclocal -autoheader -automake --add-missing --copy --force --foreign -autoconf Deleted: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-02-22 14:31:39 UTC (rev 9) +++ trunk/configure.ac 2006-02-22 14:38:21 UTC (rev 10) @@ -1,66 +0,0 @@ -# $Id$ - -AC_PREREQ(2.59) -AC_COPYRIGHT([Copyright (c) 2006 Linpro AS]) -AC_REVISION([$Id$]) -AC_INIT([Varnish], [0.1], [varnish-dev at projects.linpro.no]) -AC_CONFIG_SRCDIR([varnish.c]) -AC_CONFIG_HEADER([config.h]) - -AC_CANONICAL_SYSTEM -AC_LANG(C) - -AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) - -# Compiler flags (assume GCC). -# This section *must* come before AC_PROG_CC / AC_PROG_CPP. -CFLAGS="${CFLAGS:--O2}" -AC_ARG_ENABLE(wall, - AS_HELP_STRING([--enable-wall],[use -Wall (default is NO)]), - CFLAGS="${CFLAGS} -Wall") -AC_ARG_ENABLE(pedantic, - AS_HELP_STRING([--enable-pedantic],[enable pedantic warnings (default is NO)]), - CFLAGS="${CFLAGS} -pedantic") -AC_ARG_ENABLE(werror, - AS_HELP_STRING([--enable-werror],[use -Werror (default is NO)]), - CFLAGS="${CFLAGS} -Werror") - -# Checks for programs. -AC_PROG_CC -AC_PROG_CPP -AC_PROG_INSTALL -AC_PROG_MAKE_SET - -# Checks for libraries. - -# Checks for header files. -AC_HEADER_STDC -AC_HEADER_SYS_WAIT -AC_HEADER_TIME -AC_CHECK_HEADERS([sys/socket.h]) -AC_CHECK_HEADERS([netinet/in.h]) -AC_CHECK_HEADERS([stddef.h]) -AC_CHECK_HEADERS([stdlib.h]) -AC_CHECK_HEADERS([unistd.h]) - -# Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_CHECK_MEMBERS([struct sockaddr.sa_len],,,[ -#include -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -]) - -# Checks for library functions. -AC_TYPE_SIGNAL -AC_TYPE_SIZE_T -AC_FUNC_VPRINTF -AC_CHECK_FUNCS([strerror]) -AC_FUNC_STRERROR_R -AC_CHECK_FUNCS([socket]) - -AC_CONFIG_FILES([ - Makefile -]) -AC_OUTPUT Deleted: trunk/connection.c =================================================================== --- trunk/connection.c 2006-02-22 14:31:39 UTC (rev 9) +++ trunk/connection.c 2006-02-22 14:38:21 UTC (rev 10) @@ -1,80 +0,0 @@ -/* - * $Id$ - */ - -#include -#include - -#include - -#include -#include - -#include "varnish.h" -#include "log.h" -#include "connection.h" - -struct connection { - int sd; - struct sockaddr_storage addr; -}; - -/* - * Accepts a connection from the provided listening descriptor. Does not - * loop to handle EINTR or other similar conditions. - */ -connection_t * -connection_accept(int ld) -{ - connection_t *c; - socklen_t len; - - if ((c = calloc(1, sizeof *c)) == NULL) - return (NULL); - - len = sizeof c->addr; - if ((c->sd = accept(ld, (struct sockaddr *)&c->addr, &len)) == -1) { - free(c); - return (NULL); - } - switch (c->addr.ss_family) { -#if defined(AF_INET6) - case AF_INET6: { - struct sockaddr_in6 *addr = - (struct sockaddr_in6 *)&c->addr; - uint16_t *ip = (uint16_t *)&addr->sin6_addr; - - log_info("%s(): [%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x]:%u", - __func__, - ntohs(ip[0]), ntohs(ip[1]), - ntohs(ip[2]), ntohs(ip[3]), - ntohs(ip[4]), ntohs(ip[5]), - ntohs(ip[6]), ntohs(ip[7]), - ntohs(addr->sin6_port)); - break; - } -#endif - case AF_INET: { - struct sockaddr_in *addr = - (struct sockaddr_in *)&c->addr; - uint8_t *ip = (uint8_t *)&addr->sin_addr; - - log_info("%s(): %u.%u.%u.%u:%u", - __func__, - ip[0], ip[1], ip[2], ip[3], - ntohs(addr->sin_port)); - break; - } - default: - LOG_UNREACHABLE(); - } - return (c); -} - -void -connection_destroy(struct connection *c) -{ - close(c->sd); - /* bzero(c, sizeof *c); */ - free(c); -} Deleted: trunk/connection.h =================================================================== --- trunk/connection.h 2006-02-22 14:31:39 UTC (rev 9) +++ trunk/connection.h 2006-02-22 14:38:21 UTC (rev 10) @@ -1,13 +0,0 @@ -/* - * $Id$ - */ - -#ifndef CONNECTION_H_INCLUDED -#define CONNECTION_H_INCLUDED - -typedef struct connection connection_t; - -connection_t *connection_accept(int ld); -void connection_destroy(connection_t *c); - -#endif Deleted: trunk/listener.c =================================================================== --- trunk/listener.c 2006-02-22 14:31:39 UTC (rev 9) +++ trunk/listener.c 2006-02-22 14:38:21 UTC (rev 10) @@ -1,106 +0,0 @@ -/* - * $Id$ - */ - -#include -#include - -#include - -#include -#include -#include -#include - -#include "varnish.h" -#include "connection.h" -#include "listener.h" -#include "log.h" - -struct listener { - int sd; - struct sockaddr_storage addr; -}; - -/* - * Create a socket that listens on the specified port. We use an IPv6 TCP - * socket and clear the IPV6_V6ONLY option to accept IPv4 connections on - * the same socket. - */ -struct listener * -listener_create(int port) -{ - struct listener *l; - socklen_t addr_len; - int zero = 0; - - l = calloc(1, sizeof *l); - if (l == NULL) { - log_syserr("calloc()"); - return (NULL); - } - l->sd = -1; -#if defined(AF_INET6) && defined(IPV6_V6ONLY) - if ((l->sd = socket(AF_INET6, SOCK_STREAM, 0)) > 0) { - struct sockaddr_in6 *addr = (struct sockaddr_in6 *)&l->addr; -#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN - addr->sin6_len = -#endif - addr_len = sizeof *addr; - addr->sin6_family = AF_INET6; - addr->sin6_port = htons(port); - if (setsockopt(l->sd, IPPROTO_IPV6, IPV6_V6ONLY, &zero, sizeof zero) != 0) { - log_syserr("setsockopt()"); - return (NULL); - } - } else if (errno != EPROTONOSUPPORT) { - log_syserr("socket()"); - return (NULL); - } else -#endif - if ((l->sd = socket(AF_INET, SOCK_STREAM, 0)) > 0) { - struct sockaddr_in *addr = (struct sockaddr_in *)&l->addr; -#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN - addr->sin_len = -#endif - addr_len = sizeof *addr; - addr->sin_family = AF_INET; - addr->sin_port = htons(port); - } else { - log_syserr("socket()"); - return (NULL); - } - if (bind(l->sd, (struct sockaddr *)&l->addr, addr_len) != 0) { - log_syserr("bind()"); - return (NULL); - } - if (listen(l->sd, 16) != 0) { - log_syserr("listen()"); - return (NULL); - } - return (l); -} - -void -listener_destroy(struct listener *l) -{ - close(l->sd); - /* bzero(l, sizeof *l); */ - free(l); -} - -connection_t * -listener_accept(struct listener *l) -{ - connection_t *c; - - for (;;) { - if ((c = connection_accept(l->sd)) != NULL) - return (c); - if (errno != EINTR) { - log_syserr("accept()"); - free(c); - return (NULL); - } - } -} Deleted: trunk/listener.h =================================================================== --- trunk/listener.h 2006-02-22 14:31:39 UTC (rev 9) +++ trunk/listener.h 2006-02-22 14:38:21 UTC (rev 10) @@ -1,16 +0,0 @@ -/* - * $Id$ - */ - -#ifndef LISTENER_H_INCLUDED -#define LISTENER_H_INCLUDED - -#include "connection.h" - -typedef struct listener listener_t; - -listener_t *listener_create(int port); -void listener_destroy(listener_t *l); -connection_t *listener_accept(listener_t *l); - -#endif Deleted: trunk/log.c =================================================================== --- trunk/log.c 2006-02-22 14:31:39 UTC (rev 9) +++ trunk/log.c 2006-02-22 14:38:21 UTC (rev 10) @@ -1,116 +0,0 @@ -/* - * $Id$ - */ - -#include -#include -#include - -#include -#include -#include -#include -#include -#ifdef TIME_WITH_SYS_TIME -#include -#endif -#include - -#include "varnish.h" -#include "log.h" -#include "system.h" - -static void -timestamp(void) -{ - struct timeval now; - - if (gettimeofday(&now, NULL) == -1) - now.tv_sec = now.tv_usec = 0; - fprintf(stderr, "%lu.%06lu [%lu] ", - (unsigned long)now.tv_sec, - (unsigned long)now.tv_usec, - (unsigned long)sys.pid); -} - -static void -emit(const char *fmt, va_list ap) -{ - timestamp(); - vfprintf(stderr, fmt, ap); - fprintf(stderr, "\n"); -} - -static void -sysemit(const char *fmt, va_list ap) -{ - char errstr[64]; - -#if defined(HAVE_STRERROR_R) - strerror_r(errno, errstr, sizeof errstr); -#else - snprintf(errstr, sizeof errstr, "%s", strerror(errno)); -#endif - timestamp(); - vfprintf(stderr, fmt, ap); - fprintf(stderr, ": %s\n", errstr); -} - -static void -panic(void) -{ - signal(SIGABRT, SIG_DFL); - kill(getpid(), SIGABRT); -} - -void -log_info(const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - emit(fmt, ap); - va_end(ap); -} - -void -log_err(const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - emit(fmt, ap); - va_end(ap); -} - -void -log_syserr(const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - sysemit(fmt, ap); - va_end(ap); -} - -void -log_panic(const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - emit(fmt, ap); - va_end(ap); - panic(); -} - -void -log_syspanic(const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - sysemit(fmt, ap); - va_end(ap); - panic(); -} Deleted: trunk/log.h =================================================================== --- trunk/log.h 2006-02-22 14:31:39 UTC (rev 9) +++ trunk/log.h 2006-02-22 14:38:21 UTC (rev 10) @@ -1,19 +0,0 @@ -/* - * $Id$ - */ - -#ifndef LOG_H_INCLUDED -#define LOG_H_INCLUDED - - -void log_info(const char *fmt, ...); -void log_err(const char *fmt, ...); -void log_syserr(const char *fmt, ...); -void log_panic(const char *fmt, ...); -void log_syspanic(const char *fmt, ...); - -#define LOG_UNREACHABLE() \ - log_panic("%s(%d): %s(): unreachable code reached", \ - __FILE__, __LINE__, __func__) - -#endif Deleted: trunk/request.c =================================================================== --- trunk/request.c 2006-02-22 14:31:39 UTC (rev 9) +++ trunk/request.c 2006-02-22 14:38:21 UTC (rev 10) @@ -1,37 +0,0 @@ -/* - * $Id$ - */ - -#include - -#include "varnish.h" -#include "connection.h" -#include "log.h" -#include "request.h" - -struct request { - connection_t *conn; -}; - -request_t * -request_wait(connection_t *c, unsigned int timeout) -{ - request_t *r; - - r = calloc(1, sizeof *r); - if (r == NULL) { - log_syserr("calloc()"); - return (NULL); - } - - /* ... */ - - return (r); -} - -void -request_destroy(request_t *r) -{ - /* bzero(r, sizeof *r); */ - free(r); -} Deleted: trunk/request.h =================================================================== --- trunk/request.h 2006-02-22 14:31:39 UTC (rev 9) +++ trunk/request.h 2006-02-22 14:38:21 UTC (rev 10) @@ -1,13 +0,0 @@ -/* - * $Id$ - */ - -#ifndef REQUEST_H_INCLUDED -#define REQUEST_H_INCLUDED - -typedef struct request request_t; - -request_t *request_wait(connection_t *c, unsigned int timeout); -void request_destroy(request_t *r); - -#endif Deleted: trunk/system-common.c =================================================================== --- trunk/system-common.c 2006-02-22 14:31:39 UTC (rev 9) +++ trunk/system-common.c 2006-02-22 14:38:21 UTC (rev 10) @@ -1,35 +0,0 @@ -/* - * $Id$ - */ - -#include - -#include - -#include "varnish.h" -#include "system.h" - -system_t sys; - -/* - * gather system information at startup - */ -void -system_init(void) -{ - sys.pid = getpid(); - system_init_ncpu(); -} - -/* - * fork() wrapper, updates sys.pid - */ -pid_t -system_fork(void) -{ - pid_t pid; - - if ((pid = fork()) == 0) - sys.pid = getpid(); - return (pid); -} Deleted: trunk/system-freebsd.c =================================================================== --- trunk/system-freebsd.c 2006-02-22 14:31:39 UTC (rev 9) +++ trunk/system-freebsd.c 2006-02-22 14:38:21 UTC (rev 10) @@ -1,21 +0,0 @@ -/* - * $Id$ - */ - -#include -#include - -#include "varnish.h" -#include "log.h" -#include "system.h" - -void -system_init_ncpu(void) -{ - size_t size; - - size = sizeof sys.ncpu; - if (sysctlbyname("hw.ncpu", &sys.ncpu, &size, 0, 0) == -1) - sys.ncpu = 1; - log_info("%d cpu(s)", sys.ncpu); -} Deleted: trunk/system-freebsd5.0.c =================================================================== --- trunk/system-freebsd5.0.c 2006-02-22 14:31:39 UTC (rev 9) +++ trunk/system-freebsd5.0.c 2006-02-22 14:38:21 UTC (rev 10) @@ -1 +0,0 @@ -link system-freebsd.c \ No newline at end of file Deleted: trunk/system-freebsd6.0.c =================================================================== --- trunk/system-freebsd6.0.c 2006-02-22 14:31:39 UTC (rev 9) +++ trunk/system-freebsd6.0.c 2006-02-22 14:38:21 UTC (rev 10) @@ -1 +0,0 @@ -link system-freebsd.c \ No newline at end of file Deleted: trunk/system-freebsd7.0.c =================================================================== --- trunk/system-freebsd7.0.c 2006-02-22 14:31:39 UTC (rev 9) +++ trunk/system-freebsd7.0.c 2006-02-22 14:38:21 UTC (rev 10) @@ -1 +0,0 @@ -link system-freebsd.c \ No newline at end of file Deleted: trunk/system-linux-gnu.c =================================================================== --- trunk/system-linux-gnu.c 2006-02-22 14:31:39 UTC (rev 9) +++ trunk/system-linux-gnu.c 2006-02-22 14:38:21 UTC (rev 10) @@ -1,31 +0,0 @@ -/* - * $Id$ - */ - -#include - -#include - -#include "varnish.h" -#include "log.h" -#include "system.h" - -void -system_init_ncpu(void) -{ - FILE *cpuinfo; - char line[256]; - int n; - - sys.ncpu = 0; - if ((cpuinfo = fopen("/proc/cpuinfo", "r")) == NULL) - return; - while (fgets(line, sizeof line, cpuinfo) != NULL) { - if (sscanf(line, "processor : %d", &n) == 1) - sys.ncpu++; - } - fclose(cpuinfo); - if (sys.ncpu == 0) - sys.ncpu = 1; - log_info("%d cpu(s)", sys.ncpu); -} Deleted: trunk/system.h =================================================================== --- trunk/system.h 2006-02-22 14:31:39 UTC (rev 9) +++ trunk/system.h 2006-02-22 14:38:21 UTC (rev 10) @@ -1,21 +0,0 @@ -/* - * $Id$ - */ - -#ifndef SYSTEM_H_INCLUDED -#define SYSTEM_H_INCLUDED - -typedef struct system system_t; - -struct system { - int ncpu; - pid_t pid; -}; - -extern system_t sys; - -void system_init_ncpu(void); -void system_init(void); -pid_t system_fork(void); - -#endif Property changes on: trunk/varnish-proto ___________________________________________________________________ Name: svn:ignore + .deps Makefile Makefile.in aclocal.m4 autom4te.cache compile config.guess config.h config.h.in config.log config.status config.sub configure depcomp install-sh missing stamp-h1 varnish Copied: trunk/varnish-proto/LICENSE (from rev 8, trunk/LICENSE) Copied: trunk/varnish-proto/Makefile.am (from rev 6, trunk/Makefile.am) Copied: trunk/varnish-proto/autogen.sh (from rev 3, trunk/autogen.sh) Copied: trunk/varnish-proto/configure.ac (from rev 6, trunk/configure.ac) Copied: trunk/varnish-proto/connection.c (from rev 6, trunk/connection.c) Copied: trunk/varnish-proto/connection.h (from rev 6, trunk/connection.h) Copied: trunk/varnish-proto/listener.c (from rev 6, trunk/listener.c) Copied: trunk/varnish-proto/listener.h (from rev 6, trunk/listener.h) Copied: trunk/varnish-proto/log.c (from rev 6, trunk/log.c) Copied: trunk/varnish-proto/log.h (from rev 6, trunk/log.h) Copied: trunk/varnish-proto/request.c (from rev 6, trunk/request.c) Copied: trunk/varnish-proto/request.h (from rev 6, trunk/request.h) Copied: trunk/varnish-proto/system-common.c (from rev 6, trunk/system-common.c) Copied: trunk/varnish-proto/system-freebsd.c (from rev 7, trunk/system-freebsd.c) Copied: trunk/varnish-proto/system-freebsd5.0.c (from rev 7, trunk/system-freebsd5.0.c) Copied: trunk/varnish-proto/system-freebsd6.0.c (from rev 7, trunk/system-freebsd6.0.c) Copied: trunk/varnish-proto/system-freebsd7.0.c (from rev 7, trunk/system-freebsd7.0.c) Copied: trunk/varnish-proto/system-linux-gnu.c (from rev 6, trunk/system-linux-gnu.c) Copied: trunk/varnish-proto/system.h (from rev 6, trunk/system.h) Copied: trunk/varnish-proto/varnish.c (from rev 6, trunk/varnish.c) Copied: trunk/varnish-proto/varnish.h (from rev 6, trunk/varnish.h) Deleted: trunk/varnish.c =================================================================== --- trunk/varnish.c 2006-02-22 14:31:39 UTC (rev 9) +++ trunk/varnish.c 2006-02-22 14:38:21 UTC (rev 10) @@ -1,95 +0,0 @@ -/* - * $Id$ - */ - -#include - -#include -#include -#include -#include - -#include "varnish.h" -#include "connection.h" -#include "listener.h" -#include "log.h" -#include "request.h" -#include "system.h" - -static void -varnish_child(listener_t *l) -{ - connection_t *c; - request_t *r; - - while ((c = listener_accept(l)) != NULL) { - r = request_wait(c, 0); - /* ... */ - request_destroy(r); - connection_destroy(c); - } - LOG_UNREACHABLE(); -} - -static void -varnish(void) -{ - listener_t *l; - int i, status; - pid_t pid; - - system_init(); - log_info("starting Varnish"); - l = listener_create(8080); - for (i = 0; i < sys.ncpu; ++i) { - switch ((pid = system_fork())) { - case -1: - log_panic("fork()"); - break; - case 0: - varnish_child(l); - _exit(1); - break; - default: - log_info("forked child %lu", (unsigned long)pid); - break; - } - } - for (;;) { - if ((pid = wait(&status)) == -1) { - if (errno == ECHILD) - return; - } else { - log_info("child %lu exited", (unsigned long)pid); - } - } -} - -static void -usage(void) -{ - fprintf(stderr, "usage: varnish\n"); - exit(1); -} - -int -main(int argc, char *argv[]) -{ - int o; - - while ((o = getopt(argc, argv, "")) != -1) - switch (o) { - default: - usage(); - } - - argc -= optind; - argv += optind; - - if (argc != 0) - usage(); - - varnish(); - - exit(1); -} Deleted: trunk/varnish.h =================================================================== --- trunk/varnish.h 2006-02-22 14:31:39 UTC (rev 9) +++ trunk/varnish.h 2006-02-22 14:38:21 UTC (rev 10) @@ -1,10 +0,0 @@ -/* - * $Id$ - */ - -#ifndef VARNISH_H_INCLUDED -#define VARNISH_H_INCLUDED - -#include "config.h" - -#endif From des at projects.linpro.no Wed Feb 22 16:18:07 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Wed, 22 Feb 2006 17:18:07 +0100 (CET) Subject: r11 - in trunk/varnish-doc: . share Message-ID: <20060222161807.3A10F1ED518@projects.linpro.no> Author: des Date: 2006-02-22 17:18:07 +0100 (Wed, 22 Feb 2006) New Revision: 11 Added: trunk/varnish-doc/share/ trunk/varnish-doc/share/bibliography.xml Log: Bibliography collection. Added: trunk/varnish-doc/share/bibliography.xml =================================================================== --- trunk/varnish-doc/share/bibliography.xml 2006-02-22 14:38:21 UTC (rev 10) +++ trunk/varnish-doc/share/bibliography.xml 2006-02-22 16:18:07 UTC (rev 11) @@ -0,0 +1,152 @@ + + + + + + RFC2119 + + <ulink url="http://www.faqs.org/rfcs/rfc2119.html">Key words for + use in RFCs to Indicate Requirement Levels</ulink> + + + + Bradner + Scott + + Harvard University + + + + March 1997 + + IETF RFC + 2119 + + + Internet Engineering Task Force + + + + + RFC2186 + + <ulink url="http://www.faqs.org/rfcs/rfc2186.html">Internet + Cache Protocol (ICP), version 2</ulink> + + + + Wessels + Duane + + National Laboratory for Applied Network Research + + + + Claffy + Kim + + National Laboratory for Applied Network Research + + + + September 1997 + + IETF RFC + 2186 + + + Internet Engineering Task Force + + + + + RFC2616 + + <ulink url="http://www.faqs.org/rfcs/rfc2616.html">Hypertext + Transfer Protocol—HTTP/1.1</ulink> + + + + Fielding + T. + Roy + + University of California Irvine + + + + Gettys + James + + World Wide Web Consortium + + + + Mogul + C. + Jeffrey + + Western Research Laboratory + Compaq Computer Corporation + + + + Nielsen + Frystyk + Henrik + + World Wide Web Consortium + + + + Masinter + Larry + + Xerox Corporation + + + + June 1999 + + IETF RFC + 2616 + + + Internet Engineering Task Force + + + + + RFC2756 + + <ulink url="http://www.faqs.org/rfcs/rfc2756.html">Hyper Text + Caching Protocol (HTCP/0.0)</ulink> + + + + Vixie + Paul + + Internet Software Consortium + + + + Wessels + Duane + + National Laboratory for Applied Network Research + + + + January 2000 + + IETF RFC + 2756 + + + Internet Engineering Task Force + + + From des at projects.linpro.no Wed Feb 22 16:18:23 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Wed, 22 Feb 2006 17:18:23 +0100 (CET) Subject: r12 - in trunk/varnish-doc: . en en/varnish-specification Message-ID: <20060222161823.747231ED51E@projects.linpro.no> Author: des Date: 2006-02-22 17:18:23 +0100 (Wed, 22 Feb 2006) New Revision: 12 Added: trunk/varnish-doc/en/ trunk/varnish-doc/en/varnish-specification/ trunk/varnish-doc/en/varnish-specification/article.xml Log: Draft specification in DocBook format. Added: trunk/varnish-doc/en/varnish-specification/article.xml =================================================================== --- trunk/varnish-doc/en/varnish-specification/article.xml 2006-02-22 16:18:07 UTC (rev 11) +++ trunk/varnish-doc/en/varnish-specification/article.xml 2006-02-22 16:18:23 UTC (rev 12) @@ -0,0 +1,636 @@ + + +
+ + $Id$ + Varnish HTTP Accelerator Draft Specification + + +
+ Introduction + +
+ Overview + + Varnish is a high-performance HTTP accelerator. + + XXX +
+ +
+ Terminology + + The key words ?MUST?, ?MUST NOT?, ?REQUIRED?, ?SHALL?, + ?SHALL NOT?, ?SHOULD?, ?SHOULD NOT?, ?RECOMMENDED?, ?MAY?, and + ?OPTIONAL? in this document are to be interpreted as described + in IETF RFC 2119. + + XXX at this time, the above is incorrect because we + started out using MoSCoW prioritisation before realising it was + inadequate for the task. +
+ +
+ To do + + Use consistent terminology throughout the document (see + previous section) + + Clarify the following terms: configuration facility; + logging and statistics facility (split in two?); monitoring and + tuning facility (split in two? does this overlap with + configuration facility?) +
+
+ +
+ General requirements + +
+ License + + XXX two-clause BSD license +
+ +
+ Version control + + All source code and documentation must be kept under + version control in a publicly accessible repository. +
+ +
+ Software platform + + Varnish must be fully functional on the platforms listed + in this section. + + Varnish should also be fully functional on other + POSIX-derived platforms, insofar as this does not require + unreasonable effort. + +
+ FreeBSD + + Varnish must be fully functional on FreeBSD 6.0 or later + officially supported releases, including security and errata + branches. + + The reference platform for FreeBSD compatibility is + FreeBSD 6.1-RELEASE. +
+ +
+ GNU/Linux + + Varnish must be fully functional on GNU/Linux systems + with Linux 2.6.12 or later and GNU libc 2.3.2 or later. + + The reference platform for GNU/Linux compatibility is + Ubuntu 5.10 ?Breezy Badger?. +
+
+ +
+ Hardware platform + + Varnish must be fully functional on both 32-bit and 64-bit + Intel-compatible hardware, but may place different limits on + operating parameters (such as cache size) depending on the + platform and the amount of physical and / or virtual memory + available. Varnish must support and take advantage of multiple + CPUs or CPU cores if present. + + The reference hardware platform is a dual-CPU AMD Opteron + system with 4?GB of RAM divided evenly between the CPUs. +
+ +
+ Language + + Varnish must be implemented in C with as few compiler- and + platform-specific extensions as possible. +
+ +
+ Compiler and toolchain + + Varnish must be compilable with the GNU C compiler (GCC) + 3.3.5 or later and toolchain (binutils) 2.15 or later. + + Alternative compilers and toolchains should be supported + insofar as this does not require unreasonable effort. +
+ +
+ Compile-time configuration + + Varnish must use the GNU Autotools for compile-time + configuration. The Makefile templates must be written to work + with any POSIX-compliant make(1) utility. +
+ +
+ Third-party dependencies + + Varnish must not depend on any third-party packages other + than the compiler, toolchain and configuration tools. +
+ +
+ Incidental tools + + Varnish may be accompanied by incidental tools for + purposes such as creating or editing configuration files, + warming up the cache, manipulating or generating source code, + etc. Insofar as these tools are not required at compilation or + installation time nor for the daily operation of Varnish, they + may be written in Perl 5.8 or later, and depend on third-party + Perl modules available from CPAN. +
+ +
+ Coding standards + + All C source code must conform to the FreeBSD style(9) + coding standard. +
+ +
+ Documentation + + Varnish must be accompanied by complete internal and + external documentation. + + All documentation must be in English. + + All documentation must be made available online in HTML + form, and may be made available online in additional formats + such as PDF. + +
+ Internal documentation + + The internal documentation consists of: + + + Code comments. + + + Manual pages describing Varnish internals. + + + Version control history. + + + Requirements and specification in DocBook XML + format. + + + System architecture in DocBook XML format. + + + Developer guidelines and other incidental + documentation either in the project Wiki or in DocBook XML + format. + + +
+ +
+ External documentation + + The external documentation consists of: + + + Manual pages for all daemons and command-line + tools. + + + Installation instructions in DocBook XML + format. + + + Administrator's handbook in DocBook XML + format. + + + Sample configuration files. + + +
+
+
+ +
+ Functional requirements + +
+ Functional description + + Varnish accepts HTTP requests from clients and satisfy + them with documents retrieved from its cache (disk- and / or + memory-based). Documents which are not present in the cache + must be retrieved from a set of preconfigured content servers. + Requests for documents from other servers than the preconfigured + content servers are ignored. +
+ +
+ Protocol support + +
+ HTTP + + Varnish must be able to accept HTTP/1.0 and HTTP/1.1 + requests from both IPv4 and IPv6 clients. + + Varnish must, in general terms, handle these requests in + conformance with IETF RFC 2616. + + Varnish may handle HTTP/0.9 requests in any way it sees + fit, including but not limited to returning a 400 Bad Request + response or simply closing the connection. + + Varnish must use HTTP/1.1 in its communications with the + content servers. + + Varnish may deviate from IETF RFC 2616 when this is + necessary for interoperability with non-conforming clients or + content servers. + + Varnish may deviate from IETF RFC 2616 in cases where + doing so provides a considerable performance advantage without + causing significant harm to interoperability. Any such + deviation must be documented. + + In its communications with clients, Varnish must + interpret IETF RFC 2616 as if it were an origin server. In + its communications with content servers, Varnish must + interpret IETF RFC 2616 as if it were a cache. +
+ +
+ ICP + + Varnish may support ICP for inter-cache coordination. + ICP support may be a compile-time option. +
+ +
+ HTCP + + Varnish may support HTCP for inter-cache coordination. + HTCP support may be a compile-time option. +
+
+ +
+ Content manipulation + + Varnish won't implement content manipulation at this + time. + + Varnish should be designed in such a manner as to make it + possible to implement various kinds of content manipulation + (such as ESI) at a future date. + + XXX ICAP may be worth looking into (but is probably a + performance killer) +
+ +
+ Caching + + Varnish must maintain a local cache of the documets + present on the content server. + +
+ Cached set + + If the amount of memory and / or disk available to + Varnish is not sufficient to cache the entire document set, + Varnish must attempt to identify a subset to cache which + minimizes load on the content servers. + + Varnish should offer multiple alternative cache control + algorithms. At the very least, the LRU (least-recently-used) + and WLRU (LRU weighted by document size) algorithms should be + implemented. +
+ +
+ Expiry + + If a cached document has an expiry time associated with + it, and that time has not yet been reached, Varnish may serve + the document from cache without contacting the content + server. +
+ +
+ Non-cacheable content + + XXX +
+
+ +
+ Management + +
+ Configuration + + XXX +
+ +
+ Logging and statistics + + A separate application is responsible for collecting, + collating and analyzing log data which Varnish makes available + in circular shared memory buffers. + + Varnish must provide the data necessary to compute + lifetime totals and sliding averages for the following: + + + Total size of documents served to clients + + + Total size of data transmitted to clients, including + headers, error messages, etc. + + + Total size of data received from clients, including + request headers etc. + + + Number of client connections received + + + Number of client requests served + + + Client requests broken down by result code + + + Total size of documents retrieved from content + servers + + + Total size of data received from content servers, + including headers, error messages, etc. + + + Total size of data sent to content servers, + including request headers etc. + + + Number of content server connections + initiated + + + Number of content server requests sent + + + Content server requests broken down by result + code + + + Cache effectiveness as the ratio of bytes served to + clients to bytes requested from content servers + + + Cache effectiveness as the ratio of client requests + to content server requests + + + Number of active server processes / threads, broken + down by process / thread type + + + XXX length of request queues + + + + In addition, Varnish must provide the data necessary to + compute the average, median and distribution for the + following: + + + Size of documents served, per unique document + + + Size of documents served, per request + + + Client connection duration + + + Requests per client connection + + + Client request completion time + + + Content server connection duration + + + Requests per content server connection + + + Content server request completion time + + + XXX time spent in request queues + + +
+
+ +
+ Run-time monitoring and tuning + + Varnish must provide low-level monitoring and tuning + facilities. A separate application is responsible for providing + a user-friendly interface to these facilities. + + The following monitoring operations must be + supported: + + + + Cache status of individual documents + + + Cache status of documents matching a glob or regular + expression + + + Access statistics of individual documents + + + Access statistics of documents matching a glob or + regular expression + + + XXX + + + + The following tuning operations must be supported: + + + + Forced invalidation of individual documents + + + Forced invalidation of documents matching a glob or regular expression + + + XXX + + +
+
+ Clustering + + Clustering is defined in this context as a situation where + multiple servers are set up to run Varnish with the same + configuration, serving data from the same content servers to the + same set of clients. + +
+ Configuration + + When multiple Varnish servers act together as a cluster, + the configuration facility is responsible for ensuring that + all nodes share the same configuration and that configuration + changes are applied to all nodes in a timely fashion. +
+ +
+ Logging and statistics + + When multiple Varnish servers act together as a cluster, + the logging and statistics facilities must base its reports on + aggregated data as if the cluster were a single Varnish + server. + + Per-node data may optionally be made available in + addition to aggregated data. +
+ +
+ Run-time monitoring and tuning + + When multiple Varnish servers act together as a cluster, + the run-time monitoring and tuning facilities must propagate + invalidation requests and other administrative commands to all + servers in the cluster. +
+
+
+ +
+ Application structure + +
+ Components + + This section lists the major components in Varnish. + +
+ Listener + + The Listener monitors the listening socket and accepts + incoming client connections. Once the connection is + established, it is passed to the Accepter. + + The Listener should take advantage of accept filters or + similar technologies on systems where they are + available. +
+ +
+ Accepter + + The Accepter reads an HTTP request from a client + connection. It parses the request line and header only to the + extent necessary to establish well-formedness and determine + the requested URL. + + The Accepter then queries the Keeper about the status of + the requested document (identified by its full URL). If the + document is present and valid in the cache, the request is + passed directly to a Sender. Otherwise, it is passed to a + Retriever queue. +
+ +
+ Keeper + + The Keeper manages the document cache. XXX +
+ +
+ Sender + + The Sender transfers the contents of the requested + document to the client. It examines the HTTP request header + to determine the correct way in which to do this ? Range, + If-Modified-Since, Content-Encoding and other options may + affect the type and amount of data transferred. + + There may be multiple concurrent Sender threads. +
+ +
+ Retriever + + The Retriever is responsible for retrieving documents + from the content servers. It is triggered either by an + Accepter trying to satisfy a request for a document which is + not in the cache, or by the Janitor when a ?hot? document is + nearing expiry. Either way, there may be a queue of requests + waiting for the document to arrive; when it does, the + Retriever passes those requests to a Sender. + + There may be multiple concurrent Retriever + threads. +
+ +
+ Janitor + + The Janitor keeps track of the expiry time of cached + documents and attempts to retrieve fresh copies of documents + which are soon to expire. +
+ +
+ Logger + + The Logger keeps logs of various types of events in + circular shared-memory buffers. These buffers must be managed + using either POSIX shared memory primitives or file-backed + mmap(2). + + It is the responsibility of each module to feed relevant + log data to the Logger. +
+
+
+ + + References + + + + + + +
Property changes on: trunk/varnish-doc/en/varnish-specification/article.xml ___________________________________________________________________ Name: svn:mime-type + text/xml Name: svn:charset + utf-8 From des at projects.linpro.no Wed Feb 22 16:47:50 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Wed, 22 Feb 2006 17:47:50 +0100 (CET) Subject: r13 - in trunk/varnish-doc: en/varnish-specification share Message-ID: <20060222164750.8D6001ED51C@projects.linpro.no> Author: des Date: 2006-02-22 17:47:50 +0100 (Wed, 22 Feb 2006) New Revision: 13 Added: trunk/varnish-doc/share/docbook-xml.css Modified: trunk/varnish-doc/en/varnish-specification/article.xml Log: Simple CSS stylesheet for displaying raw DocBook XML documents, without first processing them with XSLT. Modified: trunk/varnish-doc/en/varnish-specification/article.xml =================================================================== --- trunk/varnish-doc/en/varnish-specification/article.xml 2006-02-22 16:18:23 UTC (rev 12) +++ trunk/varnish-doc/en/varnish-specification/article.xml 2006-02-22 16:47:50 UTC (rev 13) @@ -1,4 +1,5 @@ + Added: trunk/varnish-doc/share/docbook-xml.css =================================================================== --- trunk/varnish-doc/share/docbook-xml.css 2006-02-22 16:18:23 UTC (rev 12) +++ trunk/varnish-doc/share/docbook-xml.css 2006-02-22 16:47:50 UTC (rev 13) @@ -0,0 +1,98 @@ +/* $Id$ */ + +article, book { + background-color: white; + color: black; + font-family: sans-serif; + margin: 1in; +} + +/* + * Titles + */ +title { + display: block; + color: maroon; +} + +article title, article articleinfo title { + font-weight: bold; + font-size: 200%; +} + +book title, book bookinfo title { + text-align: center; + font-weight: bold; + font-size: 200; +} + +/* level 1 */ +section { + counter-increment: sect1; + counter-reset: sect2; +} + +section title:before { + content: counter(sect1) " "; +} + +section title { + font-weight: bold; + font-size: 150%; +} + +/* level 2 */ +section section { + counter-increment: sect2; + counter-reset: sect3; +} + +section section title:before { + content: counter(sect1) "." counter(sect2) " "; +} + +section section title { + font-weight: bold; + font-size: 130%; +} + +/* level 3 */ +section section section { + counter-increment: sect3; + counter-reset: sect4; +} + +section section section title:before { + content: counter(sect1) "." counter(sect2) "." counter(sect3) " "; +} + +section section section title { + font-weight: bold; + font-size: 130%; +} + +/* + * Sections and paragraphs + */ +section { + display: block; + margin-top: 1em; +} + +para { + display: block; + margin-top: 1ex; +} + +/* + * Lists + */ +orderedlist { + display: block; +} + +orderedlist listitem { + display: list-item; + list-style-type: disc inside; + margin-left: 4em; +} From des at projects.linpro.no Wed Feb 22 16:49:36 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Wed, 22 Feb 2006 17:49:36 +0100 (CET) Subject: r14 - in trunk/varnish-doc: . en/varnish-specification share Message-ID: <20060222164936.D59221ED51F@projects.linpro.no> Author: des Date: 2006-02-22 17:49:36 +0100 (Wed, 22 Feb 2006) New Revision: 14 Added: trunk/varnish-doc/configure.ac Modified: trunk/varnish-doc/en/varnish-specification/article.xml trunk/varnish-doc/share/docbook-xml.css Log: Enable the Id keyword. Added: trunk/varnish-doc/configure.ac =================================================================== --- trunk/varnish-doc/configure.ac 2006-02-22 16:47:50 UTC (rev 13) +++ trunk/varnish-doc/configure.ac 2006-02-22 16:49:36 UTC (rev 14) @@ -0,0 +1,31 @@ +# $Id$ + +AC_PREREQ(2.59) +AC_COPYRIGHT([Copyright (c) 2006 Linpro AS]) +AC_REVISION([$Id$]) +AC_INIT([Varnish-Documentation], [0.1], [varnish-dev at projects.linpro.no]) +AC_CONFIG_SRCDIR([share/bibliography.xml]) + +AC_CANONICAL_SYSTEM + +AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) + +# Checks for programs. +AC_CHECK_PROGS(XMLLINT, xmllint, + AC_MSG_ERROR([Can't proceed without xmllint])) +AC_CHECK_PROGS(XSLTPROC, xsltproc, + AC_MSG_ERROR([Can't proceed without xsltproc])) +AC_PROG_INSTALL +AC_PROG_MAKE_SET + +AC_ARG_WITH(docbook-xsl, + AS_HELP_STRING([--with-docbook-xsl=path],[use -Wall (default is NO)]), + AC_SUBST(DOCBOOK_XSL, "$withval"), + AC_MSG_ERROR([Can't proceed without DocBook stylesheets])) + +AC_CONFIG_FILES([ + Makefile + en/Makefile + en/varnish-specification/Makefile +]) +AC_OUTPUT Property changes on: trunk/varnish-doc/configure.ac ___________________________________________________________________ Name: svn:keywords + Id Property changes on: trunk/varnish-doc/en/varnish-specification/article.xml ___________________________________________________________________ Name: svn:keywords + Id Property changes on: trunk/varnish-doc/share/docbook-xml.css ___________________________________________________________________ Name: svn:keywords + Id From des at projects.linpro.no Wed Feb 22 16:49:53 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Wed, 22 Feb 2006 17:49:53 +0100 (CET) Subject: r15 - trunk/varnish-doc Message-ID: <20060222164953.8FD471ED520@projects.linpro.no> Author: des Date: 2006-02-22 17:49:53 +0100 (Wed, 22 Feb 2006) New Revision: 15 Added: trunk/varnish-doc/autogen.sh Log: Autotools bootstrap script. Added: trunk/varnish-doc/autogen.sh =================================================================== --- trunk/varnish-doc/autogen.sh 2006-02-22 16:49:36 UTC (rev 14) +++ trunk/varnish-doc/autogen.sh 2006-02-22 16:49:53 UTC (rev 15) @@ -0,0 +1,8 @@ +#!/bin/sh +# +# $Id$ +# + +aclocal +automake --add-missing --copy --force --foreign +autoconf Property changes on: trunk/varnish-doc/autogen.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + Id From des at projects.linpro.no Wed Feb 22 18:44:02 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Wed, 22 Feb 2006 19:44:02 +0100 (CET) Subject: r16 - trunk/varnish-doc/share Message-ID: <20060222184402.061351ED520@projects.linpro.no> Author: des Date: 2006-02-22 19:44:01 +0100 (Wed, 22 Feb 2006) New Revision: 16 Modified: trunk/varnish-doc/share/docbook-xml.css Log: Set correct mime-type. Property changes on: trunk/varnish-doc/share/docbook-xml.css ___________________________________________________________________ Name: svn:mime-type + text/css From des at projects.linpro.no Wed Feb 22 19:10:52 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Wed, 22 Feb 2006 20:10:52 +0100 (CET) Subject: r17 - trunk/varnish-doc/en/varnish-specification Message-ID: <20060222191052.0DB771ED514@projects.linpro.no> Author: des Date: 2006-02-22 20:10:51 +0100 (Wed, 22 Feb 2006) New Revision: 17 Modified: trunk/varnish-doc/en/varnish-specification/article.xml Log: Turn top-level sections into chapters Modified: trunk/varnish-doc/en/varnish-specification/article.xml =================================================================== --- trunk/varnish-doc/en/varnish-specification/article.xml 2006-02-22 18:44:01 UTC (rev 16) +++ trunk/varnish-doc/en/varnish-specification/article.xml 2006-02-22 19:10:51 UTC (rev 17) @@ -9,7 +9,7 @@ Varnish HTTP Accelerator Draft Specification -
+ Introduction
@@ -44,9 +44,9 @@ tuning facility (split in two? does this overlap with configuration facility?)
-
+ -
+ General requirements
@@ -223,9 +223,9 @@
- + -
+ Functional requirements
@@ -534,9 +534,9 @@ servers in the cluster.
- + -
+ Application structure
@@ -624,7 +624,7 @@ log data to the Logger.
- + References From des at projects.linpro.no Wed Feb 22 19:11:05 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Wed, 22 Feb 2006 20:11:05 +0100 (CET) Subject: r18 - trunk/varnish-doc/share Message-ID: <20060222191105.A146C1ED523@projects.linpro.no> Author: des Date: 2006-02-22 20:11:05 +0100 (Wed, 22 Feb 2006) New Revision: 18 Modified: trunk/varnish-doc/share/docbook-xml.css Log: Improve rendering of section titles Modified: trunk/varnish-doc/share/docbook-xml.css =================================================================== --- trunk/varnish-doc/share/docbook-xml.css 2006-02-22 19:10:51 UTC (rev 17) +++ trunk/varnish-doc/share/docbook-xml.css 2006-02-22 19:11:05 UTC (rev 18) @@ -15,15 +15,34 @@ color: maroon; } -article title, article articleinfo title { +article title, +book title { font-weight: bold; font-size: 200%; } -book title, book bookinfo title { - text-align: center; +/* level 0 */ +chapter, +appendix, +bibliography +{ + counter-increment: sect0; + counter-reset: sect1; +} + +chapter > title:before, +appendix > title:before, +bibliography > title:before +{ + content: counter(sect0) " "; +} + +chapter > title, +appendix > title, +bibliography > title +{ font-weight: bold; - font-size: 200; + font-size: xx-large; } /* level 1 */ @@ -32,48 +51,53 @@ counter-reset: sect2; } -section title:before { - content: counter(sect1) " "; +section > title:before { + content: counter(sect0) "." counter(sect1) " "; } -section title { +section > title { font-weight: bold; - font-size: 150%; + font-size: x-large; } /* level 2 */ -section section { +section > section { counter-increment: sect2; counter-reset: sect3; } -section section title:before { - content: counter(sect1) "." counter(sect2) " "; +section > section > title:before { + content: counter(sect0) "." counter(sect1) "." counter(sect2) " "; } -section section title { +section > section > title { font-weight: bold; - font-size: 130%; + font-size: large; } /* level 3 */ -section section section { +section > section > section { counter-increment: sect3; counter-reset: sect4; } -section section section title:before { - content: counter(sect1) "." counter(sect2) "." counter(sect3) " "; +section > section > section > title:before { + content: counter(sect0) "." counter(sect1) "." counter(sect2) "." counter(sect3) " "; } -section section section title { +section > section > section > title { font-weight: bold; - font-size: 130%; + font-size: 100%; } /* * Sections and paragraphs */ +chapter, appendix, bibliography { + display: block; + margin-top: 3em; +} + section { display: block; margin-top: 1em; From des at projects.linpro.no Thu Feb 23 11:36:27 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Thu, 23 Feb 2006 12:36:27 +0100 (CET) Subject: r19 - trunk/varnish-doc/en/varnish-specification Message-ID: <20060223113627.B033E1ED4B5@projects.linpro.no> Author: des Date: 2006-02-23 12:36:27 +0100 (Thu, 23 Feb 2006) New Revision: 19 Modified: trunk/varnish-doc/en/varnish-specification/article.xml Log: Thursday morning's work. Modified: trunk/varnish-doc/en/varnish-specification/article.xml =================================================================== --- trunk/varnish-doc/en/varnish-specification/article.xml 2006-02-22 19:11:05 UTC (rev 18) +++ trunk/varnish-doc/en/varnish-specification/article.xml 2006-02-23 11:36:27 UTC (rev 19) @@ -9,7 +9,7 @@ Varnish HTTP Accelerator Draft Specification - +
Introduction
@@ -44,9 +44,9 @@ tuning facility (split in two? does this overlap with configuration facility?)
- +
- +
General requirements
@@ -223,9 +223,9 @@
-
+ - +
Functional requirements
@@ -342,12 +342,77 @@ Management
+ Management interface + + Varnish must provide an interface for external + management utilities. This interface must accept connections + on a Unix socket and / or a TCP socket, depending on + configuration. + + Varnish may assume that the management interface is + adequately protected by socket permissions or firewall rules, + as applicable, and that any data it receives through this + interface is valid management data from an authorized + administrator. + + Varnish may further assume that all data received + through the management interface is well-formed and + meaningful. +
+ +
+ Management library + + Varnish must be accompanied by a C library, hereafter + referred to as the management library, which provides a + reasonably high-level API to the management interface + + Varnish should be accompanied by a Perl library which + provides Perl bindings to the management library. + + Varnish may be accompanied by libraries which provide + appropriate bindings to the management library for other + programming or scripting languages. +
+ +
+ CLI management tool + + Varnish must be accompanied by a CLI management tool, + written in C, which serves as a front-end to the management + library. + + The CLI management tool must allow management commands + to be passed on the command line. + + In addition, the CLI management tool should offer an + interactive mode using libreadline, libedit or a similar + line-editing library. +
+ +
+ Web-based management tool + + Varnish should be accompanied by a web-based management + tool. This tool should have the ability to generate graphs + and histograms based on the data described in . +
+ +
+ Plugins for third-party tools + + Varnish may be accompanied by plugins for third-party + management tools such as Munin, Nagios and NAV. +
+ +
Configuration XXX
-
+
Logging and statistics A separate application is responsible for collecting, @@ -356,6 +421,7 @@ Varnish must provide the data necessary to compute lifetime totals and sliding averages for the following: + Total size of documents served to clients @@ -420,6 +486,7 @@ In addition, Varnish must provide the data necessary to compute the average, median and distribution for the following: + Size of documents served, per unique document @@ -505,6 +572,20 @@ same set of clients.
+ Management + + Varnish must be accompanied by a multiplexer for the + management interface which provide a single point of access to + the entire cluster for management tools such as the CLI + management tool or a web-based management interface. + + The management protocol must be designed to allow + management commands to be targeted at individual nodes. The + default behaviour must be to propagate management commands to + all nodes in the cluster. +
+ +
Configuration When multiple Varnish servers act together as a cluster, @@ -534,9 +615,9 @@ servers in the cluster.
- +
- +
Application structure
@@ -624,14 +705,14 @@ log data to the Logger.
-
+
References - - - - + + + + From des at projects.linpro.no Thu Feb 23 14:21:15 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Thu, 23 Feb 2006 15:21:15 +0100 (CET) Subject: r20 - trunk/varnish-doc/share Message-ID: <20060223142115.6E6B21ED51A@projects.linpro.no> Author: des Date: 2006-02-23 15:21:15 +0100 (Thu, 23 Feb 2006) New Revision: 20 Modified: trunk/varnish-doc/share/bibliography.xml Log: Add RFC 3507 (ICAP). Modified: trunk/varnish-doc/share/bibliography.xml =================================================================== --- trunk/varnish-doc/share/bibliography.xml 2006-02-23 11:36:27 UTC (rev 19) +++ trunk/varnish-doc/share/bibliography.xml 2006-02-23 14:21:15 UTC (rev 20) @@ -149,4 +149,36 @@ Internet Engineering Task Force + + + RFC3507 + + <ulink url="http://www.faqs.org/rfcs/rfc3507.html">Internet + Content Adaptation Protocol (ICAP)</ulink> + + + + Elson + Jeremy + + University of California Los Angeles + + + + Cerpa + Alberto + + University of California Los Angeles + + + + April 2003 + + IETF RFC + 3507 + + + Internet Engineering Task Force + + From des at projects.linpro.no Thu Feb 23 14:29:05 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Thu, 23 Feb 2006 15:29:05 +0100 (CET) Subject: r21 - trunk/varnish-doc/share Message-ID: <20060223142905.A00981ED51C@projects.linpro.no> Author: des Date: 2006-02-23 15:29:05 +0100 (Thu, 23 Feb 2006) New Revision: 21 Modified: trunk/varnish-doc/share/docbook-xml.css Log: Correct handling of section titles: articles can't have chapters, so we need to treat articles and books differently. Display ordered and itemized lists correctly. Show links as blue underlined text (unfortunately, CSS is not sufficiently powerful to make them clickable, unless we start embedding ECMAScript in it). Modified: trunk/varnish-doc/share/docbook-xml.css =================================================================== --- trunk/varnish-doc/share/docbook-xml.css 2006-02-23 14:21:15 UTC (rev 20) +++ trunk/varnish-doc/share/docbook-xml.css 2006-02-23 14:29:05 UTC (rev 21) @@ -15,81 +15,108 @@ color: maroon; } -article title, -book title { +article > title, +article > articleinfo > title, +book > title, +book > bookinfo > title +{ font-weight: bold; font-size: 200%; } /* level 0 */ -chapter, -appendix, -bibliography +article > section, +article > appendix, +article > bibliography, +book > chapter, +book > appendix, +book > bibliography { counter-increment: sect0; counter-reset: sect1; } -chapter > title:before, -appendix > title:before, -bibliography > title:before +article > section > title:before, +article > appendix > title:before, +article > bibliography > title:before, +book > chapter > title:before, +book > appendix > title:before, +book > bibliography > title:before { - content: counter(sect0) " "; + content: counter(sect0) ". "; } -chapter > title, -appendix > title, -bibliography > title +article > section > title, +article > appendix > title, +article > bibliography > title, +book > chapter > title, +book > appendix > title, +book > bibliography > title { font-weight: bold; font-size: xx-large; } /* level 1 */ -section { +article > section > section, +article > appendix > section, +article > bibliography > bibliodiv, +book > chapter > section, +book > appendix > section, +book > bibliography > bibliodiv +{ counter-increment: sect1; counter-reset: sect2; } -section > title:before { - content: counter(sect0) "." counter(sect1) " "; +article > section > section > title:before, +article > appendix > section > title:before, +article > bibliography > bibliodiv > title:before, +book > chapter > section > title:before, +book > appendix > section > title:before, +book > bibliography > bibliodiv > title:before +{ + content: counter(sect0) "." counter(sect1) ". "; } -section > title { +article > section > section > title, +article > appendix > section > title, +article > bibliography > bibliodiv > title, +book > chapter > section > title, +book > appendix > section > title, +book > bibliography > bibliodiv > title +{ font-weight: bold; font-size: x-large; } /* level 2 */ -section > section { +article > section > section > section, +article > appendix > section > section, +book > chapter > section > section, +book > appendix > section > section +{ counter-increment: sect2; counter-reset: sect3; } -section > section > title:before { - content: counter(sect0) "." counter(sect1) "." counter(sect2) " "; +article > section > section > section > title:before, +article > appendix > section > section > title:before, +book > chapter > section > section > title:before, +book > appendix > section > section > title:before +{ + content: counter(sect0) "." counter(sect1) "." counter(sect2) ". "; } -section > section > title { +article > section > section > section > title, +article > appendix > section > section > title, +book > chapter > section > section > title, +book > appendix > section > section > title +{ font-weight: bold; font-size: large; } -/* level 3 */ -section > section > section { - counter-increment: sect3; - counter-reset: sect4; -} - -section > section > section > title:before { - content: counter(sect0) "." counter(sect1) "." counter(sect2) "." counter(sect3) " "; -} - -section > section > section > title { - font-weight: bold; - font-size: 100%; -} - /* * Sections and paragraphs */ @@ -111,12 +138,34 @@ /* * Lists */ -orderedlist { +orderedlist, itemizedlist { display: block; } -orderedlist listitem { +orderedlist > listitem { display: list-item; + list-style-type: roman inside; + margin-left: 4em; +} + +itemizedlist > listitem { + display: list-item; list-style-type: disc inside; margin-left: 4em; } + +/* + * Links + */ +xref:before { + content: "["; +} + +xref { + color: blue; + font-decoration: underline; +} + +xref:after { + content: "]"; +} From des at projects.linpro.no Thu Feb 23 14:32:11 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Thu, 23 Feb 2006 15:32:11 +0100 (CET) Subject: r22 - trunk/varnish-doc/en/varnish-specification Message-ID: <20060223143211.DFEF01ED51F@projects.linpro.no> Author: des Date: 2006-02-23 15:32:11 +0100 (Thu, 23 Feb 2006) New Revision: 22 Modified: trunk/varnish-doc/en/varnish-specification/article.xml Log: Discuss expiry and cacheability. Modified: trunk/varnish-doc/en/varnish-specification/article.xml =================================================================== --- trunk/varnish-doc/en/varnish-specification/article.xml 2006-02-23 14:29:05 UTC (rev 21) +++ trunk/varnish-doc/en/varnish-specification/article.xml 2006-02-23 14:32:11 UTC (rev 22) @@ -26,7 +26,7 @@ The key words ?MUST?, ?MUST NOT?, ?REQUIRED?, ?SHALL?, ?SHALL NOT?, ?SHOULD?, ?SHOULD NOT?, ?RECOMMENDED?, ?MAY?, and ?OPTIONAL? in this document are to be interpreted as described - in IETF RFC 2119. + in . XXX at this time, the above is incorrect because we started out using MoSCoW prioritisation before realising it was @@ -175,7 +175,7 @@ Internal documentation The internal documentation consists of: - + Code comments. @@ -197,14 +197,14 @@ documentation either in the project Wiki or in DocBook XML format. - +
External documentation The external documentation consists of: - + Manual pages for all daemons and command-line tools. @@ -220,7 +220,7 @@ Sample configuration files. - +
@@ -249,7 +249,7 @@ requests from both IPv4 and IPv6 clients. Varnish must, in general terms, handle these requests in - conformance with IETF RFC 2616. + conformance with . Varnish may handle HTTP/0.9 requests in any way it sees fit, including but not limited to returning a 400 Bad Request @@ -258,19 +258,21 @@ Varnish must use HTTP/1.1 in its communications with the content servers. - Varnish may deviate from IETF RFC 2616 when this is - necessary for interoperability with non-conforming clients or - content servers. + Varnish may deviate from when + this is necessary for interoperability with non-conforming + clients or content servers. - Varnish may deviate from IETF RFC 2616 in cases where - doing so provides a considerable performance advantage without - causing significant harm to interoperability. Any such - deviation must be documented. + Varnish may deviate from in + cases where doing so provides a considerable performance + advantage without causing significant harm to + interoperability. Any such deviation must be + documented. In its communications with clients, Varnish must - interpret IETF RFC 2616 as if it were an origin server. In - its communications with content servers, Varnish must - interpret IETF RFC 2616 as if it were a cache. + interpret as if it were an origin + server. In its communications with content servers, Varnish + must interpret as if it were a + cache.
@@ -323,18 +325,81 @@
- Expiry + Cacheability - If a cached document has an expiry time associated with - it, and that time has not yet been reached, Varnish may serve - the document from cache without contacting the content - server. + A request which includes authentication headers must not + be served from cache. + + Varnish must interpret Cache-Control directives received + from content servers as follows: + + + + public: the document will be cached even if + authentication headers are present. + + + private: the document will not be cached, since + Varnish is a shared cache. + + + no-cache: the document will not be cached. + + + no-store: XXX + + + s-maxage: overrides max-age, since Varnish is a + shared cache. + + + max-age: overrides the Expires header. + + + min-fresh: ignored. + + + max-stale: ignored. + + + only-if-cached: ignored. + + + must-revalidate: as specified in ?14.9.4. + + + proxy-revalidate: as must-revalidate. + + + no-transform: ignored. + + + + Varnish must ignore Cache-Control directives received + from clients.
- Non-cacheable content + Expiry - XXX + If a content server returns a document with a s-maxage + directive, Varnish will set the expiry time for that document + to the time of the request plus the number of seconds + specified by the directive. + + If a content server returns a document with no s-maxage + directive but a max-age directive, Varnish will set the expiry + time for that document to the time of the request plus the + number of seconds specified by the max-age directive. + + If a content server returns a document with no s-maxage + or max-age directive but an Expires header, Varnish must set + the expiry time for that document to the value specified by + the Expires header. + + When sending a document to a client, Varnish must set + the Expires header to the document's expiry time.
@@ -422,7 +487,7 @@ Varnish must provide the data necessary to compute lifetime totals and sliding averages for the following: - + Total size of documents served to clients @@ -481,13 +546,13 @@ XXX length of request queues - + In addition, Varnish must provide the data necessary to compute the average, median and distribution for the following: - + Size of documents served, per unique document @@ -501,7 +566,9 @@ Requests per client connection - Client request completion time + Client request completion time, broken down by + request type (HEAD / GET), cache status (HIT / MISS) and + outcome (200, 404...) Content server connection duration @@ -510,12 +577,14 @@ Requests per content server connection - Content server request completion time + Content server request completion time, broken down + by request type (HEAD / GET) and outcome (200, + 404...) XXX time spent in request queues - + @@ -529,7 +598,7 @@ The following monitoring operations must be supported: - + Cache status of individual documents @@ -547,11 +616,11 @@ XXX - + The following tuning operations must be supported: - + Forced invalidation of individual documents @@ -561,7 +630,7 @@ XXX - +
Clustering @@ -714,5 +783,6 @@ + From des at projects.linpro.no Thu Feb 23 15:57:43 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Thu, 23 Feb 2006 16:57:43 +0100 (CET) Subject: r23 - trunk/varnish-doc/en/varnish-specification Message-ID: <20060223155743.3DB8E1ED525@projects.linpro.no> Author: des Date: 2006-02-23 16:57:43 +0100 (Thu, 23 Feb 2006) New Revision: 23 Modified: trunk/varnish-doc/en/varnish-specification/article.xml Log: Add a short section on refreshing. Done for today. Modified: trunk/varnish-doc/en/varnish-specification/article.xml =================================================================== --- trunk/varnish-doc/en/varnish-specification/article.xml 2006-02-23 14:32:11 UTC (rev 22) +++ trunk/varnish-doc/en/varnish-specification/article.xml 2006-02-23 15:57:43 UTC (rev 23) @@ -401,6 +401,16 @@ When sending a document to a client, Varnish must set the Expires header to the document's expiry time.
+ +
+ Refreshing + + Varnish must attempt to refresh documents before they + expire, in order to avoid stalling a client request while + retrieving an expired document. + + XXX +
From des at projects.linpro.no Fri Feb 24 14:35:56 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Fri, 24 Feb 2006 15:35:56 +0100 (CET) Subject: r24 - in trunk/varnish-cache: . bin bin/varnishd include lib lib/libvarnish lib/libvarnishapi Message-ID: <20060224143556.09D131ED51F@projects.linpro.no> Author: des Date: 2006-02-24 15:35:55 +0100 (Fri, 24 Feb 2006) New Revision: 24 Added: trunk/varnish-cache/Makefile.am trunk/varnish-cache/autogen.sh trunk/varnish-cache/bin/ trunk/varnish-cache/bin/Makefile.am trunk/varnish-cache/bin/varnishd/ trunk/varnish-cache/bin/varnishd/Makefile.am trunk/varnish-cache/bin/varnishd/varnishd.c trunk/varnish-cache/configure.ac trunk/varnish-cache/include/ trunk/varnish-cache/include/Makefile.am trunk/varnish-cache/include/varnishapi.h trunk/varnish-cache/lib/ trunk/varnish-cache/lib/Makefile.am trunk/varnish-cache/lib/libvarnish/ trunk/varnish-cache/lib/libvarnish/Makefile.am trunk/varnish-cache/lib/libvarnishapi/ trunk/varnish-cache/lib/libvarnishapi/Makefile.am Log: Source tree structure as agreed. Added: trunk/varnish-cache/Makefile.am =================================================================== --- trunk/varnish-cache/Makefile.am 2006-02-23 15:57:43 UTC (rev 23) +++ trunk/varnish-cache/Makefile.am 2006-02-24 14:35:55 UTC (rev 24) @@ -0,0 +1,3 @@ +# $Id$ + +SUBDIRS = include lib bin Property changes on: trunk/varnish-cache/Makefile.am ___________________________________________________________________ Name: svn:keywords + Id Added: trunk/varnish-cache/autogen.sh =================================================================== --- trunk/varnish-cache/autogen.sh 2006-02-23 15:57:43 UTC (rev 23) +++ trunk/varnish-cache/autogen.sh 2006-02-24 14:35:55 UTC (rev 24) @@ -0,0 +1,10 @@ +#!/bin/sh +# +# $Id$ +# + +libtoolize --copy --force +aclocal +autoheader +automake --add-missing --copy --force --foreign +autoconf Property changes on: trunk/varnish-cache/autogen.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + Id Added: trunk/varnish-cache/bin/Makefile.am =================================================================== --- trunk/varnish-cache/bin/Makefile.am 2006-02-23 15:57:43 UTC (rev 23) +++ trunk/varnish-cache/bin/Makefile.am 2006-02-24 14:35:55 UTC (rev 24) @@ -0,0 +1,3 @@ +# $Id$ + +SUBDIRS = varnishd Property changes on: trunk/varnish-cache/bin/Makefile.am ___________________________________________________________________ Name: svn:keywords + Id Added: trunk/varnish-cache/bin/varnishd/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishd/Makefile.am 2006-02-23 15:57:43 UTC (rev 23) +++ trunk/varnish-cache/bin/varnishd/Makefile.am 2006-02-24 14:35:55 UTC (rev 24) @@ -0,0 +1,10 @@ +# $Id$ + +INCLUDES = -I$(top_srcdir)/include + +bin_PROGRAMS = varnishd + +varnishd_SOURCES = \ + varnishd.c + +#varnishd_LDADD = $(top_builddir)/lib/libvarnish/libvarnish.la Property changes on: trunk/varnish-cache/bin/varnishd/Makefile.am ___________________________________________________________________ Name: svn:keywords + Id Added: trunk/varnish-cache/bin/varnishd/varnishd.c =================================================================== --- trunk/varnish-cache/bin/varnishd/varnishd.c 2006-02-23 15:57:43 UTC (rev 23) +++ trunk/varnish-cache/bin/varnishd/varnishd.c 2006-02-24 14:35:55 UTC (rev 24) @@ -0,0 +1,35 @@ +/* + * $Id$ + */ + +#include +#include +#include +#include + +static void +usage(void) +{ + fprintf(stderr, "usage: varnishd\n"); + exit(1); +} + +int +main(int argc, char *argv[]) +{ + int o; + + while ((o = getopt(argc, argv, "")) != -1) + switch (o) { + default: + usage(); + } + + argc -= optind; + argv += optind; + + if (argc != 0) + usage(); + + exit(0); +} Property changes on: trunk/varnish-cache/bin/varnishd/varnishd.c ___________________________________________________________________ Name: svn:keywords + Id Added: trunk/varnish-cache/configure.ac =================================================================== --- trunk/varnish-cache/configure.ac 2006-02-23 15:57:43 UTC (rev 23) +++ trunk/varnish-cache/configure.ac 2006-02-24 14:35:55 UTC (rev 24) @@ -0,0 +1,73 @@ +# $Id$ + +AC_PREREQ(2.59) +AC_COPYRIGHT([Copyright (c) 2006 Linpro AS / Verdens Gang AS]) +AC_REVISION([$Id$]) +AC_INIT([Varnish], [0.1], [varnish-dev at projects.linpro.no]) +AC_CONFIG_SRCDIR([include/varnishapi.h]) +AC_CONFIG_HEADER([config.h]) + +AC_CANONICAL_SYSTEM +AC_LANG(C) + +AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) + +# Compiler flags (assume GCC). +# This section *must* come before AC_PROG_CC / AC_PROG_CPP. +CFLAGS="${CFLAGS:--O2}" +AC_ARG_ENABLE(wall, + AS_HELP_STRING([--enable-wall],[use -Wall (default is NO)]), + CFLAGS="${CFLAGS} -Wall") +AC_ARG_ENABLE(pedantic, + AS_HELP_STRING([--enable-pedantic],[enable pedantic warnings (default is NO)]), + CFLAGS="${CFLAGS} -pedantic") +AC_ARG_ENABLE(werror, + AS_HELP_STRING([--enable-werror],[use -Werror (default is NO)]), + CFLAGS="${CFLAGS} -Werror") + +# Checks for programs. +AC_PROG_CC +AC_PROG_CPP +AC_PROG_INSTALL +AC_PROG_LIBTOOL +AC_PROG_MAKE_SET + +# Checks for libraries. + +# Checks for header files. +AC_HEADER_STDC +AC_HEADER_SYS_WAIT +AC_HEADER_TIME +AC_CHECK_HEADERS([sys/socket.h]) +AC_CHECK_HEADERS([netinet/in.h]) +AC_CHECK_HEADERS([stddef.h]) +AC_CHECK_HEADERS([stdlib.h]) +AC_CHECK_HEADERS([unistd.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_CHECK_MEMBERS([struct sockaddr.sa_len],,,[ +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +]) + +# Checks for library functions. +AC_TYPE_SIGNAL +AC_TYPE_SIZE_T +AC_FUNC_VPRINTF +AC_CHECK_FUNCS([strerror]) +AC_FUNC_STRERROR_R +AC_CHECK_FUNCS([socket]) + +AC_CONFIG_FILES([ + Makefile + include/Makefile + lib/Makefile + lib/libvarnish/Makefile + lib/libvarnishapi/Makefile + bin/Makefile + bin/varnishd/Makefile +]) +AC_OUTPUT Property changes on: trunk/varnish-cache/configure.ac ___________________________________________________________________ Name: svn:keywords + Id Added: trunk/varnish-cache/include/Makefile.am =================================================================== --- trunk/varnish-cache/include/Makefile.am 2006-02-23 15:57:43 UTC (rev 23) +++ trunk/varnish-cache/include/Makefile.am 2006-02-24 14:35:55 UTC (rev 24) @@ -0,0 +1,4 @@ +# $Id$ + +include_HEADERS = varnishapi.h + Property changes on: trunk/varnish-cache/include/Makefile.am ___________________________________________________________________ Name: svn:keywords + Id Added: trunk/varnish-cache/include/varnishapi.h =================================================================== --- trunk/varnish-cache/include/varnishapi.h 2006-02-23 15:57:43 UTC (rev 23) +++ trunk/varnish-cache/include/varnishapi.h 2006-02-24 14:35:55 UTC (rev 24) @@ -0,0 +1,10 @@ +/* + * $Id$ + */ + +#ifndef VARNISHAPI_H_INCLUDED +#define VARNISHAPI_H_INCLUDED + +/* ... */ + +#endif Property changes on: trunk/varnish-cache/include/varnishapi.h ___________________________________________________________________ Name: svn:keywords + Id Added: trunk/varnish-cache/lib/Makefile.am =================================================================== --- trunk/varnish-cache/lib/Makefile.am 2006-02-23 15:57:43 UTC (rev 23) +++ trunk/varnish-cache/lib/Makefile.am 2006-02-24 14:35:55 UTC (rev 24) @@ -0,0 +1,5 @@ +# $Id$ + +SUBDIRS = \ + libvarnish \ + libvarnishapi Property changes on: trunk/varnish-cache/lib/Makefile.am ___________________________________________________________________ Name: svn:keywords + Id Added: trunk/varnish-cache/lib/libvarnish/Makefile.am =================================================================== --- trunk/varnish-cache/lib/libvarnish/Makefile.am 2006-02-23 15:57:43 UTC (rev 23) +++ trunk/varnish-cache/lib/libvarnish/Makefile.am 2006-02-24 14:35:55 UTC (rev 24) @@ -0,0 +1,7 @@ +# $Id$ + +INCLUDES = -I$(top_srcdir)/include + +lib_LIBRARIES = libvarnish.la + +libvarnish_la_SOURCES = Property changes on: trunk/varnish-cache/lib/libvarnish/Makefile.am ___________________________________________________________________ Name: svn:keywords + Id Added: trunk/varnish-cache/lib/libvarnishapi/Makefile.am =================================================================== --- trunk/varnish-cache/lib/libvarnishapi/Makefile.am 2006-02-23 15:57:43 UTC (rev 23) +++ trunk/varnish-cache/lib/libvarnishapi/Makefile.am 2006-02-24 14:35:55 UTC (rev 24) @@ -0,0 +1,7 @@ +# $Id$ + +INCLUDES = -I$(top_srcdir)/include + +lib_LIBRARIES = libvarnishapi.la + +libvarnishapi_la_SOURCES = Property changes on: trunk/varnish-cache/lib/libvarnishapi/Makefile.am ___________________________________________________________________ Name: svn:keywords + Id From des at projects.linpro.no Fri Feb 24 14:58:42 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Fri, 24 Feb 2006 15:58:42 +0100 (CET) Subject: r25 - trunk/varnish-doc/share Message-ID: <20060224145842.E25B01ED529@projects.linpro.no> Author: des Date: 2006-02-24 15:58:42 +0100 (Fri, 24 Feb 2006) New Revision: 25 Modified: trunk/varnish-doc/share/docbook-xml.css Log: Fix a couple of syntax errors. Modified: trunk/varnish-doc/share/docbook-xml.css =================================================================== --- trunk/varnish-doc/share/docbook-xml.css 2006-02-24 14:35:55 UTC (rev 24) +++ trunk/varnish-doc/share/docbook-xml.css 2006-02-24 14:58:42 UTC (rev 25) @@ -144,13 +144,13 @@ orderedlist > listitem { display: list-item; - list-style-type: roman inside; + list-style: decimal inside; margin-left: 4em; } itemizedlist > listitem { display: list-item; - list-style-type: disc inside; + list-style: disc inside; margin-left: 4em; } @@ -163,7 +163,7 @@ xref { color: blue; - font-decoration: underline; + text-decoration: underline; } xref:after { From des at projects.linpro.no Fri Feb 24 15:01:14 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Fri, 24 Feb 2006 16:01:14 +0100 (CET) Subject: r26 - trunk/varnish-doc/share Message-ID: <20060224150114.7547C1ED52C@projects.linpro.no> Author: des Date: 2006-02-24 16:01:14 +0100 (Fri, 24 Feb 2006) New Revision: 26 Added: trunk/varnish-doc/share/docbook-html.css trunk/varnish-doc/share/docbook-html.xsl Log: Lightweight XSL stylesheet for transforming DocBook XML to XHTML, with accompanying CSS stylesheet. Added: trunk/varnish-doc/share/docbook-html.css =================================================================== --- trunk/varnish-doc/share/docbook-html.css 2006-02-24 14:58:42 UTC (rev 25) +++ trunk/varnish-doc/share/docbook-html.css 2006-02-24 15:01:14 UTC (rev 26) @@ -0,0 +1,45 @@ +/* $Id$ */ + +body { + margin: 1in; + background-color: white; + color: black; +} + +h1.book-title { + font-size: 200%; + font-weight: bold; +} + +h1.article-title { + font-size: 200%; + font-weight: bold; +} + +span.title1 { + color: maroon; + font-weight: bold; + font-size: xx-large; +} + +span.title2 { + color: maroon; + font-weight: bold; + font-size: x-large; +} + +span.title3 { + color: maroon; + font-weight: bold; + font-size: large; +} + +span.title4 { + color: maroon; + font-weight: bold; +} + +span.title5 { + color: maroon; + font-weight: bold; +} Property changes on: trunk/varnish-doc/share/docbook-html.css ___________________________________________________________________ Name: svn:mime-type + text/css Name: svn:charset + utf-8 Added: trunk/varnish-doc/share/docbook-html.xsl =================================================================== --- trunk/varnish-doc/share/docbook-html.xsl 2006-02-24 14:58:42 UTC (rev 25) +++ trunk/varnish-doc/share/docbook-html.xsl 2006-02-24 15:01:14 UTC (rev 26) @@ -0,0 +1,156 @@ + + + + + + + + + + + <xsl:call-template name="book-title"/> + + + + +

+ +

+ + + +
+ + + + + + <xsl:call-template name="article-title"/> + + + + +

+ +

+ + + +
+ + + +
+ + + +
+
+ + + +
+ + + +
+
+ + + +
+ + + +
+
+ + + +
+ + + +
+
+ + + + + + + + + + + Unnamed DocBook Article + + + + + + + + + + + + + + Unnamed DocBook Book + + + + + + + + + + + + + + + +
    + +
+
+ + +
    + +
+
+ + +
  • + +
  • +
    + + +

    + +

    +
    + + + + + + + +
    Property changes on: trunk/varnish-doc/share/docbook-html.xsl ___________________________________________________________________ Name: svn:mime-type + text/xsl Name: svn:charset + utf-8 From des at projects.linpro.no Fri Feb 24 15:01:25 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Fri, 24 Feb 2006 16:01:25 +0100 (CET) Subject: r27 - trunk/varnish-doc/share Message-ID: <20060224150125.76EEE1ED52A@projects.linpro.no> Author: des Date: 2006-02-24 16:01:25 +0100 (Fri, 24 Feb 2006) New Revision: 27 Modified: trunk/varnish-doc/share/bibliography.xml Log: Set mime-type and charset. Property changes on: trunk/varnish-doc/share/bibliography.xml ___________________________________________________________________ Name: svn:mime-type + text/xml Name: svn:charset + utf-8 From des at projects.linpro.no Fri Feb 24 15:03:59 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Fri, 24 Feb 2006 16:03:59 +0100 (CET) Subject: r28 - trunk/varnish-doc/share Message-ID: <20060224150359.357071ED52D@projects.linpro.no> Author: des Date: 2006-02-24 16:03:59 +0100 (Fri, 24 Feb 2006) New Revision: 28 Modified: trunk/varnish-doc/share/docbook-html.css Log: Prefer sans-serif fonts. Modified: trunk/varnish-doc/share/docbook-html.css =================================================================== --- trunk/varnish-doc/share/docbook-html.css 2006-02-24 15:01:25 UTC (rev 27) +++ trunk/varnish-doc/share/docbook-html.css 2006-02-24 15:03:59 UTC (rev 28) @@ -4,6 +4,7 @@ margin: 1in; background-color: white; color: black; + font-family: sans-serif; } h1.book-title { From des at projects.linpro.no Mon Feb 27 07:27:28 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Mon, 27 Feb 2006 08:27:28 +0100 (CET) Subject: r29 - in trunk/varnish-doc/en: . varnish-architecture Message-ID: <20060227072728.EF6211ED530@projects.linpro.no> Author: des Date: 2006-02-27 08:27:28 +0100 (Mon, 27 Feb 2006) New Revision: 29 Added: trunk/varnish-doc/en/varnish-architecture/ trunk/varnish-doc/en/varnish-architecture/article.xml Log: Fork varnish-architecture off of varnish-specification. Copied: trunk/varnish-doc/en/varnish-architecture/article.xml (from rev 23, trunk/varnish-doc/en/varnish-specification/article.xml) From des at projects.linpro.no Mon Feb 27 07:28:50 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Mon, 27 Feb 2006 08:28:50 +0100 (CET) Subject: r30 - in trunk/varnish-doc/en: varnish-architecture varnish-specification Message-ID: <20060227072850.627EF1ED532@projects.linpro.no> Author: des Date: 2006-02-27 08:28:50 +0100 (Mon, 27 Feb 2006) New Revision: 30 Modified: trunk/varnish-doc/en/varnish-architecture/article.xml trunk/varnish-doc/en/varnish-specification/article.xml Log: Separate specification from architecture. Modified: trunk/varnish-doc/en/varnish-architecture/article.xml =================================================================== --- trunk/varnish-doc/en/varnish-architecture/article.xml 2006-02-27 07:27:28 UTC (rev 29) +++ trunk/varnish-doc/en/varnish-architecture/article.xml 2006-02-27 07:28:50 UTC (rev 30) @@ -6,697 +6,10 @@
    $Id$ - Varnish HTTP Accelerator Draft Specification + Varnish HTTP Accelerator Architecture
    - Introduction - -
    - Overview - - Varnish is a high-performance HTTP accelerator. - - XXX -
    - -
    - Terminology - - The key words ?MUST?, ?MUST NOT?, ?REQUIRED?, ?SHALL?, - ?SHALL NOT?, ?SHOULD?, ?SHOULD NOT?, ?RECOMMENDED?, ?MAY?, and - ?OPTIONAL? in this document are to be interpreted as described - in . - - XXX at this time, the above is incorrect because we - started out using MoSCoW prioritisation before realising it was - inadequate for the task. -
    - -
    - To do - - Use consistent terminology throughout the document (see - previous section) - - Clarify the following terms: configuration facility; - logging and statistics facility (split in two?); monitoring and - tuning facility (split in two? does this overlap with - configuration facility?) -
    -
    - -
    - General requirements - -
    - License - - XXX two-clause BSD license -
    - -
    - Version control - - All source code and documentation must be kept under - version control in a publicly accessible repository. -
    - -
    - Software platform - - Varnish must be fully functional on the platforms listed - in this section. - - Varnish should also be fully functional on other - POSIX-derived platforms, insofar as this does not require - unreasonable effort. - -
    - FreeBSD - - Varnish must be fully functional on FreeBSD 6.0 or later - officially supported releases, including security and errata - branches. - - The reference platform for FreeBSD compatibility is - FreeBSD 6.1-RELEASE. -
    - -
    - GNU/Linux - - Varnish must be fully functional on GNU/Linux systems - with Linux 2.6.12 or later and GNU libc 2.3.2 or later. - - The reference platform for GNU/Linux compatibility is - Ubuntu 5.10 ?Breezy Badger?. -
    -
    - -
    - Hardware platform - - Varnish must be fully functional on both 32-bit and 64-bit - Intel-compatible hardware, but may place different limits on - operating parameters (such as cache size) depending on the - platform and the amount of physical and / or virtual memory - available. Varnish must support and take advantage of multiple - CPUs or CPU cores if present. - - The reference hardware platform is a dual-CPU AMD Opteron - system with 4?GB of RAM divided evenly between the CPUs. -
    - -
    - Language - - Varnish must be implemented in C with as few compiler- and - platform-specific extensions as possible. -
    - -
    - Compiler and toolchain - - Varnish must be compilable with the GNU C compiler (GCC) - 3.3.5 or later and toolchain (binutils) 2.15 or later. - - Alternative compilers and toolchains should be supported - insofar as this does not require unreasonable effort. -
    - -
    - Compile-time configuration - - Varnish must use the GNU Autotools for compile-time - configuration. The Makefile templates must be written to work - with any POSIX-compliant make(1) utility. -
    - -
    - Third-party dependencies - - Varnish must not depend on any third-party packages other - than the compiler, toolchain and configuration tools. -
    - -
    - Incidental tools - - Varnish may be accompanied by incidental tools for - purposes such as creating or editing configuration files, - warming up the cache, manipulating or generating source code, - etc. Insofar as these tools are not required at compilation or - installation time nor for the daily operation of Varnish, they - may be written in Perl 5.8 or later, and depend on third-party - Perl modules available from CPAN. -
    - -
    - Coding standards - - All C source code must conform to the FreeBSD style(9) - coding standard. -
    - -
    - Documentation - - Varnish must be accompanied by complete internal and - external documentation. - - All documentation must be in English. - - All documentation must be made available online in HTML - form, and may be made available online in additional formats - such as PDF. - -
    - Internal documentation - - The internal documentation consists of: - - - Code comments. - - - Manual pages describing Varnish internals. - - - Version control history. - - - Requirements and specification in DocBook XML - format. - - - System architecture in DocBook XML format. - - - Developer guidelines and other incidental - documentation either in the project Wiki or in DocBook XML - format. - - -
    - -
    - External documentation - - The external documentation consists of: - - - Manual pages for all daemons and command-line - tools. - - - Installation instructions in DocBook XML - format. - - - Administrator's handbook in DocBook XML - format. - - - Sample configuration files. - - -
    -
    -
    - -
    - Functional requirements - -
    - Functional description - - Varnish accepts HTTP requests from clients and satisfy - them with documents retrieved from its cache (disk- and / or - memory-based). Documents which are not present in the cache - must be retrieved from a set of preconfigured content servers. - Requests for documents from other servers than the preconfigured - content servers are ignored. -
    - -
    - Protocol support - -
    - HTTP - - Varnish must be able to accept HTTP/1.0 and HTTP/1.1 - requests from both IPv4 and IPv6 clients. - - Varnish must, in general terms, handle these requests in - conformance with . - - Varnish may handle HTTP/0.9 requests in any way it sees - fit, including but not limited to returning a 400 Bad Request - response or simply closing the connection. - - Varnish must use HTTP/1.1 in its communications with the - content servers. - - Varnish may deviate from when - this is necessary for interoperability with non-conforming - clients or content servers. - - Varnish may deviate from in - cases where doing so provides a considerable performance - advantage without causing significant harm to - interoperability. Any such deviation must be - documented. - - In its communications with clients, Varnish must - interpret as if it were an origin - server. In its communications with content servers, Varnish - must interpret as if it were a - cache. -
    - -
    - ICP - - Varnish may support ICP for inter-cache coordination. - ICP support may be a compile-time option. -
    - -
    - HTCP - - Varnish may support HTCP for inter-cache coordination. - HTCP support may be a compile-time option. -
    -
    - -
    - Content manipulation - - Varnish won't implement content manipulation at this - time. - - Varnish should be designed in such a manner as to make it - possible to implement various kinds of content manipulation - (such as ESI) at a future date. - - XXX ICAP may be worth looking into (but is probably a - performance killer) -
    - -
    - Caching - - Varnish must maintain a local cache of the documets - present on the content server. - -
    - Cached set - - If the amount of memory and / or disk available to - Varnish is not sufficient to cache the entire document set, - Varnish must attempt to identify a subset to cache which - minimizes load on the content servers. - - Varnish should offer multiple alternative cache control - algorithms. At the very least, the LRU (least-recently-used) - and WLRU (LRU weighted by document size) algorithms should be - implemented. -
    - -
    - Cacheability - - A request which includes authentication headers must not - be served from cache. - - Varnish must interpret Cache-Control directives received - from content servers as follows: - - - - public: the document will be cached even if - authentication headers are present. - - - private: the document will not be cached, since - Varnish is a shared cache. - - - no-cache: the document will not be cached. - - - no-store: XXX - - - s-maxage: overrides max-age, since Varnish is a - shared cache. - - - max-age: overrides the Expires header. - - - min-fresh: ignored. - - - max-stale: ignored. - - - only-if-cached: ignored. - - - must-revalidate: as specified in ?14.9.4. - - - proxy-revalidate: as must-revalidate. - - - no-transform: ignored. - - - - Varnish must ignore Cache-Control directives received - from clients. -
    - -
    - Expiry - - If a content server returns a document with a s-maxage - directive, Varnish will set the expiry time for that document - to the time of the request plus the number of seconds - specified by the directive. - - If a content server returns a document with no s-maxage - directive but a max-age directive, Varnish will set the expiry - time for that document to the time of the request plus the - number of seconds specified by the max-age directive. - - If a content server returns a document with no s-maxage - or max-age directive but an Expires header, Varnish must set - the expiry time for that document to the value specified by - the Expires header. - - When sending a document to a client, Varnish must set - the Expires header to the document's expiry time. -
    - -
    - Refreshing - - Varnish must attempt to refresh documents before they - expire, in order to avoid stalling a client request while - retrieving an expired document. - - XXX -
    -
    - -
    - Management - -
    - Management interface - - Varnish must provide an interface for external - management utilities. This interface must accept connections - on a Unix socket and / or a TCP socket, depending on - configuration. - - Varnish may assume that the management interface is - adequately protected by socket permissions or firewall rules, - as applicable, and that any data it receives through this - interface is valid management data from an authorized - administrator. - - Varnish may further assume that all data received - through the management interface is well-formed and - meaningful. -
    - -
    - Management library - - Varnish must be accompanied by a C library, hereafter - referred to as the management library, which provides a - reasonably high-level API to the management interface - - Varnish should be accompanied by a Perl library which - provides Perl bindings to the management library. - - Varnish may be accompanied by libraries which provide - appropriate bindings to the management library for other - programming or scripting languages. -
    - -
    - CLI management tool - - Varnish must be accompanied by a CLI management tool, - written in C, which serves as a front-end to the management - library. - - The CLI management tool must allow management commands - to be passed on the command line. - - In addition, the CLI management tool should offer an - interactive mode using libreadline, libedit or a similar - line-editing library. -
    - -
    - Web-based management tool - - Varnish should be accompanied by a web-based management - tool. This tool should have the ability to generate graphs - and histograms based on the data described in . -
    - -
    - Plugins for third-party tools - - Varnish may be accompanied by plugins for third-party - management tools such as Munin, Nagios and NAV. -
    - -
    - Configuration - - XXX -
    - -
    - Logging and statistics - - A separate application is responsible for collecting, - collating and analyzing log data which Varnish makes available - in circular shared memory buffers. - - Varnish must provide the data necessary to compute - lifetime totals and sliding averages for the following: - - - - Total size of documents served to clients - - - Total size of data transmitted to clients, including - headers, error messages, etc. - - - Total size of data received from clients, including - request headers etc. - - - Number of client connections received - - - Number of client requests served - - - Client requests broken down by result code - - - Total size of documents retrieved from content - servers - - - Total size of data received from content servers, - including headers, error messages, etc. - - - Total size of data sent to content servers, - including request headers etc. - - - Number of content server connections - initiated - - - Number of content server requests sent - - - Content server requests broken down by result - code - - - Cache effectiveness as the ratio of bytes served to - clients to bytes requested from content servers - - - Cache effectiveness as the ratio of client requests - to content server requests - - - Number of active server processes / threads, broken - down by process / thread type - - - XXX length of request queues - - - - In addition, Varnish must provide the data necessary to - compute the average, median and distribution for the - following: - - - - Size of documents served, per unique document - - - Size of documents served, per request - - - Client connection duration - - - Requests per client connection - - - Client request completion time, broken down by - request type (HEAD / GET), cache status (HIT / MISS) and - outcome (200, 404...) - - - Content server connection duration - - - Requests per content server connection - - - Content server request completion time, broken down - by request type (HEAD / GET) and outcome (200, - 404...) - - - XXX time spent in request queues - - -
    -
    - -
    - Run-time monitoring and tuning - - Varnish must provide low-level monitoring and tuning - facilities. A separate application is responsible for providing - a user-friendly interface to these facilities. - - The following monitoring operations must be - supported: - - - - Cache status of individual documents - - - Cache status of documents matching a glob or regular - expression - - - Access statistics of individual documents - - - Access statistics of documents matching a glob or - regular expression - - - XXX - - - - The following tuning operations must be supported: - - - - Forced invalidation of individual documents - - - Forced invalidation of documents matching a glob or regular expression - - - XXX - - -
    -
    - Clustering - - Clustering is defined in this context as a situation where - multiple servers are set up to run Varnish with the same - configuration, serving data from the same content servers to the - same set of clients. - -
    - Management - - Varnish must be accompanied by a multiplexer for the - management interface which provide a single point of access to - the entire cluster for management tools such as the CLI - management tool or a web-based management interface. - - The management protocol must be designed to allow - management commands to be targeted at individual nodes. The - default behaviour must be to propagate management commands to - all nodes in the cluster. -
    - -
    - Configuration - - When multiple Varnish servers act together as a cluster, - the configuration facility is responsible for ensuring that - all nodes share the same configuration and that configuration - changes are applied to all nodes in a timely fashion. -
    - -
    - Logging and statistics - - When multiple Varnish servers act together as a cluster, - the logging and statistics facilities must base its reports on - aggregated data as if the cluster were a single Varnish - server. - - Per-node data may optionally be made available in - addition to aggregated data. -
    - -
    - Run-time monitoring and tuning - - When multiple Varnish servers act together as a cluster, - the run-time monitoring and tuning facilities must propagate - invalidation requests and other administrative commands to all - servers in the cluster. -
    -
    -
    - -
    Application structure
    @@ -789,10 +102,6 @@ References - - - -
    Modified: trunk/varnish-doc/en/varnish-specification/article.xml =================================================================== --- trunk/varnish-doc/en/varnish-specification/article.xml 2006-02-27 07:27:28 UTC (rev 29) +++ trunk/varnish-doc/en/varnish-specification/article.xml 2006-02-27 07:28:50 UTC (rev 30) @@ -696,96 +696,6 @@
    -
    - Application structure - -
    - Components - - This section lists the major components in Varnish. - -
    - Listener - - The Listener monitors the listening socket and accepts - incoming client connections. Once the connection is - established, it is passed to the Accepter. - - The Listener should take advantage of accept filters or - similar technologies on systems where they are - available. -
    - -
    - Accepter - - The Accepter reads an HTTP request from a client - connection. It parses the request line and header only to the - extent necessary to establish well-formedness and determine - the requested URL. - - The Accepter then queries the Keeper about the status of - the requested document (identified by its full URL). If the - document is present and valid in the cache, the request is - passed directly to a Sender. Otherwise, it is passed to a - Retriever queue. -
    - -
    - Keeper - - The Keeper manages the document cache. XXX -
    - -
    - Sender - - The Sender transfers the contents of the requested - document to the client. It examines the HTTP request header - to determine the correct way in which to do this ? Range, - If-Modified-Since, Content-Encoding and other options may - affect the type and amount of data transferred. - - There may be multiple concurrent Sender threads. -
    - -
    - Retriever - - The Retriever is responsible for retrieving documents - from the content servers. It is triggered either by an - Accepter trying to satisfy a request for a document which is - not in the cache, or by the Janitor when a ?hot? document is - nearing expiry. Either way, there may be a queue of requests - waiting for the document to arrive; when it does, the - Retriever passes those requests to a Sender. - - There may be multiple concurrent Retriever - threads. -
    - -
    - Janitor - - The Janitor keeps track of the expiry time of cached - documents and attempts to retrieve fresh copies of documents - which are soon to expire. -
    - -
    - Logger - - The Logger keeps logs of various types of events in - circular shared-memory buffers. These buffers must be managed - using either POSIX shared memory primitives or file-backed - mmap(2). - - It is the responsibility of each module to feed relevant - log data to the Logger. -
    -
    -
    - References From des at projects.linpro.no Mon Feb 27 07:47:20 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Mon, 27 Feb 2006 08:47:20 +0100 (CET) Subject: r31 - trunk/varnish-doc/en/varnish-architecture Message-ID: <20060227074720.0DC991ED534@projects.linpro.no> Author: des Date: 2006-02-27 08:47:19 +0100 (Mon, 27 Feb 2006) New Revision: 31 Modified: trunk/varnish-doc/en/varnish-architecture/article.xml Log: Paste large portion of phk's notes. Modified: trunk/varnish-doc/en/varnish-architecture/article.xml =================================================================== --- trunk/varnish-doc/en/varnish-architecture/article.xml 2006-02-27 07:28:50 UTC (rev 30) +++ trunk/varnish-doc/en/varnish-architecture/article.xml 2006-02-27 07:47:19 UTC (rev 31) @@ -89,9 +89,8 @@ Logger The Logger keeps logs of various types of events in - circular shared-memory buffers. These buffers must be managed - using either POSIX shared memory primitives or file-backed - mmap(2). + circular shared-memory buffers. See for details. It is the responsibility of each module to feed relevant log data to the Logger. @@ -99,6 +98,144 @@ +
    + Configuration + + Policy is configured in a simple unidirectional (no loops, + no goto) programming language which is compiled into 'C' and from + there binary modules which are dlopen'ed by the main Varnish + process. + + The dl object contains one exported symbol, a pointer to a + structure which contains a reference count, a number of function + pointers, a couple of string variables with identifying + information. + + All access into the config is protected by the reference + counts. + + Multiple policy configurations can be loaded at the same + time but only one is the "active configuration". Loading, + switching and unloading of policy configurations happen via the + managment process. + + A global config sequence number is incremented on each + switch and policy modified object attributes (ttl, cache/nocache) + are all qualified by the config-sequence under which they were + calculated and invalid if a different policy is now in + effect. +
    + +
    + Logging + + + +
    + +
    + Invalidation + + When a purge request comes in, the regexp is tagged with the + next generation number and added to the tail of the list of purge + regexps. + + Before a sender transmits an object, it is checked against + any purge-regexps which have higher generation number than the + object and if it matches the request is sent to a fetcher and the + object purged. + + If there were purge regexps with higher generation to match, + but they didn't match, the object is tagged with the current + generation number and moved to the tail of the list. + + Otherwise, the object does not change generation number and + is not moved on the generation list. + + New Objects are tagged with the current generation number + and put at the tail of the list. + + Objects are removed from the generation list when + deleted. + + When a purge object has a lower generation number than the + first object on the generation list, the purge object has been + completed and will be removed. A log entry is written with number + of compares and number of hits. +
    + +
    + Management + +
    + Management commands + + + + object_query url -> TTL, size, checksum + + + {purge,invalidate} regexp + + + object_status url -> object metadata + + + load_config filename + + + switch_config configname + + + list_configs + + + unload_config + + + freeze # stop the clock, freezes the object store + + + thaw + + + suspend # stop acceptor accepting new requests + + + resume + + + stop # forced stop (exits) varnish process + + + start + + + restart = "stop;start" + + + ping $utc_time -> pong $utc_time + + + stats [-mr] -> $data + + + zero stats + + + help + + + + Cluster only: + + + config_contents filename $inline -> compilation messages + + +
    +
    + References From des at projects.linpro.no Mon Feb 27 08:16:35 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Mon, 27 Feb 2006 09:16:35 +0100 (CET) Subject: r32 - trunk/varnish-doc/share Message-ID: <20060227081635.2E2FD1ED525@projects.linpro.no> Author: des Date: 2006-02-27 09:16:35 +0100 (Mon, 27 Feb 2006) New Revision: 32 Modified: trunk/varnish-doc/share/docbook-xml.css Log: Add table formatting. Modified: trunk/varnish-doc/share/docbook-xml.css =================================================================== --- trunk/varnish-doc/share/docbook-xml.css 2006-02-27 07:47:19 UTC (rev 31) +++ trunk/varnish-doc/share/docbook-xml.css 2006-02-27 08:16:35 UTC (rev 32) @@ -155,6 +155,48 @@ } /* + * Tables + */ +informaltable { + display: block; + padding: 1em; +} + +tgroup { + display: table; + border-collapse: collapse; + empty-cells: show; +} + +tgroup > thead { + display: table-header-group; + font-weight: bold; +} + +tgroup > tbody { + display: table-row-group; +} + +tgroup > tfoot { + display: table-footer-group; + font-weight: bold; +} + +thead > row, +tbody > row, +tfoot > row +{ + display: table-row; +} + +row > entry +{ + display: table-cell; + padding: 1ex; + border: thin solid black; +} + +/* * Links */ xref:before { From des at projects.linpro.no Mon Feb 27 08:24:05 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Mon, 27 Feb 2006 09:24:05 +0100 (CET) Subject: r33 - trunk/varnish-doc/share Message-ID: <20060227082405.0B4841ED52B@projects.linpro.no> Author: des Date: 2006-02-27 09:24:04 +0100 (Mon, 27 Feb 2006) New Revision: 33 Modified: trunk/varnish-doc/share/docbook-xml.css Log: Correct list rendering. Modified: trunk/varnish-doc/share/docbook-xml.css =================================================================== --- trunk/varnish-doc/share/docbook-xml.css 2006-02-27 08:16:35 UTC (rev 32) +++ trunk/varnish-doc/share/docbook-xml.css 2006-02-27 08:24:04 UTC (rev 33) @@ -150,7 +150,7 @@ itemizedlist > listitem { display: list-item; - list-style: disc inside; + list-style: disc outside; margin-left: 4em; } From des at projects.linpro.no Mon Feb 27 08:47:09 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Mon, 27 Feb 2006 09:47:09 +0100 (CET) Subject: r34 - trunk/varnish-doc/share Message-ID: <20060227084709.701441ED538@projects.linpro.no> Author: des Date: 2006-02-27 09:47:09 +0100 (Mon, 27 Feb 2006) New Revision: 34 Modified: trunk/varnish-doc/share/docbook-html.xsl Log: Implement tables. Modified: trunk/varnish-doc/share/docbook-html.xsl =================================================================== --- trunk/varnish-doc/share/docbook-html.xsl 2006-02-27 08:24:04 UTC (rev 33) +++ trunk/varnish-doc/share/docbook-html.xsl 2006-02-27 08:47:09 UTC (rev 34) @@ -77,7 +77,7 @@ - +
    @@ -141,6 +141,48 @@ + +
    + +
    +
    + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    From des at projects.linpro.no Mon Feb 27 09:55:56 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Mon, 27 Feb 2006 10:55:56 +0100 (CET) Subject: r35 - trunk/varnish-cache Message-ID: <20060227095556.F379F1ED539@projects.linpro.no> Author: des Date: 2006-02-27 10:55:56 +0100 (Mon, 27 Feb 2006) New Revision: 35 Added: trunk/varnish-cache/LICENSE Log: Don't forget the license! Added: trunk/varnish-cache/LICENSE =================================================================== --- trunk/varnish-cache/LICENSE 2006-02-27 08:47:09 UTC (rev 34) +++ trunk/varnish-cache/LICENSE 2006-02-27 09:55:56 UTC (rev 35) @@ -0,0 +1,24 @@ +Copyright (c) 2006 Verdens Gang AS +Copyright (c) 2006 Linpro AS +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. +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 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. From des at projects.linpro.no Mon Feb 27 11:10:13 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Mon, 27 Feb 2006 12:10:13 +0100 (CET) Subject: r36 - in trunk/varnish-cache: . lib/libvarnish lib/libvarnishapi Message-ID: <20060227111013.97FCB1ED525@projects.linpro.no> Author: des Date: 2006-02-27 12:10:13 +0100 (Mon, 27 Feb 2006) New Revision: 36 Modified: trunk/varnish-cache/autogen.sh trunk/varnish-cache/lib/libvarnish/Makefile.am trunk/varnish-cache/lib/libvarnishapi/Makefile.am Log: Correct libtool idiom: run libtoolize after aclocal, and use LTLIBRARIES instead of LIBRARIES. Modified: trunk/varnish-cache/autogen.sh =================================================================== --- trunk/varnish-cache/autogen.sh 2006-02-27 09:55:56 UTC (rev 35) +++ trunk/varnish-cache/autogen.sh 2006-02-27 11:10:13 UTC (rev 36) @@ -3,8 +3,8 @@ # $Id$ # +aclocal libtoolize --copy --force -aclocal autoheader automake --add-missing --copy --force --foreign autoconf Modified: trunk/varnish-cache/lib/libvarnish/Makefile.am =================================================================== --- trunk/varnish-cache/lib/libvarnish/Makefile.am 2006-02-27 09:55:56 UTC (rev 35) +++ trunk/varnish-cache/lib/libvarnish/Makefile.am 2006-02-27 11:10:13 UTC (rev 36) @@ -2,6 +2,6 @@ INCLUDES = -I$(top_srcdir)/include -lib_LIBRARIES = libvarnish.la +lib_LTLIBRARIES = libvarnish.la libvarnish_la_SOURCES = Modified: trunk/varnish-cache/lib/libvarnishapi/Makefile.am =================================================================== --- trunk/varnish-cache/lib/libvarnishapi/Makefile.am 2006-02-27 09:55:56 UTC (rev 35) +++ trunk/varnish-cache/lib/libvarnishapi/Makefile.am 2006-02-27 11:10:13 UTC (rev 36) @@ -2,6 +2,6 @@ INCLUDES = -I$(top_srcdir)/include -lib_LIBRARIES = libvarnishapi.la +lib_LTLIBRARIES = libvarnishapi.la libvarnishapi_la_SOURCES = From des at projects.linpro.no Mon Feb 27 14:21:01 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Mon, 27 Feb 2006 15:21:01 +0100 (CET) Subject: r37 - in trunk/varnish-cache/bin: . varnishd Message-ID: <20060227142101.3A9CF1ED533@projects.linpro.no> Author: des Date: 2006-02-27 15:21:01 +0100 (Mon, 27 Feb 2006) New Revision: 37 Modified: trunk/varnish-cache/bin/ trunk/varnish-cache/bin/varnishd/ Log: Ignore generated files. Property changes on: trunk/varnish-cache/bin ___________________________________________________________________ Name: svn:ignore + Makefile Makefile.in Property changes on: trunk/varnish-cache/bin/varnishd ___________________________________________________________________ Name: svn:ignore + .deps .libs Makefile Makefile.in From des at projects.linpro.no Mon Feb 27 14:21:13 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Mon, 27 Feb 2006 15:21:13 +0100 (CET) Subject: r38 - in trunk/varnish-cache/lib: . libvarnish libvarnishapi Message-ID: <20060227142113.D389B1ED52F@projects.linpro.no> Author: des Date: 2006-02-27 15:21:13 +0100 (Mon, 27 Feb 2006) New Revision: 38 Modified: trunk/varnish-cache/lib/ trunk/varnish-cache/lib/libvarnish/ trunk/varnish-cache/lib/libvarnishapi/ Log: Ignore generated files. Property changes on: trunk/varnish-cache/lib ___________________________________________________________________ Name: svn:ignore + Makefile Makefile.in Property changes on: trunk/varnish-cache/lib/libvarnish ___________________________________________________________________ Name: svn:ignore + .deps .libs Makefile Makefile.in Property changes on: trunk/varnish-cache/lib/libvarnishapi ___________________________________________________________________ Name: svn:ignore + .deps .libs Makefile Makefile.in From des at projects.linpro.no Mon Feb 27 14:21:25 2006 From: des at projects.linpro.no (des at projects.linpro.no) Date: Mon, 27 Feb 2006 15:21:25 +0100 (CET) Subject: r39 - trunk/varnish-cache/include Message-ID: <20060227142125.CBDEE1ED52F@projects.linpro.no> Author: des Date: 2006-02-27 15:21:25 +0100 (Mon, 27 Feb 2006) New Revision: 39 Modified: trunk/varnish-cache/include/ Log: Ignore generated files. Property changes on: trunk/varnish-cache/include ___________________________________________________________________ Name: svn:ignore + Makefile Makefile.in