Merge branch 'master' of ssh://pkgs.fedoraproject.org/rpms/varnish

This commit is contained in:
Ingvar Hagelund 2017-09-04 10:28:16 +02:00
commit d929f34a13
50 changed files with 0 additions and 3523 deletions

View File

@ -1,112 +0,0 @@
diff -Naur ../varnish-3.0.4.orig/bin/varnishd/cache_center.c ./bin/varnishd/cache_center.c
--- ../varnish-3.0.4.orig/bin/varnishd/cache_center.c 2013-06-14 10:39:31.000000000 +0200
+++ ./bin/varnishd/cache_center.c 2013-11-21 00:48:00.486460486 +0100
@@ -1471,9 +1471,12 @@
static int
cnt_start(struct sess *sp)
{
- uint16_t done;
+ uint16_t err_code;
char *p;
- const char *r = "HTTP/1.1 100 Continue\r\n\r\n";
+ const char *r_100 = "HTTP/1.1 100 Continue\r\n\r\n";
+ const char *r_400 = "HTTP/1.1 400 Bad Request\r\n\r\n";
+ const char *r_413 = "HTTP/1.1 413 Request Entity Too Large\r\n\r\n";
+ const char *r_417 = "HTTP/1.1 417 Expectation Failed\r\n\r\n";
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
AZ(sp->restarts);
@@ -1496,10 +1499,14 @@
sp->wrk->vcl = NULL;
http_Setup(sp->http, sp->ws);
- done = http_DissectRequest(sp);
+ err_code = http_DissectRequest(sp);
/* If we could not even parse the request, just close */
- if (done == 400) {
+ if (err_code == 400)
+ (void)write(sp->fd, r_400, strlen(r_400));
+ else if (err_code == 413)
+ (void)write(sp->fd, r_413, strlen(r_413));
+ if (err_code != 0) {
sp->step = STP_DONE;
vca_close_session(sp, "junk");
return (0);
@@ -1511,12 +1518,6 @@
/* Catch original request, before modification */
HTTP_Copy(sp->http0, sp->http);
- if (done != 0) {
- sp->err_code = done;
- sp->step = STP_ERROR;
- return (0);
- }
-
sp->doclose = http_DoConnection(sp->http);
/* XXX: Handle TRACE & OPTIONS of Max-Forwards = 0 */
@@ -1526,13 +1527,14 @@
*/
if (http_GetHdr(sp->http, H_Expect, &p)) {
if (strcasecmp(p, "100-continue")) {
- sp->err_code = 417;
- sp->step = STP_ERROR;
+ (void)write(sp->fd, r_417, strlen(r_417));
+ sp->step = STP_DONE;
+ vca_close_session(sp, "junk");
return (0);
}
/* XXX: Don't bother with write failures for now */
- (void)write(sp->fd, r, strlen(r));
+ (void)write(sp->fd, r_100, strlen(r_100));
/* XXX: When we do ESI includes, this is not removed
* XXX: because we use http0 as our basis. Believed
* XXX: safe, but potentially confusing.
diff -Naur ../varnish-3.0.4.orig/bin/varnishd/cache_http.c ./bin/varnishd/cache_http.c
--- ../varnish-3.0.4.orig/bin/varnishd/cache_http.c 2013-06-14 10:39:31.000000000 +0200
+++ ./bin/varnishd/cache_http.c 2013-11-21 00:48:00.486460486 +0100
@@ -601,7 +601,7 @@
hp->hd[h2].e = p;
if (!Tlen(hp->hd[h2]))
- return (413);
+ return (400);
/* Skip SP */
for (; vct_issp(*p); p++) {
diff -Naur ../varnish-3.0.4.orig/bin/varnishtest/tests/r01367.vtc ./bin/varnishtest/tests/r01367.vtc
--- ../varnish-3.0.4.orig/bin/varnishtest/tests/r01367.vtc 1970-01-01 01:00:00.000000000 +0100
+++ ./bin/varnishtest/tests/r01367.vtc 2013-11-21 00:48:00.486460486 +0100
@@ -0,0 +1,30 @@
+varnishtest "blank GET"
+
+server s1 {
+ rxreq
+ txresp
+} -start
+
+varnish v1 -vcl+backend {
+ sub vcl_error {
+ return (restart);
+ }
+} -start
+
+client c1 {
+ send "GET \nHost: example.com\n\n"
+ rxresp
+ expect resp.status == 400
+} -run
+
+client c1 {
+ txreq -hdr "Expect: Santa-Claus"
+ rxresp
+ expect resp.status == 417
+} -run
+
+client c1 {
+ txreq
+ rxresp
+ expect resp.status == 200
+} -run

View File

@ -1,13 +0,0 @@
--- redhat/find-provides.orig 2014-04-10 11:19:18.000000000 +0200
+++ redhat/find-provides 2014-04-22 23:59:34.070312036 +0200
@@ -4,8 +4,8 @@
set -x
-if [ -x /usr/lib/rpm/find-requires ]; then
- /usr/lib/rpm/find-requires "$@"
+if [ -x /usr/lib/rpm/redhat/find-provides ]; then
+ /usr/lib/rpm/redhat/find-provides "$@"
fi
cd $(dirname $0)/..

View File

@ -1,10 +0,0 @@
--- doc/sphinx/Makefile.in.orig 2014-04-22 11:12:19.029824740 +0200
+++ doc/sphinx/Makefile.in 2014-04-22 11:14:09.493153140 +0200
@@ -553,6 +553,7 @@
rm -rf $(BUILDDIR)
include/params.rst: $(top_builddir)/bin/varnishd/varnishd
+ LD_LIBRARY_PATH=$(top_builddir)/lib/libvarnish/.libs:$(top_builddir)/lib/libvarnishcompat/.libs:$(top_builddir)/lib/libvcc/.libs:$(top_builddir)/lib/libvgz/.libs \
$(top_builddir)/bin/varnishd/varnishd -x dumprstparam > include/params.rst
# XXX add varnishstat here when it's been _opt2rst'ed

View File

@ -1,11 +0,0 @@
--- configure.orig 2014-03-11 23:25:41.618988565 +0100
+++ configure 2014-03-11 23:26:03.480225451 +0100
@@ -16746,7 +16746,7 @@
# The reason for -Wno-error=unused-result is a glibc/gcc interaction
# idiocy where write is marked as warn_unused_result, causing build
# failures.
-CFLAGS="${CFLAGS} -Wall -Werror"
+#CFLAGS="${CFLAGS} -Wall -Werror"
OCFLAGS="${OCFLAGS} -Wall -Werror"
as_CACHEVAR=`$as_echo "ax_cv_check_cflags__-Werror=unused-result" | $as_tr_sh`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Werror=unused-result" >&5

View File

@ -1,11 +0,0 @@
--- configure.orig 2014-07-30 14:35:18.781987406 +0200
+++ configure 2014-07-30 14:36:12.686122224 +0200
@@ -16978,7 +16978,7 @@
# The reason for -Wno-error=unused-result is a glibc/gcc interaction
# idiocy where write is marked as warn_unused_result, causing build
# failures.
-CFLAGS="${CFLAGS} -Wall -Werror"
+#CFLAGS="${CFLAGS} -Wall -Werror"
OCFLAGS="${OCFLAGS} -Wall -Werror"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Werror=unused-result" >&5
$as_echo_n "checking whether C compiler accepts -Werror=unused-result... " >&6; }

View File

@ -1,37 +0,0 @@
diff --git a/redhat/varnish.service b/redhat/varnish.service
index 659dba2..a4f3355 100644
--- a/redhat/varnish.service
+++ b/redhat/varnish.service
@@ -27,6 +27,7 @@ EnvironmentFile=/etc/varnish/varnish.params
Type=forking
PIDFile=/var/run/varnish.pid
PrivateTmp=true
+ExecStartPre=/usr/sbin/varnishd -C -f $VARNISH_VCL_CONF
ExecStart=/usr/sbin/varnishd \
-P /var/run/varnish.pid \
-f $VARNISH_VCL_CONF \
diff --git a/redhat/varnishlog.service b/redhat/varnishlog.service
index 1e3e274..c7a0193 100644
--- a/redhat/varnishlog.service
+++ b/redhat/varnishlog.service
@@ -1,6 +1,6 @@
[Unit]
Description=Varnish HTTP accelerator logging daemon
-After=network.target
+After=varnish.service
[Service]
Type=forking
diff --git a/redhat/varnishncsa.service b/redhat/varnishncsa.service
index df5f19f..e2ebdcd 100644
--- a/redhat/varnishncsa.service
+++ b/redhat/varnishncsa.service
@@ -1,6 +1,6 @@
[Unit]
-Description=Varnish NCSA logging
-After=network.target
+Description=Varnish HTTP accelerator NCSA daemon
+After=varnish.service
[Service]
Type=forking

View File

@ -1,10 +0,0 @@
--- doc/sphinx/Makefile.in.orig 2014-10-08 09:48:47.000000000 +0200
+++ doc/sphinx/Makefile.in 2014-11-25 22:49:55.137641462 +0100
@@ -517,6 +517,7 @@
rm -rf $(BUILDDIR)
include/params.rst: $(top_builddir)/bin/varnishd/varnishd
+ LD_LIBRARY_PATH=$(top_builddir)/lib/libvarnish/.libs:$(top_builddir)/lib/libvarnishcompat/.libs:$(top_builddir)/lib/libvcc/.libs:$(top_builddir)/lib/libvgz/.libs \
$(top_builddir)/bin/varnishd/varnishd -x dumprstparam > include/params.rst
# XXX add varnishstat here when it's been _opt2rst'ed

View File

@ -1,11 +0,0 @@
--- configure.old 2015-03-05 13:20:10.546649666 +0100
+++ configure 2015-03-05 13:20:14.099663485 +0100
@@ -16794,7 +16794,7 @@
# The reason for -Wno-error=unused-result is a glibc/gcc interaction
# idiocy where write is marked as warn_unused_result, causing build
# failures.
-CFLAGS="${CFLAGS} -Wall -Werror"
+#CFLAGS="${CFLAGS} -Wall -Werror"
OCFLAGS="${OCFLAGS} -Wall -Werror"
as_CACHEVAR=`$as_echo "ax_cv_check_cflags__-Werror=unused-result" | $as_tr_sh`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Werror=unused-result" >&5

View File

@ -1,274 +0,0 @@
This patch is a rebase of commit 9d61ea4d722549a984d912603902fccfac473824
Author: Martin Blix Grydeland <martin@varnish-software.com>
Date: Fri Mar 13 15:23:15 2015 +0100
Fail fetch on malformed Content-Length header
Add a common content length parser that is being used by both client
and backend side.
Original patch by: fgs
Fixes: #1691
diff -Nur varnish-4.0.3.nofix/bin/varnishd/cache/cache.h varnish-4.0.3/bin/varnishd/cache/cache.h
--- varnish-4.0.3.nofix/bin/varnishd/cache/cache.h 2015-02-18 15:14:11.000000000 +0100
+++ varnish-4.0.3/bin/varnishd/cache/cache.h 2015-03-13 16:22:42.943549723 +0100
@@ -208,7 +208,7 @@
*
*/
-typedef ssize_t htc_read(struct http_conn *, void *, size_t);
+typedef ssize_t htc_read(struct http_conn *, void *, ssize_t);
struct http_conn {
unsigned magic;
@@ -560,7 +560,7 @@
struct pool_task fetch_task;
- char *h_content_length;
+ ssize_t content_length;
#define BO_FLAG(l, r, w, d) unsigned l:1;
#include "tbl/bo_flags.h"
@@ -1014,6 +1014,7 @@
int http_GetHdrField(const struct http *hp, const char *hdr,
const char *field, char **ptr);
double http_GetHdrQ(const struct http *hp, const char *hdr, const char *field);
+ssize_t http_GetContentLength(const struct http *hp);
uint16_t http_GetStatus(const struct http *hp);
void http_SetStatus(struct http *to, uint16_t status);
const char *http_GetReq(const struct http *hp);
@@ -1040,7 +1041,7 @@
unsigned maxbytes, unsigned maxhdr);
enum htc_status_e HTTP1_Reinit(struct http_conn *htc);
enum htc_status_e HTTP1_Rx(struct http_conn *htc);
-ssize_t HTTP1_Read(struct http_conn *htc, void *d, size_t len);
+ssize_t HTTP1_Read(struct http_conn *htc, void *d, ssize_t len);
enum htc_status_e HTTP1_Complete(struct http_conn *htc);
uint16_t HTTP1_DissectRequest(struct req *);
uint16_t HTTP1_DissectResponse(struct http *sp, const struct http_conn *htc);
diff -Nur varnish-4.0.3.nofix/bin/varnishd/cache/cache_http1_fetch.c varnish-4.0.3/bin/varnishd/cache/cache_http1_fetch.c
--- varnish-4.0.3.nofix/bin/varnishd/cache/cache_http1_fetch.c 2015-02-18 15:14:11.000000000 +0100
+++ varnish-4.0.3/bin/varnishd/cache/cache_http1_fetch.c 2015-03-13 16:22:42.944549727 +0100
@@ -43,29 +43,6 @@
#include "vtcp.h"
#include "vtim.h"
-/*--------------------------------------------------------------------
- * Convert a string to a size_t safely
- */
-
-static ssize_t
-vbf_fetch_number(const char *nbr, int radix)
-{
- uintmax_t cll;
- ssize_t cl;
- char *q;
-
- if (*nbr == '\0')
- return (-1);
- cll = strtoumax(nbr, &q, radix);
- if (q == NULL || *q != '\0')
- return (-1);
-
- cl = (ssize_t)cll;
- if((uintmax_t)cl != cll) /* Protect against bogusly large values */
- return (-1);
- return (cl);
-}
-
/*--------------------------------------------------------------------*/
static enum vfp_status __match_proto__(vfp_pull_f)
@@ -167,7 +144,6 @@
V1F_Setup_Fetch(struct busyobj *bo)
{
struct http_conn *htc;
- ssize_t cl;
CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
htc = &bo->htc;
@@ -176,13 +152,15 @@
switch(htc->body_status) {
case BS_EOF:
+ assert(bo->content_length == -1);
VFP_Push(bo, v1f_pull_eof, 0);
return(-1);
case BS_LENGTH:
- cl = vbf_fetch_number(bo->h_content_length, 10);
- VFP_Push(bo, v1f_pull_straight, cl);
- return (cl);
+ assert(bo->content_length > 0);
+ VFP_Push(bo, v1f_pull_straight, bo->content_length);
+ return (bo->content_length);
case BS_CHUNKED:
+ assert(bo->content_length == -1);
VFP_Push(bo, v1f_pull_chunked, -1);
return (-1);
default:
diff -Nur varnish-4.0.3.nofix/bin/varnishd/cache/cache_http1_fsm.c varnish-4.0.3/bin/varnishd/cache/cache_http1_fsm.c
--- varnish-4.0.3.nofix/bin/varnishd/cache/cache_http1_fsm.c 2015-02-18 15:14:11.000000000 +0100
+++ varnish-4.0.3/bin/varnishd/cache/cache_http1_fsm.c 2015-03-13 16:22:42.944549727 +0100
@@ -262,22 +262,22 @@
static enum req_body_state_e
http1_req_body_status(struct req *req)
{
- char *ptr, *endp;
+ ssize_t cl;
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
- if (http_GetHdr(req->http, H_Content_Length, &ptr)) {
- AN(ptr);
- if (*ptr == '\0')
- return (REQ_BODY_FAIL);
- req->req_bodybytes = strtoul(ptr, &endp, 10);
- if (*endp != '\0' && !vct_islws(*endp))
- return (REQ_BODY_FAIL);
- if (req->req_bodybytes == 0)
- return (REQ_BODY_NONE);
+ req->req_bodybytes = 0;
+ cl = http_GetContentLength(req->http);
+ if (cl == -2)
+ return (REQ_BODY_FAIL);
+ else if (cl == 0)
+ return (REQ_BODY_NONE);
+ else if (cl > 0) {
+ req->req_bodybytes = cl;
req->h1.bytes_yet = req->req_bodybytes - req->h1.bytes_done;
return (REQ_BODY_PRESENT);
}
+ assert(cl == -1); /* No Content-Length header */
if (http_HdrIs(req->http, H_Transfer_Encoding, "chunked")) {
req->chunk_ctr = -1;
return (REQ_BODY_CHUNKED);
diff -Nur varnish-4.0.3.nofix/bin/varnishd/cache/cache_http1_proto.c varnish-4.0.3/bin/varnishd/cache/cache_http1_proto.c
--- varnish-4.0.3.nofix/bin/varnishd/cache/cache_http1_proto.c 2015-02-18 15:14:11.000000000 +0100
+++ varnish-4.0.3/bin/varnishd/cache/cache_http1_proto.c 2015-03-13 16:22:42.944549727 +0100
@@ -191,14 +191,15 @@
* Read up to len bytes, returning pipelined data first.
*/
-ssize_t
-HTTP1_Read(struct http_conn *htc, void *d, size_t len)
+ssize_t __match_proto__(htc_read)
+HTTP1_Read(struct http_conn *htc, void *d, ssize_t len)
{
size_t l;
unsigned char *p;
ssize_t i = 0;
CHECK_OBJ_NOTNULL(htc, HTTP_CONN_MAGIC);
+ assert(len > 0);
l = 0;
p = d;
if (htc->pipeline.b) {
diff -Nur varnish-4.0.3.nofix/bin/varnishd/cache/cache_http.c varnish-4.0.3/bin/varnishd/cache/cache_http.c
--- varnish-4.0.3.nofix/bin/varnishd/cache/cache_http.c 2015-02-18 15:14:11.000000000 +0100
+++ varnish-4.0.3/bin/varnishd/cache/cache_http.c 2015-03-13 16:22:42.943549723 +0100
@@ -488,6 +488,35 @@
return (i);
}
+/*--------------------------------------------------------------------*/
+
+ssize_t
+http_GetContentLength(const struct http *hp)
+{
+ ssize_t cl, cll;
+ char *b;
+
+ CHECK_OBJ_NOTNULL(hp, HTTP_MAGIC);
+
+ if (!http_GetHdr(hp, H_Content_Length, &b))
+ return (-1);
+ cl = 0;
+ if (!vct_isdigit(*b))
+ return (-2);
+ for (;vct_isdigit(*b); b++) {
+ cll = cl;
+ cl *= 10;
+ cl += *b - '0';
+ if (cll != cl / 10)
+ return (-2);
+ }
+ while (vct_islws(*b))
+ b++;
+ if (*b != '\0')
+ return (-2);
+ return (cl);
+}
+
/*--------------------------------------------------------------------
* XXX: redo with http_GetHdrField() ?
*/
diff -Nur varnish-4.0.3.nofix/bin/varnishd/cache/cache_rfc2616.c varnish-4.0.3/bin/varnishd/cache/cache_rfc2616.c
--- varnish-4.0.3.nofix/bin/varnishd/cache/cache_rfc2616.c 2015-02-18 15:14:11.000000000 +0100
+++ varnish-4.0.3/bin/varnishd/cache/cache_rfc2616.c 2015-03-13 16:22:42.944549727 +0100
@@ -188,6 +188,7 @@
RFC2616_Body(struct busyobj *bo, struct dstat *stats)
{
struct http *hp;
+ ssize_t cl;
char *b;
hp = bo->beresp;
@@ -199,6 +200,8 @@
else
bo->should_close = 0;
+ bo->content_length = -1;
+
if (!strcasecmp(http_GetReq(bo->bereq), "head")) {
/*
* A HEAD request can never have a body in the reply,
@@ -246,9 +249,18 @@
return (BS_ERROR);
}
- if (http_GetHdr(hp, H_Content_Length, &bo->h_content_length)) {
- stats->fetch_length++;
- return (BS_LENGTH);
+ cl = http_GetContentLength(hp);
+ if (cl == -2)
+ return (BS_ERROR);
+ if (cl >= 0) {
+ bo->content_length = cl;
+ if (cl == 0) {
+ stats->fetch_zero++;
+ return (BS_NONE);
+ } else {
+ stats->fetch_length++;
+ return (BS_LENGTH);
+ }
}
if (http_HdrIs(hp, H_Connection, "keep-alive")) {
diff -Nur varnish-4.0.3.nofix/bin/varnishtest/tests/r01691.vtc varnish-4.0.3/bin/varnishtest/tests/r01691.vtc
--- varnish-4.0.3.nofix/bin/varnishtest/tests/r01691.vtc 1970-01-01 01:00:00.000000000 +0100
+++ varnish-4.0.3/bin/varnishtest/tests/r01691.vtc 2015-03-13 16:22:42.945549731 +0100
@@ -0,0 +1,21 @@
+varnishtest "Test bogus Content-Length header"
+
+server s1 {
+ rxreq
+ txresp -nolen -hdr "Content-Length: bogus"
+} -start
+
+varnish v1 -vcl+backend {
+
+} -start
+
+logexpect l1 -v v1 {
+ expect * 1002 VCL_Error "Body cannot be fetched"
+} -start
+
+client c1 {
+ txreq
+ rxresp
+} -run
+
+logexpect l1 -wait

View File

@ -1,77 +0,0 @@
--- lib/libvcc/vmodtool.py.orig 2015-03-05 14:20:35.982791597 +0100
+++ lib/libvcc/vmodtool.py 2015-03-05 14:34:46.896115280 +0100
@@ -33,8 +33,8 @@
vmod_${name}.rst -- Extracted documentation
"""
-# This script should work with both Python 2 and Python 3.
-from __future__ import print_function
+## This script should work with both Python 2 and Python 3.
+#from __future__ import print_function
import sys
import re
@@ -67,6 +67,15 @@
#######################################################################
+# __future__ print_function is not available on python2.4 in rhel5, so
+# make a local simple variant _print
+
+def _print(*objects, **kwargs):
+ sep = kwargs.get('sep', ' ')
+ end = kwargs.get('end', '\n')
+ out = kwargs.get('file', sys.stdout)
+ out.write(sep.join(objects) + end)
+
def write_file_warning(fo, a, b, c):
fo.write(a + "\n")
fo.write(b + " NB: This file is machine generated, DO NOT EDIT!\n")
@@ -741,8 +750,8 @@
if opts.strict:
raise FormatError(m, details)
else:
- print("WARNING: %s:" % m, file=sys.stderr)
- print(details, file=sys.stderr)
+ _print("WARNING: %s:" % m, file=sys.stderr)
+ _print(details, file=sys.stderr)
else:
for ln, i in self.l:
o.doc(i)
@@ -784,9 +793,12 @@
def runmain(inputvcc, outputname="vcc_if"):
# Read the file in
lines = []
- with open(inputvcc, "r") as fp:
+ fp = open(inputvcc, "r")
+ try:
for i in fp:
lines.append(i.rstrip())
+ finally:
+ fp.close
ln = 0
#######################################################################
@@ -839,11 +851,11 @@
for i in sl:
i.parse(vx)
assert len(i.tl) == 0
- except ParseError as e:
+ except ParseError, e:
print("ERROR: Parse error reading \"%s\":" % inputvcc)
pprint(str(e))
exit(-1)
- except FormatError as e:
+ except FormatError, e:
print("ERROR: Format error reading \"%s\": %s" %
(inputvcc, pformat(e.msg)))
print(e.details)
@@ -916,7 +928,7 @@
if not i_vcc:
i_vcc = "vmod.vcc"
else:
- print("ERROR: No vmod.vcc file supplied or found.",
+ _print("ERROR: No vmod.vcc file supplied or found.",
file=sys.stderr)
oparser.print_help()
exit(-1)

View File

@ -1,87 +0,0 @@
From 75955e86c37f69a4421a1fa49102790bb25ea7d1 Mon Sep 17 00:00:00 2001
From: Lasse Karstensen <lkarsten@varnish-software.com>
Date: Mon, 1 Feb 2016 14:05:47 +0100
Subject: [PATCH] Revert removal of type=forking.
In fbc85bb3 the use of type=forking was removed. This made #1794
reappear, as these tools when not daemonized exists when receiving
a SIGHUP.
This is clearly suboptimal for log rotation.
Roll back this in the packages for now.
---
debian/varnishlog.service | 4 +++-
debian/varnishncsa.service | 4 +++-
redhat/varnishlog.service | 4 +++-
redhat/varnishncsa.service | 4 +++-
4 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/debian/varnishlog.service b/debian/varnishlog.service
index 7e54a4e..19e60fa 100644
--- a/debian/varnishlog.service
+++ b/debian/varnishlog.service
@@ -3,9 +3,11 @@ Description=Varnish Cache HTTP accelerator logging daemon
After=varnish.service
[Service]
+Type=forking
+PIDFile=/run/varnishlog.pid
User=varnishlog
Group=varnish
-ExecStart=/usr/bin/varnishlog -a -w /var/log/varnish/varnish.log
+ExecStart=/usr/bin/varnishlog -a -w /var/log/varnish/varnish.log -D -P /run/varnishlog.pid
ExecReload=/bin/kill -HUP $MAINPID
[Install]
diff --git a/debian/varnishncsa.service b/debian/varnishncsa.service
index e8e1d28..ba22f0f 100644
--- a/debian/varnishncsa.service
+++ b/debian/varnishncsa.service
@@ -3,9 +3,11 @@ Description=Varnish Cache HTTP accelerator log daemon
After=varnish.service
[Service]
+Type=forking
+PIDFile=/run/varnishncsa.pid
User=varnishlog
Group=varnish
-ExecStart=/usr/bin/varnishncsa -a -w /var/log/varnish/varnishncsa.log
+ExecStart=/usr/bin/varnishncsa -a -w /var/log/varnish/varnishncsa.log -D -P /run/varnishncsa.pid
ExecReload=/bin/kill -HUP $MAINPID
[Install]
diff --git a/redhat/varnishlog.service b/redhat/varnishlog.service
index 7e54a4e..19e60fa 100644
--- a/redhat/varnishlog.service
+++ b/redhat/varnishlog.service
@@ -3,9 +3,11 @@ Description=Varnish Cache HTTP accelerator logging daemon
After=varnish.service
[Service]
+Type=forking
+PIDFile=/run/varnishlog.pid
User=varnishlog
Group=varnish
-ExecStart=/usr/bin/varnishlog -a -w /var/log/varnish/varnish.log
+ExecStart=/usr/bin/varnishlog -a -w /var/log/varnish/varnish.log -D -P /run/varnishlog.pid
ExecReload=/bin/kill -HUP $MAINPID
[Install]
diff --git a/redhat/varnishncsa.service b/redhat/varnishncsa.service
index e8e1d28..ba22f0f 100644
--- a/redhat/varnishncsa.service
+++ b/redhat/varnishncsa.service
@@ -3,9 +3,11 @@ Description=Varnish Cache HTTP accelerator log daemon
After=varnish.service
[Service]
+Type=forking
+PIDFile=/run/varnishncsa.pid
User=varnishlog
Group=varnish
-ExecStart=/usr/bin/varnishncsa -a -w /var/log/varnish/varnishncsa.log
+ExecStart=/usr/bin/varnishncsa -a -w /var/log/varnish/varnishncsa.log -D -P /run/varnishncsa.pid
ExecReload=/bin/kill -HUP $MAINPID
[Install]

View File

@ -1,11 +0,0 @@
--- bin/varnishtest/tests/r01576.vtc.orig 2015-09-30 13:39:14.000000000 +0200
+++ bin/varnishtest/tests/r01576.vtc 2015-10-06 00:52:50.921509265 +0200
@@ -42,7 +42,7 @@
# This should fail with default params and JIT/no-JIT
client c1 {
- txreq -url /aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+ txreq -url /aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
rxresp
} -run

View File

@ -1,14 +0,0 @@
--- bin/varnishtest/tests/v00017.vtc.orig 2015-09-30 13:39:14.000000000 +0200
+++ bin/varnishtest/tests/v00017.vtc 2015-10-05 13:58:05.129191488 +0200
@@ -36,9 +36,9 @@
sub vcl_recv { if (client.ip ~ a) { return(pass); } }
}
-varnish v1 -errvcl {DNS lookup(10.1.2.): } {
+varnish v1 -errvcl {DNS lookup(198..2.): } {
backend b { .host = "127.0.0.1"; }
- acl a { "10.1.2."; }
+ acl a { "198..2."; }
sub vcl_recv { if (client.ip ~ a) { return(pass); } }
}

View File

@ -1,10 +0,0 @@
--- doc/sphinx/Makefile.in.orig 2015-10-04 09:30:26.260411617 +0200
+++ doc/sphinx/Makefile.in 2015-10-04 09:31:05.661090770 +0200
@@ -602,6 +602,7 @@
rm -rf $(BUILDDIR)
include/params.rst: $(top_builddir)/bin/varnishd/varnishd
+ LD_LIBRARY_PATH=$(top_builddir)/lib/libvarnish/.libs:$(top_builddir)/lib/libvarnishcompat/.libs:$(top_builddir)/lib/libvcc/.libs:$(top_builddir)/lib/libvgz/.libs \
$(top_builddir)/bin/varnishd/varnishd -x dumprstparam > include/params.rst
# XXX add varnishstat here when it's been _opt2rst'ed

View File

@ -1,10 +0,0 @@
--- doc/sphinx/Makefile.in.orig 2016-01-29 08:47:23.963344825 +0100
+++ doc/sphinx/Makefile.in 2016-01-29 08:49:30.290601970 +0100
@@ -531,6 +531,7 @@
rm -rf $(BUILDDIR)
include/params.rst: $(top_builddir)/bin/varnishd/varnishd
+ LD_LIBRARY_PATH=$(top_builddir)/lib/libvarnish/.libs:$(top_builddir)/lib/libvarnishcompat/.libs:$(top_builddir)/lib/libvcc/.libs:$(top_builddir)/lib/libvgz/.libs \
$(top_builddir)/bin/varnishd/varnishd -x dumprstparam > include/params.rst
include/counters.rst: $(top_builddir)/bin/varnishstat/vsc2rst

View File

@ -1,111 +0,0 @@
--- lib/libvcc/vmodtool.py.orig 2016-03-29 11:16:00.534066134 +0200
+++ lib/libvcc/vmodtool.py 2016-03-29 12:11:54.571647851 +0200
@@ -33,8 +33,8 @@
vmod_${name}.rst -- Extracted documentation
"""
-# This script should work with both Python 2 and Python 3.
-from __future__ import print_function
+## This script should work with both Python 2 and Python 3.
+#from __future__ import print_function
import sys
import re
@@ -45,6 +45,16 @@
from os.path import dirname, exists, join, realpath
from pprint import pprint, pformat
+# __future__ print_function is not available on python2.4 in rhel5, so
+# make a local simple variant _print
+
+def _print(*objects, **kwargs):
+ sep = kwargs.get('sep', ' ')
+ end = kwargs.get('end', '\n')
+ out = kwargs.get('file', sys.stdout)
+ out.write(sep.join(objects) + end)
+
+
ctypes = {
'ACL': "VCL_ACL",
'BACKEND': "VCL_BACKEND",
@@ -728,7 +738,7 @@
def get_token(self):
while True:
if len(self.tl) > 0:
- # print("T\t", self.tl[0])
+ # _print("T\t", self.tl[0])
return self.tl.pop(0)
if len(self.l) == 0:
break
@@ -796,7 +806,7 @@
raise FormatError("Unknown keyword: %s" %
t.str, "")
else:
- print("WARNING: Unknown keyword: %s:" %
+ _print("WARNING: Unknown keyword: %s:" %
t.str, file=sys.stderr)
o = None
while len(self.tl) > 0:
@@ -809,8 +819,8 @@
if opts.strict:
raise FormatError(m, details)
else:
- print("WARNING: %s:" % m, file=sys.stderr)
- print(details, file=sys.stderr)
+ _print("WARNING: %s:" % m, file=sys.stderr)
+ _print(details, file=sys.stderr)
else:
for ln, i in self.l:
o.doc(i)
@@ -852,9 +862,12 @@
def runmain(inputvcc, rstdir, outputprefix):
# Read the file in
lines = []
- with open(inputvcc, "r") as fp:
+ fp = open(inputvcc, "r")
+ try:
for i in fp:
lines.append(i.rstrip())
+ finally:
+ fp.close
ln = 0
#######################################################################
@@ -874,7 +887,7 @@
if False:
for i in copy_right:
- print("(C)\t", i)
+ _print("(C)\t", i)
#######################################################################
# Break into sections
@@ -899,14 +912,14 @@
for i in sl:
i.parse(vx)
assert len(i.tl) == 0
- except ParseError as e:
- print("ERROR: Parse error reading \"%s\":" % inputvcc)
+ except ParseError, e:
+ _print("ERROR: Parse error reading \"%s\":" % inputvcc)
pprint(str(e))
exit(-1)
- except FormatError as e:
- print("ERROR: Format error reading \"%s\": %s" %
+ except FormatError, e:
+ _print("ERROR: Format error reading \"%s\": %s" %
(inputvcc, pformat(e.msg)))
- print(e.details)
+ _print(e.details)
exit(-2)
#######################################################################
@@ -981,7 +994,7 @@
if not i_vcc:
i_vcc = "vmod.vcc"
else:
- print("ERROR: No vmod.vcc file supplied or found.",
+ _print("ERROR: No vmod.vcc file supplied or found.",
file=sys.stderr)
oparser.print_help()
exit(-1)

View File

@ -1,11 +0,0 @@
--- configure.orig 2016-08-02 14:56:14.888475820 +0200
+++ configure 2016-08-02 14:56:26.633158063 +0200
@@ -17247,7 +17247,7 @@
# The reason for -Wno-error=unused-result is a glibc/gcc interaction
# idiocy where write is marked as warn_unused_result, causing build
# failures.
-CFLAGS="${CFLAGS} -Wall -Werror"
+#CFLAGS="${CFLAGS} -Wall -Werror"
OCFLAGS="${OCFLAGS} -Wall -Werror"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Werror=unused-result" >&5
$as_echo_n "checking whether C compiler accepts -Werror=unused-result... " >&6; }

View File

@ -1,11 +0,0 @@
--- configure.orig 2016-08-24 22:21:08.524949225 +0200
+++ configure 2016-08-24 22:30:04.047845691 +0200
@@ -18108,7 +18108,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Werror" >&5
$as_echo "$ax_cv_check_cflags___Werror" >&6; }
if test x"$ax_cv_check_cflags___Werror" = xyes; then :
- CFLAGS="${CFLAGS} -Werror"
+# CFLAGS="${CFLAGS} -Werror"
OCFLAGS="${OCFLAGS} -Werror"
else
as_CACHEVAR=`$as_echo "ax_cv_check_cflags__${SUNCC_CFLAGS}" | $as_tr_sh`

View File

@ -1,100 +0,0 @@
diff -Naur ../varnish-5.0.0-beta1.orig/bin/varnishd/Makefile.in ./bin/varnishd/Makefile.in
--- ../varnish-5.0.0-beta1.orig/bin/varnishd/Makefile.in 2016-09-09 10:43:06.000000000 +0200
+++ ./bin/varnishd/Makefile.in 2016-09-14 14:59:53.302301003 +0200
@@ -2934,6 +2934,8 @@
-e 's/^/ "/' $(srcdir)/builtin.vcl >> $@
vhp_hufdec.h: vhp_gen_hufdec
+ LD_LIBRARY_PATH=\
+ $(top_builddir)/lib/libvarnish/.libs:\
$(AM_V_GEN) ./vhp_gen_hufdec > vhp_hufdec.h_
mv vhp_hufdec.h_ vhp_hufdec.h
diff -Naur ../varnish-5.0.0-beta1.orig/doc/sphinx/Makefile.in ./doc/sphinx/Makefile.in
--- ../varnish-5.0.0-beta1.orig/doc/sphinx/Makefile.in 2016-09-09 10:43:07.000000000 +0200
+++ ./doc/sphinx/Makefile.in 2016-09-14 14:55:51.898109072 +0200
@@ -614,39 +614,84 @@
rm -rf $(BUILDDIR)
include/cli.rst: $(top_builddir)/bin/varnishd/varnishd
+ LD_LIBRARY_PATH=\
+$(top_builddir)/lib/libvarnish/.libs:\
+$(top_builddir)/lib/libvarnishcompat/.libs:\
+$(top_builddir)/lib/libvcc/.libs:\
+$(top_builddir)/lib/libvgz/.libs \
$(top_builddir)/bin/varnishd/varnishd -x dumprstcli > $@
include/params.rst: $(top_builddir)/bin/varnishd/varnishd
+ LD_LIBRARY_PATH=\
+$(top_builddir)/lib/libvarnish/.libs:\
+$(top_builddir)/lib/libvarnishcompat/.libs:\
+$(top_builddir)/lib/libvcc/.libs:\
+$(top_builddir)/lib/libvgz/.libs \
$(top_builddir)/bin/varnishd/varnishd -x dumprstparam > $@
include/counters.rst: $(top_builddir)/bin/varnishstat/vsc2rst
+ LD_LIBRARY_PATH=\
+$(top_builddir)/lib/libvarnishcompat/.libs:\
+$(top_builddir)/lib/libvarnishapi/.libs \
$(top_builddir)/bin/varnishstat/vsc2rst > $@
# XXX add varnishstat here when it's been _opt2rst'ed
include/varnishncsa_options.rst: $(top_builddir)/bin/varnishncsa/varnishncsa
+ LD_LIBRARY_PATH=\
+$(top_builddir)/lib/libvarnishcompat/.libs:\
+$(top_builddir)/lib/libvarnishapi/.libs \
$(top_builddir)/bin/varnishncsa/varnishncsa --options > $@
include/varnishncsa_synopsis.rst: $(top_builddir)/bin/varnishncsa/varnishncsa
+ LD_LIBRARY_PATH=\
+$(top_builddir)/lib/libvarnishcompat/.libs:\
+$(top_builddir)/lib/libvarnishapi/.libs \
$(top_builddir)/bin/varnishncsa/varnishncsa --synopsis > $@
include/varnishlog_options.rst: $(top_builddir)/bin/varnishlog/varnishlog
+ LD_LIBRARY_PATH=\
+$(top_builddir)/lib/libvarnishcompat/.libs:\
+$(top_builddir)/lib/libvarnishapi/.libs \
$(top_builddir)/bin/varnishlog/varnishlog --options > $@
include/varnishlog_synopsis.rst: $(top_builddir)/bin/varnishlog/varnishlog
+ LD_LIBRARY_PATH=\
+$(top_builddir)/lib/libvarnishcompat/.libs:\
+$(top_builddir)/lib/libvarnishapi/.libs \
$(top_builddir)/bin/varnishlog/varnishlog --synopsis > $@
include/varnishtop_options.rst: $(top_builddir)/bin/varnishtop/varnishtop
+ LD_LIBRARY_PATH=\
+$(top_builddir)/lib/libvarnishcompat/.libs:\
+$(top_builddir)/lib/libvarnishapi/.libs \
$(top_builddir)/bin/varnishtop/varnishtop --options > $@
include/varnishtop_synopsis.rst: $(top_builddir)/bin/varnishtop/varnishtop
+ LD_LIBRARY_PATH=\
+$(top_builddir)/lib/libvarnishcompat/.libs:\
+$(top_builddir)/lib/libvarnishapi/.libs \
$(top_builddir)/bin/varnishtop/varnishtop --synopsis > $@
include/varnishhist_options.rst: $(top_builddir)/bin/varnishhist/varnishhist
+ LD_LIBRARY_PATH=\
+$(top_builddir)/lib/libvarnishcompat/.libs:\
+$(top_builddir)/lib/libvarnishapi/.libs:\
+$(top_builddir)/lib/libvarnish/.libs \
$(top_builddir)/bin/varnishhist/varnishhist --options > $@
include/varnishhist_synopsis.rst: $(top_builddir)/bin/varnishhist/varnishhist
+ LD_LIBRARY_PATH=\
+$(top_builddir)/lib/libvarnishcompat/.libs:\
+$(top_builddir)/lib/libvarnishapi/.libs:\
+$(top_builddir)/lib/libvarnish/.libs \
$(top_builddir)/bin/varnishhist/varnishhist --synopsis > $@
include/varnishstat_options.rst: $(top_builddir)/bin/varnishstat/varnishstat
+ LD_LIBRARY_PATH=\
+$(top_builddir)/lib/libvarnishcompat/.libs:\
+$(top_builddir)/lib/libvarnishapi/.libs \
$(top_builddir)/bin/varnishstat/varnishstat --options > $@
include/varnishstat_synopsis.rst: $(top_builddir)/bin/varnishstat/varnishstat
+ LD_LIBRARY_PATH=\
+$(top_builddir)/lib/libvarnishcompat/.libs:\
+$(top_builddir)/lib/libvarnishapi/.libs \
$(top_builddir)/bin/varnishstat/varnishstat --synopsis > $@
include/vsl-tags.rst: $(top_builddir)/lib/libvarnishapi/vsl2rst

View File

@ -1,68 +0,0 @@
--- lib/libvcc/vmodtool.py.orig 2016-09-14 14:39:29.159447283 +0200
+++ lib/libvcc/vmodtool.py 2016-09-14 14:46:33.446283000 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python2.4
#-
# Copyright (c) 2010-2016 Varnish Software
# All rights reserved.
@@ -33,8 +33,8 @@
vmod_${name}.rst -- Extracted documentation
"""
-# This script should work with both Python 2 and Python 3.
-from __future__ import print_function
+## This script should work with both Python 2 and Python 3.
+#from __future__ import print_function
import os
import sys
@@ -47,6 +47,16 @@
from pprint import pprint, pformat
from tempfile import mkstemp
+# __future__ print_function is not available on python2.4 in rhel5, so
+# make a local simple variant _print
+
+def _print(*objects, **kwargs):
+ sep = kwargs.get('sep', ' ')
+ end = kwargs.get('end', '\n')
+ out = kwargs.get('file', sys.stdout)
+ out.write(sep.join(objects) + end)
+
+
rstfmt=False
ctypes = {
@@ -150,11 +160,11 @@
def err(str, warn=True):
if opts.strict or not warn:
- print("ERROR: " + str, file = sys.stderr)
+ _print("ERROR: " + str, file = sys.stderr)
exit(1)
raise FormatError(str, "")
else:
- print("WARNING: " + str, file = sys.stderr)
+ _print("WARNING: " + str, file = sys.stderr)
def fmt_cstruct(fo, mn, x):
a = "\ttd_" + mn + "_" + x
@@ -359,7 +369,7 @@
self.parse()
def dump(self):
- print(type(self), self.line)
+ _print(type(self), self.line)
def rstfile(self, fo, man):
if self.rstlbl != None:
@@ -866,7 +876,7 @@
if not i_vcc:
i_vcc = "vmod.vcc"
else:
- print("ERROR: No vmod.vcc file supplied or found.",
+ _print("ERROR: No vmod.vcc file supplied or found.",
file=sys.stderr)
oparser.print_help()
exit(-1)

View File

@ -1,63 +0,0 @@
Patch from upstream
commit dbcbae227b757043651ee1e7d1cc729727f94c8d
Author: Poul-Henning Kamp <phk@FreeBSD.org>
Date: Wed Sep 21 06:22:55 2016 +0000
Do not insist the H2 connection preface arrives in a single packet.
Fixes: #2094
Fixes: #2096
diff --git a/bin/varnishd/http1/cache_http1_proto.c b/bin/varnishd/http1/cache_http1_proto.c
index b5273c6..e788ed6 100644
--- a/bin/varnishd/http1/cache_http1_proto.c
+++ b/bin/varnishd/http1/cache_http1_proto.c
@@ -46,6 +46,8 @@
#include "config.h"
#include "cache/cache.h"
+#include "cache/cache_transport.h"
+
#include "cache_http1.h"
#include "vct.h"
@@ -66,6 +68,7 @@ enum htc_status_e __match_proto__(htc_complete_f)
HTTP1_Complete(struct http_conn *htc)
{
char *p;
+ enum htc_status_e retval;
CHECK_OBJ_NOTNULL(htc, HTTP_CONN_MAGIC);
@@ -78,6 +81,11 @@ HTTP1_Complete(struct http_conn *htc)
if (p == htc->rxbuf_e)
return (HTC_S_EMPTY);
+ /* Do not return a partial H2 connection preface */
+ retval = H2_prism_complete(htc);
+ if (retval != HTC_S_JUNK)
+ return (retval);
+
/*
* Here we just look for NL[CR]NL to see that reception
* is completed. More stringent validation happens later.
diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c
index 73d0c95..54b8a2e 100644
--- a/bin/varnishd/http2/cache_http2_proto.c
+++ b/bin/varnishd/http2/cache_http2_proto.c
@@ -474,10 +474,11 @@ H2_prism_complete(struct http_conn *htc)
CHECK_OBJ_NOTNULL(htc, HTTP_CONN_MAGIC);
l = htc->rxbuf_e - htc->rxbuf_b;
- if (l < strlen(H2_prism))
- return (HTC_S_MORE);
- if (!memcmp(htc->rxbuf_b, H2_prism, sizeof(H2_prism)))
+ if (l >= sizeof(H2_prism) &&
+ !memcmp(htc->rxbuf_b, H2_prism, sizeof(H2_prism)))
return (HTC_S_COMPLETE);
+ if (l < sizeof(H2_prism) && !memcmp(htc->rxbuf_b, H2_prism, l))
+ return (HTC_S_MORE);
return (HTC_S_JUNK);
}

View File

@ -1,21 +0,0 @@
--- configure.ac.orig 2017-03-18 02:06:01.568741182 +0100
+++ configure.ac 2017-03-18 02:09:17.808203587 +0100
@@ -209,7 +209,6 @@
# Support for visibility attribute
save_CFLAGS="${CFLAGS}"
-CFLAGS="${CFLAGS} -Werror"
AC_CACHE_CHECK([whether we have support for visibility attributes],
[ac_cv_have_viz],
@@ -535,10 +534,6 @@
AX_CHECK_COMPILE_FLAG([${SUNCC_CFLAGS}],
[CFLAGS="${CFLAGS} ${SUNCC_CFLAGS}"
OCFLAGS="${OCFLAGS} ${SUNCC_CFLAGS}"])
-else
- AX_CHECK_COMPILE_FLAG([-Werror],
- [CFLAGS="${CFLAGS} -Werror"
- OCFLAGS="${OCFLAGS} -Werror"])
fi
AX_CHECK_COMPILE_FLAG([-Werror=unused-result],

View File

@ -1,18 +0,0 @@
Index: bin/varnishd/cache_center.c
===================================================================
--- bin/varnishd/cache_center.c (revision 1912)
+++ bin/varnishd/cache_center.c (revision 1913)
@@ -524,7 +524,12 @@
*/
WSL(sp->wrk, SLT_Debug, sp->fd,
"on waiting list on obj %u", sp->obj->xid);
- assert(!isnan(sp->wrk->used));
+ /*
+ * There is a non-zero risk that we come here more than once
+ * before we get through, in that case cnt_recv must be set
+ */
+ if (isnan(sp->wrk->used))
+ sp->wrk->used = TIM_real();
SES_Charge(sp);
return (1);
}

View File

@ -1,12 +0,0 @@
diff -rup varnish-5.1.2.orig/bin/varnishd/http1/cache_http1_vfp.c varnish-5.1.2/bin/varnishd/http1/cache_http1_vfp.c
--- varnish-5.1.2.orig/bin/varnishd/http1/cache_http1_vfp.c 2017-08-02 22:43:30.137116214 +0200
+++ varnish-5.1.2/bin/varnishd/http1/cache_http1_vfp.c 2017-08-02 22:44:06.433218762 +0200
@@ -152,7 +152,7 @@ v1f_pull_chunked(struct vfp_ctx *vc, str
if (q == NULL || *q != '\0')
return (VFP_Error(vc, "chunked header number syntax"));
cl = (ssize_t)cll;
- if ((uintmax_t)cl != cll)
+ if (cl < 0 || (uintmax_t)cl != cll)
return (VFP_Error(vc, "bogusly large chunk size"));
vfe->priv2 = cl;

View File

@ -1,32 +0,0 @@
--- ../varnish-2.1.orig/man/vcl.7so
+++ man/vcl.7so
@@ -126,7 +126,6 @@ it's saintmode list
can be set to the maximum list size. Setting a value of 0 disables
saintmode checking entirely for that backend. The value in the backend
declaration overrides the parameter.
-
.Ss Directors
Directors choose from different backends based on health status and a
per-director algorithm.
--- ../varnish-2.1.orig/bin/varnishd/varnishd.1
+++ bin/varnishd/varnishd.1
@@ -173,6 +173,9 @@ to the specified
See
.Sx Run-Time Parameters
for a list of parameters.
+.It Fl S Ar file
+Path to a file containing a secret used for authorizing access to the
+management port.
.It Fl s Ar type Ns Xo
.Op , Ns Ar options
.Xc
--- ../varnish-2.1.orig/redhat/varnish.sysconfig
+++ ./redhat/varnish.sysconfig
@@ -38,6 +38,7 @@
-T localhost:6082 \
-f /etc/varnish/default.vcl \
-u varnish -g varnish \
+ -S /etc/varnish/secret \
-s file,/var/lib/varnish/varnish_storage.bin,1G"

View File

@ -1,277 +0,0 @@
diff -Naur ../varnish-2.1.4/redhat/varnish.initrc ./redhat/varnish.initrc
--- ../varnish-2.1.4/redhat/varnish.initrc 2010-11-04 13:57:41.208455907 +0100
+++ ./redhat/varnish.initrc 2010-11-04 14:00:14.516330982 +0100
@@ -1,6 +1,6 @@
#! /bin/sh
#
-# varnish Control the varnish HTTP accelerator
+# varnish Control the Varnish Cache
#
# chkconfig: - 90 10
# description: Varnish is a high-perfomance HTTP accelerator
@@ -26,6 +26,7 @@
pidfile=/var/run/varnish.pid
exec="/usr/sbin/varnishd"
+reload_exec="/usr/bin/varnish_reload_vcl"
prog="varnishd"
config="/etc/sysconfig/varnish"
lockfile="/var/lock/subsys/varnish"
@@ -47,7 +48,7 @@
echo $config not found
exit 6
fi
- echo -n "Starting varnish HTTP accelerator: "
+ echo -n "Starting Varnish Cache: "
# Open files (usually 1024, which is way too small for varnish)
ulimit -n ${NFILES:-131072}
@@ -79,7 +80,7 @@
}
stop() {
- echo -n "Stopping varnish HTTP accelerator: "
+ echo -n "Stopping Varnish Cache: "
killproc -p $pidfile $prog
retval=$?
echo
@@ -93,7 +94,12 @@
}
reload() {
- restart
+ if [ "$RELOAD_VCL" = "1" ]
+ then
+ $reload_exec
+ else
+ force_reload
+ fi
}
force_reload() {
diff -Naur ../varnish-2.1.4/redhat/varnish_reload_vcl ./redhat/varnish_reload_vcl
--- ../varnish-2.1.4/redhat/varnish_reload_vcl 1970-01-01 01:00:00.000000000 +0100
+++ ./redhat/varnish_reload_vcl 2010-11-04 13:58:14.708330664 +0100
@@ -0,0 +1,114 @@
+#!/bin/bash
+#
+# reload vcl revisited
+# A script that loads new vcl based on data from /etc/sysconfig/varnish
+# Ingvar Hagelund <ingvar@redpill-linpro.com>
+#
+# This is free software, distributed under the standard 2 clause BSD license,
+# see the LICENSE file in the Varnish documentation directory
+#
+# The following environment variables have to be set:
+# RELOAD_VCL, VARNISH_VCL_CONF, VARNISH_ADMIN_LISTEN_PORT
+# The following are optional:
+# VARNISH_SECRET_FILE, VARNISH_ADMIN_LISTEN_ADDRESS
+#
+# Requires GNU bash and GNU date
+#
+
+debug=false
+
+missing() {
+ echo "Missing configuration variable: $1"
+ exit 2
+}
+
+print_debug() {
+ echo "
+Parsed configuration:
+RELOAD_VCL=\"$RELOAD_VCL\"
+VARNISH_VCL_CONF=\"$VARNISH_VCL_CONF\"
+VARNISH_ADMIN_LISTEN_ADDRESS=\"$VARNISH_ADMIN_LISTEN_ADDRESS\"
+VARNISH_ADMIN_LISTEN_PORT=\"$VARNISH_ADMIN_LISTEN_PORT\"
+VARNISH_SECRET_FILE=\"$VARNISH_SECRET_FILE\"
+"
+}
+
+# Read configuration
+. /etc/sysconfig/varnish
+
+$debug && print_debug
+
+# Check configuration
+if [ ! "$RELOAD_VCL" = "1" ]; then
+ echo "Error: RELOAD_VCL is not set to 1"
+ exit 2
+
+elif [ -z "$VARNISH_VCL_CONF" ]; then
+ echo "Error: VARNISH_VCL_CONF is not set"
+ exit 2
+
+elif [ ! -s "$VARNISH_VCL_CONF" ]; then
+ echo "Eror: VCL config $VARNISH_VCL_CONF is unreadable or empty"
+ exit 2
+
+elif [ -z "$VARNISH_ADMIN_LISTEN_ADDRESS" ]; then
+ echo "Warning: VARNISH_ADMIN_LISTEN_ADDRESS is not set, using 127.0.0.1"
+ VARNISH_ADMIN_LISTEN_ADDRESS="127.0.0.1"
+
+elif [ -z "$VARNISH_ADMIN_LISTEN_PORT" ]; then
+ echo "Error: VARNISH_ADMIN_LISTEN_PORT is not set"
+ exit 2
+
+elif [ -z "$VARNISH_SECRET_FILE" ]; then
+ echo "Warning: VARNISH_SECRET_FILE is not set"
+ secret=""
+
+elif [ ! -s "$VARNISH_SECRET_FILE" ]; then
+ echo "Error: varnish secret file $VARNISH_SECRET_FILE is unreadable or empty"
+ exit 2
+else
+ secret="-S $VARNISH_SECRET_FILE"
+fi
+
+# Done parsing, set up command
+VARNISHADM="varnishadm $secret -T $VARNISH_ADMIN_LISTEN_ADDRESS:$VARNISH_ADMIN_LISTEN_PORT"
+
+# Now do the real work
+new_config="reload_$(date +%FT%H:%M:%S)"
+
+# Check if we are able to connect at all
+if $VARNISHADM vcl.list > /dev/null; then
+ $debug && echo vcl.list succeeded
+else
+ echo "Unable to run $VARNISHADM vcl.list"
+ exit 1
+fi
+
+if $VARNISHADM vcl.list | awk ' { print $3 } ' | grep -q $new_config; then
+ echo Trying to use new config $new_config, but that is already in use
+ exit 2
+fi
+
+current_config=$( $VARNISHADM vcl.list | awk ' /^active/ { print $3 } ' )
+
+echo "Loading vcl from $VARNISH_VCL_CONF"
+echo "Current running config name is $current_config"
+echo "Using new config name $new_config"
+
+if $VARNISHADM vcl.load $new_config $VARNISH_VCL_CONF; then
+ $debug && echo "$VARNISHADM vcl.load succeded"
+else
+ echo "$VARNISHADM vcl.load failed"
+ exit 1
+fi
+
+if $VARNISHADM vcl.use $new_config; then
+ $debug && echo "$VARNISHADM vcl.use succeded"
+else
+ echo "$VARNISHADM vcl.use failed"
+ exit 1
+fi
+$VARNISHADM vcl.list
+echo Done
+exit 0
+
diff -Naur ../varnish-2.1.4/redhat/varnish.sysconfig ./redhat/varnish.sysconfig
--- ../varnish-2.1.4/redhat/varnish.sysconfig 2010-10-21 10:57:22.000000000 +0200
+++ ./redhat/varnish.sysconfig 2010-11-04 13:59:34.293455974 +0100
@@ -14,6 +14,13 @@
# Maximum size of corefile (for ulimit -c). Default in Fedora is 0
# DAEMON_COREFILE_LIMIT="unlimited"
+# Set this to 1 to make init script reload try to switch vcl without restart.
+# To make this work, you need to set the following variables
+# explicit: VARNISH_VCL_CONF, VARNISH_ADMIN_LISTEN_ADDRESS,
+# VARNISH_ADMIN_LISTEN_PORT, VARNISH_SECRET_FILE, or in short,
+# use Alternative 3, Advanced configuration, below
+RELOAD_VCL=1
+
# This file contains 4 alternatives, please use only one.
## Alternative 1, Minimal configuration, no VCL
@@ -34,12 +41,12 @@
# one content server selected by the vcl file, based on the request. Use a
# fixed-size cache file.
#
-DAEMON_OPTS="-a :6081 \
- -T localhost:6082 \
- -f /etc/varnish/default.vcl \
- -u varnish -g varnish \
- -S /etc/varnish/secret \
- -s file,/var/lib/varnish/varnish_storage.bin,1G"
+#DAEMON_OPTS="-a :6081 \
+# -T localhost:6082 \
+# -f /etc/varnish/default.vcl \
+# -u varnish -g varnish \
+# -S /etc/varnish/secret \
+# -s file,/var/lib/varnish/varnish_storage.bin,1G"
## Alternative 3, Advanced configuration
@@ -47,49 +54,53 @@
# See varnishd(1) for more information.
#
# # Main configuration file. You probably want to change it :)
-# VARNISH_VCL_CONF=/etc/varnish/default.vcl
+VARNISH_VCL_CONF=/etc/varnish/default.vcl
#
# # Default address and port to bind to
# # Blank address means all IPv4 and IPv6 interfaces, otherwise specify
# # a host name, an IPv4 dotted quad, or an IPv6 address in brackets.
# VARNISH_LISTEN_ADDRESS=
-# VARNISH_LISTEN_PORT=6081
+VARNISH_LISTEN_PORT=6081
#
# # Telnet admin interface listen address and port
-# VARNISH_ADMIN_LISTEN_ADDRESS=127.0.0.1
-# VARNISH_ADMIN_LISTEN_PORT=6082
+VARNISH_ADMIN_LISTEN_ADDRESS=127.0.0.1
+VARNISH_ADMIN_LISTEN_PORT=6082
+#
+# # Shared secret file for admin interface
+VARNISH_SECRET_FILE=/etc/varnish/secret
#
# # The minimum number of worker threads to start
-# VARNISH_MIN_THREADS=1
+VARNISH_MIN_THREADS=1
#
# # The Maximum number of worker threads to start
-# VARNISH_MAX_THREADS=1000
+VARNISH_MAX_THREADS=1000
#
# # Idle timeout for worker threads
-# VARNISH_THREAD_TIMEOUT=120
+VARNISH_THREAD_TIMEOUT=120
#
# # Cache file location
-# VARNISH_STORAGE_FILE=/var/lib/varnish/varnish_storage.bin
+VARNISH_STORAGE_FILE=/var/lib/varnish/varnish_storage.bin
#
# # Cache file size: in bytes, optionally using k / M / G / T suffix,
# # or in percentage of available disk space using the % suffix.
-# VARNISH_STORAGE_SIZE=1G
+VARNISH_STORAGE_SIZE=1G
#
# # Backend storage specification
-# VARNISH_STORAGE="file,${VARNISH_STORAGE_FILE},${VARNISH_STORAGE_SIZE}"
+VARNISH_STORAGE="file,${VARNISH_STORAGE_FILE},${VARNISH_STORAGE_SIZE}"
#
# # Default TTL used when the backend does not specify one
-# VARNISH_TTL=120
+VARNISH_TTL=120
#
# # DAEMON_OPTS is used by the init script. If you add or remove options, make
# # sure you update this section, too.
-# DAEMON_OPTS="-a ${VARNISH_LISTEN_ADDRESS}:${VARNISH_LISTEN_PORT} \
-# -f ${VARNISH_VCL_CONF} \
-# -T ${VARNISH_ADMIN_LISTEN_ADDRESS}:${VARNISH_ADMIN_LISTEN_PORT} \
-# -t ${VARNISH_TTL} \
-# -w ${VARNISH_MIN_THREADS},${VARNISH_MAX_THREADS},${VARNISH_THREAD_TIMEOUT} \
-# -u varnish -g varnish \
-# -s ${VARNISH_STORAGE}"
+DAEMON_OPTS="-a ${VARNISH_LISTEN_ADDRESS}:${VARNISH_LISTEN_PORT} \
+ -f ${VARNISH_VCL_CONF} \
+ -T ${VARNISH_ADMIN_LISTEN_ADDRESS}:${VARNISH_ADMIN_LISTEN_PORT} \
+ -t ${VARNISH_TTL} \
+ -w ${VARNISH_MIN_THREADS},${VARNISH_MAX_THREADS},${VARNISH_THREAD_TIMEOUT} \
+ -u varnish -g varnish \
+ -S ${VARNISH_SECRET_FILE} \
+ -s ${VARNISH_STORAGE}"
#

View File

@ -1,9 +0,0 @@
--- doc/changes-2.0.5-2.0.6.xml.orig 2009-12-23 11:42:58.168643121 +0100
+++ doc/changes-2.0.5-2.0.6.xml 2009-12-23 11:43:05.827643574 +0100
@@ -49,5 +49,5 @@
<para>Document the <code>-C</code> option
to <code>varnishd</code>.</para>
</change>
- <subsystem>
+ </subsystem>
</group>

View File

@ -1,53 +0,0 @@
--- doc/changes-2.0.6-2.1.0.xml.orig 2010-04-14 15:16:12.308484148 +0200
+++ doc/changes-2.0.6-2.1.0.xml 2010-04-14 15:16:28.844484368 +0200
@@ -2,7 +2,7 @@
<!DOCTYPE group [
<!ENTITY mdash "&#8212;">
]>
-<!-- $Id: changes-2.0.6-2.1.0.xml 4641 2010-03-24 10:36:56Z tfheen $ -->
+<!-- $Id: changes-2.0.6-2.1.0.xml 4643 2010-03-24 12:41:53Z tfheen $ -->
<group from="2.0.6" to="2.1.0">
<subsystem>
<name>varnishd</name>
@@ -48,7 +48,7 @@
<para>When closing connections, we experimented with sending RST
to free up load balancers and free up threads more quickly.
This caused some problems with NAT routers and so has been
- reverted for now.
+ reverted for now.</para>
</change>
<change type="enh">
@@ -176,7 +176,7 @@
<change type="enh">
<para><code>purge.hash</code> is now deprecated and no longer
- shown in help listings.</code>.</para>
+ shown in help listings.</para>
</change>
<change type="enh" ref="607">
@@ -298,11 +298,19 @@
<para>Exit at the end of the file when started
with <code>-d</code>.</para>
</change>
+ </subsystem>
+ <subsystem>
+ <name>varnishadm</name>
-varnishadm:
- - timeout support
- - secret support
- - handle cli banner
+ <change type="enh">
+ <para><code>varnishadm</code> can now have a timeout when trying
+ to connect to the running <code>varnishd</code>.</para>
+ </change>
+ <change type="enh">
+ <para><code>varnishadm</code> now knows how to respond to the
+ secret from a secured <code>varnishd</code></para>
+ </change>
+ </subsystem>
</group>

View File

@ -1,13 +0,0 @@
diff -Naur ../varnish-2.0-beta1.orig/redhat/varnish.sysconfig ./redhat/varnish.sysconfig
--- ../varnish-2.0-beta1.orig/redhat/varnish.sysconfig 2008-06-18 12:59:41.000000000 +0200
+++ ./redhat/varnish.sysconfig 2008-09-02 14:50:51.000000000 +0200
@@ -11,6 +11,9 @@
# Default log size is 82MB + header
MEMLOCK=82000
+# Maximum size of corefile (for ulimit -c). Default in Fedora is 0
+# DAEMON_COREFILE_LIMIT="unlimited"
+
# This file contains 4 alternatives, please use only one.
## Alternative 1, Minimal configuration, no VCL

View File

@ -1,13 +0,0 @@
Index: bin/varnishtest/vtc_server.c
===================================================================
--- bin/varnishtest/vtc_server.c (revision 3155)
+++ bin/varnishtest/vtc_server.c (revision 3157)
@@ -97,7 +97,7 @@
vtc_log(vl, 3, "Accepted socket fd is %d", fd);
http_process(vl, s->spec, fd, 0);
vtc_log(vl, 3, "shutting fd %d", fd);
- AZ(shutdown(fd, SHUT_WR));
+ assert((shutdown(fd, SHUT_WR) == 0) || errno == ENOTCONN);
TCP_close(&fd);
}
vtc_log(vl, 2, "Ending");

View File

@ -1,85 +0,0 @@
Index: include/vrt.h
===================================================================
--- include/vrt.h (revisjon 3169)
+++ include/vrt.h (revisjon 3171)
@@ -154,6 +154,7 @@
/* Simple stuff */
int VRT_strcmp(const char *s1, const char *s2);
+void VRT_memmove(void *dst, const void *src, unsigned len);
void VRT_ESI(struct sess *sp);
void VRT_Rollback(struct sess *sp);
Index: lib/libvcl/vcc_fixed_token.c
===================================================================
--- lib/libvcl/vcc_fixed_token.c (revisjon 3169)
+++ lib/libvcl/vcc_fixed_token.c (revisjon 3171)
@@ -434,6 +434,7 @@
vsb_cat(sb, "\n");
vsb_cat(sb, "/* Simple stuff */\n");
vsb_cat(sb, "int VRT_strcmp(const char *s1, const char *s2);\n");
+ vsb_cat(sb, "void VRT_memmove(void *dst, const void *src, unsigned len);\n");
vsb_cat(sb, "\n");
vsb_cat(sb, "void VRT_ESI(struct sess *sp);\n");
vsb_cat(sb, "void VRT_Rollback(struct sess *sp);\n");
Index: lib/libvcl/vcc_acl.c
===================================================================
--- lib/libvcl/vcc_acl.c (revisjon 3169)
+++ lib/libvcl/vcc_acl.c (revisjon 3171)
@@ -328,23 +328,37 @@
int depth, l, m, i;
unsigned at[VRT_ACL_MAXADDR + 1];
const char *oc;
+ struct sockaddr sa;
Fh(tl, 0, "\nstatic int\n");
Fh(tl, 0, "match_acl_%s_%s(const struct sess *sp, const void *p)\n",
pfx, acln);
Fh(tl, 0, "{\n");
- Fh(tl, 0, "\tunsigned fam;\n");
Fh(tl, 0, "\tconst unsigned char *a;\n");
+ assert(sizeof (unsigned char) == 1);
+ assert(sizeof (unsigned short) == 2);
+ assert(sizeof (unsigned int) == 4);
+ if (sizeof sa.sa_family == 1)
+ Fh(tl, 0, "\tunsigned char fam;\n");
+ else if (sizeof sa.sa_family == 2)
+ Fh(tl, 0, "\tunsigned short fam;\n");
+ else if (sizeof sa.sa_family == 4)
+ Fh(tl, 0, "\tunsigned int fam;\n");
+ else
+ assert(0 == __LINE__);
+
Fh(tl, 0, "\n");
Fh(tl, 0, "\ta = p;\n");
- Fh(tl, 0, "\tfam = a[%d];\n", offsetof(struct sockaddr, sa_family));
+ Fh(tl, 0, "\tVRT_memmove(&fam, a + %d, sizeof fam);\n",
+ offsetof(struct sockaddr, sa_family));
Fh(tl, 0, "\tif (fam == %d)\n", PF_INET);
Fh(tl, 0, "\t\ta += %d;\n", offsetof(struct sockaddr_in, sin_addr));
Fh(tl, 0, "\telse if (fam == %d)\n", PF_INET6);
Fh(tl, 0, "\t\ta += %d;\n", offsetof(struct sockaddr_in6, sin6_addr));
- Fh(tl, 0, "\telse\n");
+ Fh(tl, 0, "\telse {\n");
+ Fh(tl, 0, "\t\tVRT_acl_log(sp, \"NO_FAM %s\");\n", acln);
Fh(tl, 0, "\t\treturn(0);\n");
- Fh(tl, 0, "\n");
+ Fh(tl, 0, "\t}\n\n");
depth = -1;
oc = 0;
at[0] = 256;
Index: bin/varnishd/cache_vrt.c
===================================================================
--- bin/varnishd/cache_vrt.c (revisjon 3169)
+++ bin/varnishd/cache_vrt.c (revisjon 3171)
@@ -726,3 +726,10 @@
return (strcmp(s1, s2));
}
+void
+VRT_memmove(void *dst, const void *src, unsigned len)
+{
+
+ (void)memmove(dst, src, len);
+}
+

View File

@ -1,46 +0,0 @@
Index: bin/varnishtest/tests/r00801.vtc
===================================================================
--- bin/varnishtest/tests/r00801.vtc (revisjon 0)
+++ bin/varnishtest/tests/r00801.vtc (revisjon 5461)
@@ -0,0 +1,24 @@
+# $Id$
+
+test "Regression test for duplicate content-length in pass"
+
+server s1 {
+ rxreq
+ txresp \
+ -hdr "Date: Mon, 25 Oct 2010 06:34:06 GMT" \
+ -hdr "Content-length: 10xx" \
+ -nolen -bodylen 10
+} -start
+
+
+varnish v1 -vcl+backend {
+ sub vcl_recv { return (pass); }
+} -start
+
+client c1 {
+ txreq
+ rxresp
+ expect resp.http.content-length == "10"
+} -run
+
+
Index: bin/varnishd/cache_fetch.c
===================================================================
--- bin/varnishd/cache_fetch.c (revisjon 5460)
+++ bin/varnishd/cache_fetch.c (revisjon 5461)
@@ -552,9 +552,11 @@
assert(uu == sp->obj->len);
}
- if (mklen > 0)
+ if (mklen > 0) {
+ http_Unset(sp->obj->http, H_Content_Length);
http_PrintfHeader(sp->wrk, sp->fd, sp->obj->http,
"Content-Length: %u", sp->obj->len);
+ }
if (http_HdrIs(hp, H_Connection, "close"))
cls = 1;

View File

@ -1,12 +0,0 @@
Index: redhat/varnish.initrc
===================================================================
--- redhat/varnish.initrc (revisjon 5498)
+++ redhat/varnish.initrc (arbeidskopi)
@@ -70,6 +70,7 @@
echo
else
echo_failure
+ echo
fi
return $retval
fi

View File

@ -1,36 +0,0 @@
diff -Naur ../varnish-2.1.4/redhat/varnish.initrc ./redhat/varnish.initrc
--- ../varnish-2.1.4/redhat/varnish.initrc 2010-10-21 10:57:22.000000000 +0200
+++ ./redhat/varnish.initrc 2010-11-03 15:20:07.663331341 +0100
@@ -12,6 +12,8 @@
# Provides: varnish
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
+# Default-Start:
+# Default-Stop:
# Should-Start: $syslog
# Short-Description: start and stop varnishd
# Description: Varnish is a high-perfomance HTTP accelerator
diff -Naur ../varnish-2.1.4/redhat/varnishlog.initrc ./redhat/varnishlog.initrc
--- ../varnish-2.1.4/redhat/varnishlog.initrc 2010-10-21 10:57:22.000000000 +0200
+++ ./redhat/varnishlog.initrc 2010-11-03 15:20:07.664330786 +0100
@@ -12,6 +12,8 @@
# Provides: varnishlog
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
+# Default-Start:
+# Default-Stop:
# Short-Description: start and stop varnishlog
# Description: Varnish HTTP accelerator logging daemon
### END INIT INFO
diff -Naur ../varnish-2.1.4/redhat/varnishncsa.initrc ./redhat/varnishncsa.initrc
--- ../varnish-2.1.4/redhat/varnishncsa.initrc 2010-10-21 10:57:22.000000000 +0200
+++ ./redhat/varnishncsa.initrc 2010-11-03 15:20:07.664330786 +0100
@@ -12,6 +12,8 @@
# Provides: varnishncsa
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
+# Default-Start:
+# Default-Stop:
# Short-Description: start and stop varnishncsa
# Description: Varnish HTTP accelerator logging daemon
### END INIT INFO

View File

@ -1,11 +0,0 @@
--- bin/varnishd/cache_ban.c.orig 2012-09-18 11:44:55.867165803 +0200
+++ bin/varnishd/cache_ban.c 2012-09-18 11:45:37.879300620 +0200
@@ -81,7 +81,7 @@
const void *arg2_spec;
};
-static VTAILQ_HEAD(banhead_s,ban) ban_head = VTAILQ_HEAD_INITIALIZER(ban_head);
+static volatile VTAILQ_HEAD(banhead_s,ban) ban_head = VTAILQ_HEAD_INITIALIZER(ban_head);
static struct lock ban_mtx;
static struct ban *ban_magic;
static pthread_t ban_thread;

View File

@ -1,15 +0,0 @@
Patch by Robert Scheck <robert@fedoraproject.org> for varnish >= 2.1, which adds the
missing (former implicit) linking to libm. And as implicit linking can be dangerous,
this changed, see: http://fedoraproject.org/wiki/Features/ChangeInImplicitDSOLinking
--- bin/varnishtest/Makefile.am 2010-03-24 10:44:13.000000000 +0100
+++ bin/varnishtest/Makefile.am.libm 2010-04-07 22:57:03.000000000 +0200
@@ -25,7 +25,7 @@
$(top_builddir)/lib/libvarnish/libvarnish.la \
$(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \
$(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
- ${PTHREAD_LIBS}
+ ${LIBM} ${PTHREAD_LIBS}
EXTRA_DIST = $(top_srcdir)/bin/varnishtest/tests/*.vtc \
$(top_srcdir)/bin/varnishtest/tests/README

View File

@ -1,170 +0,0 @@
diff -Naur ../varnish-2.1.1.orig/bin/varnishtest/tests/b00000.vtc ./bin/varnishtest/tests/b00000.vtc
--- ../varnish-2.1.1.orig/bin/varnishtest/tests/b00000.vtc 2010-04-26 10:50:52.000000000 +0200
+++ ./bin/varnishtest/tests/b00000.vtc 2010-04-30 10:58:57.199838479 +0200
@@ -9,7 +9,7 @@
txresp -body "012345\n"
} -start
-varnish v1 -arg "-smalloc,1m" -vcl+backend {} -start
+varnish v1 -storage "-smalloc,1m" -vcl+backend {} -start
varnish v1 -cliok "param.set diag_bitmap 0x2"
diff -Naur ../varnish-2.1.1.orig/bin/varnishtest/tests/p00000.vtc ./bin/varnishtest/tests/p00000.vtc
--- ../varnish-2.1.1.orig/bin/varnishtest/tests/p00000.vtc 2010-04-26 10:50:52.000000000 +0200
+++ ./bin/varnishtest/tests/p00000.vtc 2010-04-30 10:58:57.150839765 +0200
@@ -11,7 +11,8 @@
varnish v1 \
-arg "-pdiag_bitmap=0x20000" \
- -arg "-spersistent,${tmpdir}/_.per,10m" -vcl+backend { } -start
+ -storage "-spersistent,${tmpdir}/_.per,10m" \
+ -vcl+backend { } -start
varnish v1 -stop
diff -Naur ../varnish-2.1.1.orig/bin/varnishtest/tests/p00001.vtc ./bin/varnishtest/tests/p00001.vtc
--- ../varnish-2.1.1.orig/bin/varnishtest/tests/p00001.vtc 2010-04-26 10:50:52.000000000 +0200
+++ ./bin/varnishtest/tests/p00001.vtc 2010-04-30 11:05:26.478837801 +0200
@@ -11,7 +11,8 @@
varnish v1 \
-arg "-pdiag_bitmap=0x20000" \
- -arg "-spersistent,${tmpdir}/_.per,10m" -vcl+backend { } -start
+ -storage "-spersistent,${tmpdir}/_.per,10m" \
+ -vcl+backend { } -start
client c1 {
txreq -url "/"
diff -Naur ../varnish-2.1.1.orig/bin/varnishtest/tests/p00002.vtc ./bin/varnishtest/tests/p00002.vtc
--- ../varnish-2.1.1.orig/bin/varnishtest/tests/p00002.vtc 2010-04-26 10:50:52.000000000 +0200
+++ ./bin/varnishtest/tests/p00002.vtc 2010-04-30 10:58:57.151838730 +0200
@@ -11,8 +11,8 @@
varnish v1 \
-arg "-pdiag_bitmap=0x20000" \
- -arg "-spersistent,${tmpdir}/_.per1,10m" \
- -arg "-spersistent,${tmpdir}/_.per2,10m" \
+ -storage "-spersistent,${tmpdir}/_.per1,10m" \
+ -storage "-spersistent,${tmpdir}/_.per2,10m" \
-vcl+backend { } -start
client c1 {
diff -Naur ../varnish-2.1.1.orig/bin/varnishtest/tests/p00003.vtc ./bin/varnishtest/tests/p00003.vtc
--- ../varnish-2.1.1.orig/bin/varnishtest/tests/p00003.vtc 2010-04-26 10:50:52.000000000 +0200
+++ ./bin/varnishtest/tests/p00003.vtc 2010-04-30 11:06:28.054838375 +0200
@@ -11,7 +11,7 @@
varnish v1 \
-arg "-pdiag_bitmap=0x20000" \
- -arg "-spersistent,${tmpdir}/_.per,10m" \
+ -storage "-spersistent,${tmpdir}/_.per,10m" \
-vcl+backend { } -start
varnish v1 -cliok purge.list
diff -Naur ../varnish-2.1.1.orig/bin/varnishtest/tests/p00004.vtc ./bin/varnishtest/tests/p00004.vtc
--- ../varnish-2.1.1.orig/bin/varnishtest/tests/p00004.vtc 2010-04-26 10:50:52.000000000 +0200
+++ ./bin/varnishtest/tests/p00004.vtc 2010-04-30 11:03:35.717837935 +0200
@@ -13,7 +13,7 @@
varnish v1 \
-arg "-pdiag_bitmap=0x20000" \
- -arg "-spersistent,${tmpdir}/_.per,10m" \
+ -storage "-spersistent,${tmpdir}/_.per,10m" \
-vcl+backend { } -start
client c1 {
diff -Naur ../varnish-2.1.1.orig/bin/varnishtest/tests/p00005.vtc ./bin/varnishtest/tests/p00005.vtc
--- ../varnish-2.1.1.orig/bin/varnishtest/tests/p00005.vtc 2010-04-26 10:50:52.000000000 +0200
+++ ./bin/varnishtest/tests/p00005.vtc 2010-04-30 11:06:59.774838225 +0200
@@ -11,7 +11,7 @@
varnish v1 \
-arg "-pdiag_bitmap=0x30000" \
- -arg "-spersistent,${tmpdir}/_.per,10m" \
+ -storage "-spersistent,${tmpdir}/_.per,10m" \
-vcl+backend {
sub vcl_fetch {
set beresp.ttl = 3s;
diff -Naur ../varnish-2.1.1.orig/bin/varnishtest/tests/p00006.vtc ./bin/varnishtest/tests/p00006.vtc
--- ../varnish-2.1.1.orig/bin/varnishtest/tests/p00006.vtc 2010-04-26 10:50:52.000000000 +0200
+++ ./bin/varnishtest/tests/p00006.vtc 2010-04-30 11:04:20.310962837 +0200
@@ -13,7 +13,7 @@
varnish v1 \
- -arg "-spersistent,${tmpdir}/_.per,10m" \
+ -storage "-spersistent,${tmpdir}/_.per,10m" \
-vcl+backend { } -start
client c1 {
diff -Naur ../varnish-2.1.1.orig/bin/varnishtest/tests/v00010.vtc ./bin/varnishtest/tests/v00010.vtc
--- ../varnish-2.1.1.orig/bin/varnishtest/tests/v00010.vtc 2010-04-26 10:50:52.000000000 +0200
+++ ./bin/varnishtest/tests/v00010.vtc 2010-04-30 10:58:57.199838479 +0200
@@ -13,7 +13,7 @@
txresp -hdr "Foo: foo" -body "abcdef\n"
} -start
-varnish v1 -arg "-smalloc,1m" -vcl+backend {
+varnish v1 -storage "-smalloc,1m" -vcl+backend {
sub vcl_fetch {
if (beresp.http.panic) {
diff -Naur ../varnish-2.1.1.orig/bin/varnishtest/vtc_varnish.c ./bin/varnishtest/vtc_varnish.c
--- ../varnish-2.1.1.orig/bin/varnishtest/vtc_varnish.c 2010-04-26 10:50:52.000000000 +0200
+++ ./bin/varnishtest/vtc_varnish.c 2010-04-30 10:58:57.261838026 +0200
@@ -33,6 +33,7 @@
#include <stdio.h>
+#include <limits.h>
#include <ctype.h>
#include <fcntl.h>
#include <stdlib.h>
@@ -68,6 +69,8 @@
struct varnish_stats *stats;
+ struct vsb *storage;
+
struct vsb *args;
int fds[4];
pid_t pid;
@@ -171,9 +174,15 @@
vtc_log(v->vl, 0, "Varnish name must start with 'v'");
v->args = vsb_newauto();
+
+ v->storage = vsb_newauto();
+ vsb_printf(v->storage, "-sfile,%s,10M", v->workdir);
+ vsb_finish(v->storage);
+
v->cli_fd = -1;
VTAILQ_INSERT_TAIL(&varnishes, v, list);
+
return (v);
}
@@ -269,6 +278,7 @@
vsb_printf(vsb, " -S %s/_S", v->workdir);
vsb_printf(vsb, " -M %s:%s", abuf, pbuf);
vsb_printf(vsb, " -P %s/varnishd.pid", v->workdir);
+ vsb_printf(vsb, " %s", vsb_data(v->storage));
vsb_printf(vsb, " %s", vsb_data(v->args));
vsb_finish(vsb);
AZ(vsb_overflowed(vsb));
@@ -663,6 +673,13 @@
for (; *av != NULL; av++) {
if (vtc_error)
break;
+ if (!strcmp(*av, "-storage")) {
+ vsb_clear(v->storage);
+ vsb_cat(v->storage, av[1]);
+ vsb_finish(v->storage);
+ av++;
+ continue;
+ }
if (!strcmp(*av, "-arg")) {
AN(av[1]);
AZ(v->pid);

View File

@ -1,73 +0,0 @@
Index: configure.ac
===================================================================
--- configure.ac (revision 5691)
+++ configure.ac (working copy)
@@ -39,6 +39,13 @@
# Checks for libraries.
save_LIBS="${LIBS}"
LIBS=""
+AC_CHECK_LIB(jemalloc, malloc)
+RT_LIBS="${LIBS}"
+LIBS="${save_LIBS}"
+AC_SUBST(RT_LIBS)
+
+save_LIBS="${LIBS}"
+LIBS=""
AC_CHECK_LIB(rt, clock_gettime)
RT_LIBS="${LIBS}"
LIBS="${save_LIBS}"
@@ -423,25 +430,21 @@
AC_DEFINE_UNQUOTED([VCC_CC],"$VCC_CC",[C compiler command line for VCL code])
# Use jemalloc on Linux
-JEMALLOC_SUBDIR=
JEMALLOC_LDADD=
AC_ARG_ENABLE(jemalloc,
AS_HELP_STRING([--disable-jemalloc],[do not use jemalloc (default is yes on Linux, no everywhere else)]),
[if test "x$enableval" = "xyes"; then
- JEMALLOC_SUBDIR=libjemalloc
- JEMALLOC_LDADD='$(top_builddir)/lib/libjemalloc/libjemalloc_mt.la'
+ JEMALLOC_LDADD='-ljemalloc'
fi],
[case $target in #(
*-*-linux*)
- JEMALLOC_SUBDIR=libjemalloc
- JEMALLOC_LDADD='$(top_builddir)/lib/libjemalloc/libjemalloc_mt.la'
+ JEMALLOC_LDADD='-ljemalloc'
;; #(
*)
true
;;
esac])
-AC_SUBST(JEMALLOC_SUBDIR)
AC_SUBST(JEMALLOC_LDADD)
# Generate output
@@ -467,7 +470,6 @@
lib/libvarnishapi/Makefile
lib/libvarnishcompat/Makefile
lib/libvcl/Makefile
- lib/libjemalloc/Makefile
man/Makefile
redhat/Makefile
varnishapi.pc
Index: lib/Makefile.am
===================================================================
--- lib/Makefile.am (revision 5691)
+++ lib/Makefile.am (working copy)
@@ -4,12 +4,10 @@
libvarnishcompat \
libvarnish \
libvarnishapi \
- libvcl \
- @JEMALLOC_SUBDIR@
+ libvcl
DIST_SUBDIRS = \
libvarnishcompat \
libvarnish \
libvarnishapi \
- libvcl \
- libjemalloc
+ libvcl

View File

@ -1,24 +0,0 @@
diff -Naur ../varnish-2.0-beta1.orig/redhat/varnish.initrc ./redhat/varnish.initrc
--- ../varnish-2.0-beta1.orig/redhat/varnish.initrc 2008-08-27 09:45:40.000000000 +0200
+++ ./redhat/varnish.initrc 2008-08-29 22:52:23.000000000 +0200
@@ -31,8 +31,6 @@
# Include varnish defaults
[ -e /etc/sysconfig/varnish ] && . /etc/sysconfig/varnish
-lockfile=/var/lock/subsys/$prog
-
start() {
if [ ! -x $exec ]
diff -Naur ../varnish-2.0-beta1.orig/redhat/varnishlog.initrc ./redhat/varnishlog.initrc
--- ../varnish-2.0-beta1.orig/redhat/varnishlog.initrc 2008-08-27 09:45:40.000000000 +0200
+++ ./redhat/varnishlog.initrc 2008-08-29 22:53:30.000000000 +0200
@@ -32,8 +32,6 @@
# Include varnish defaults
[ -e /etc/sysconfig/varnishlog ] && . /etc/sysconfig/varnishlog
-lockfile=/var/lock/subsys/$prog
-
start() {
if [ ! -x $exec ]

View File

@ -1,13 +0,0 @@
--- lib/libvarnish/vre.c.orig 2012-08-28 23:56:02.163515172 +0200
+++ lib/libvarnish/vre.c 2012-08-28 23:56:18.111315730 +0200
@@ -40,9 +40,7 @@
pcre_extra *re_extra;
};
-#ifndef PCRE_STUDY_JIT_COMPILE
-#define PCRE_STUDY_JIT_COMPILE 0
-#endif
+#define PCRE_STUDY_JIT_COMPILE 0
/*
* We don't want to spread or even expose the majority of PCRE options

View File

@ -1,11 +0,0 @@
--- bin/varnishtest/tests/c00031.vtc.orig 2010-08-24 12:33:29.062232351 +0200
+++ bin/varnishtest/tests/c00031.vtc 2010-08-24 12:31:57.804150780 +0200
@@ -9,7 +9,7 @@
txresp
} -start
-varnish v1 -arg "-p thread_pool_stack=131072" -vcl+backend {} -start
+varnish v1 -arg "-p thread_pool_stack=262144" -vcl+backend {} -start
client c1 {
txreq -url "/"

View File

@ -1,24 +0,0 @@
diff -Naur ../varnish-2.0-beta2.orig/lib/libjemalloc/jemalloc_linux.c ./lib/libjemalloc/jemalloc_linux.c
--- ../varnish-2.0-beta2.orig/lib/libjemalloc/jemalloc_linux.c 2008-09-24 20:05:19.000000000 +0200
+++ ./lib/libjemalloc/jemalloc_linux.c 2008-10-06 14:13:28.950350627 +0200
@@ -257,7 +257,7 @@
# define NO_TLS
#endif
#ifdef __powerpc__
-# define PAGESIZE_2POW 12
+# define PAGESIZE_2POW 16
# define QUANTUM_2POW 4
# define SIZEOF_PTR_2POW 2
#endif
diff -Naur ../varnish-2.0-beta2.orig/lib/libjemalloc/malloc.c ./lib/libjemalloc/malloc.c
--- ../varnish-2.0-beta2.orig/lib/libjemalloc/malloc.c 2008-09-24 20:05:19.000000000 +0200
+++ ./lib/libjemalloc/malloc.c 2008-10-06 14:13:42.023005090 +0200
@@ -261,7 +261,7 @@
# define NO_TLS
#endif
#ifdef __powerpc__
-# define PAGESIZE_2POW 12
+# define PAGESIZE_2POW 16
# define QUANTUM_2POW 4
# define SIZEOF_PTR_2POW 2
#endif

View File

@ -1,15 +0,0 @@
diff -Naur ../varnish-2.1.2.orig/lib/libjemalloc/jemalloc_linux.c ./lib/libjemalloc/jemalloc_linux.c
--- ../varnish-2.1.2.orig/lib/libjemalloc/jemalloc_linux.c 2010-05-05 09:32:02.000000000 +0200
+++ ./lib/libjemalloc/jemalloc_linux.c 2010-07-29 15:39:00.221232248 +0200
@@ -273,6 +273,11 @@
# define QUANTUM_2POW 4
# define SIZEOF_PTR_2POW 2
#endif
+#ifdef __s390__
+# define PAGESIZE_2POW 12
+# define QUANTUM_2POW 4
+# define SIZEOF_PTR_2POW 2
+#endif
#ifdef __s390x__
# define PAGESIZE_2POW 12
# define QUANTUM_2POW 4

View File

@ -1,15 +0,0 @@
diff -Naur ../varnish-2.0.3.orig/lib/libjemalloc/jemalloc_linux.c ./lib/libjemalloc/jemalloc_linux.c
--- ../varnish-2.0.3.orig/lib/libjemalloc/jemalloc_linux.c 2009-02-12 12:15:24.000000000 +0100
+++ ./lib/libjemalloc/jemalloc_linux.c 2009-06-04 15:27:34.000000000 +0200
@@ -272,6 +272,11 @@
# define QUANTUM_2POW 4
# define SIZEOF_PTR_2POW 2
#endif
+#ifdef __s390x__
+# define PAGESIZE_2POW 12
+# define QUANTUM_2POW 4
+# define SIZEOF_PTR_2POW 3
+#endif
#define QUANTUM ((size_t)(1U << QUANTUM_2POW))
#define QUANTUM_MASK (QUANTUM - 1)

View File

@ -1,11 +0,0 @@
--- lib/libjemalloc/jemalloc_linux.c.old 2009-08-14 10:38:53.783906580 +0200
+++ lib/libjemalloc/jemalloc_linux.c 2009-08-14 10:39:04.215906982 +0200
@@ -243,7 +243,7 @@
# define SIZEOF_PTR_2POW 3
# define NO_TLS
#endif
-#ifdef __sparc64__
+#ifdef __sparc__
# define PAGESIZE_2POW 13
# define QUANTUM_2POW 4
# define SIZEOF_PTR_2POW 3

View File

@ -1,607 +0,0 @@
Index: include/libvarnish.h
===================================================================
--- include/libvarnish.h (revision 3417)
+++ include/libvarnish.h (working copy)
@@ -63,6 +63,7 @@
void TCP_name(const struct sockaddr *addr, unsigned l, char *abuf, unsigned alen, char *pbuf, unsigned plen);
int TCP_connect(int s, const struct sockaddr *name, socklen_t namelen, int msec);
void TCP_close(int *s);
+void TCP_set_read_timeout(int socket, double seconds);
#endif
/* from libvarnish/time.c */
Index: include/vrt_obj.h
===================================================================
--- include/vrt_obj.h (revision 3417)
+++ include/vrt_obj.h (working copy)
@@ -28,6 +28,12 @@
void VRT_l_bereq_url(const struct sess *, const char *, ...);
const char * VRT_r_bereq_proto(const struct sess *);
void VRT_l_bereq_proto(const struct sess *, const char *, ...);
+double VRT_r_bereq_connect_timeout(struct sess *);
+void VRT_l_bereq_connect_timeout(struct sess *, double);
+double VRT_r_bereq_first_byte_timeout(struct sess *);
+void VRT_l_bereq_first_byte_timeout(struct sess *, double);
+double VRT_r_bereq_between_bytes_timeout(struct sess *);
+void VRT_l_bereq_between_bytes_timeout(struct sess *, double);
const char * VRT_r_obj_proto(const struct sess *);
void VRT_l_obj_proto(const struct sess *, const char *, ...);
int VRT_r_obj_status(const struct sess *);
Index: include/vrt.h
===================================================================
--- include/vrt.h (revision 3417)
+++ include/vrt.h (working copy)
@@ -69,6 +69,8 @@
const unsigned char *ipv6_sockaddr;
double connect_timeout;
+ double first_byte_timeout;
+ double between_bytes_timeout;
unsigned max_connections;
struct vrt_backend_probe probe;
};
Index: lib/libvarnish/tcp.c
===================================================================
--- lib/libvarnish/tcp.c (revision 3417)
+++ lib/libvarnish/tcp.c (working copy)
@@ -47,6 +47,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <math.h>
#include "config.h"
#ifndef HAVE_STRLCPY
@@ -209,3 +210,16 @@
errno == ENOTCONN);
*s = -1;
}
+
+
+void
+TCP_set_read_timeout(int s, double seconds)
+{
+ struct timeval timeout;
+ timeout.tv_sec = floor(seconds);
+ timeout.tv_usec = 1e6 * (seconds - timeout.tv_sec);
+#ifdef SO_RCVTIMEO_WORKS
+ AZ(setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof timeout));
+#endif
+}
+
Index: lib/libvcl/vcc_gen_obj.tcl
===================================================================
--- lib/libvcl/vcc_gen_obj.tcl (revision 3417)
+++ lib/libvcl/vcc_gen_obj.tcl (working copy)
@@ -127,6 +127,22 @@
{ pipe pass miss fetch }
"const struct sess *"
}
+ { bereq.connect_timeout
+ RW TIME
+ { pass miss }
+ "struct sess *"
+ }
+ { bereq.first_byte_timeout
+ RW TIME
+ { pass miss }
+ "struct sess *"
+ }
+ { bereq.between_bytes_timeout
+ RW TIME
+ { pass miss }
+ "struct sess *"
+ }
+
# The (possibly) cached object
{ obj.proto
Index: lib/libvcl/vcc_obj.c
===================================================================
--- lib/libvcl/vcc_obj.c (revision 3417)
+++ lib/libvcl/vcc_obj.c (working copy)
@@ -123,6 +123,27 @@
"HDR_BEREQ",
VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_MISS | VCL_MET_FETCH
},
+ { "bereq.connect_timeout", TIME, 21,
+ "VRT_r_bereq_connect_timeout(sp)",
+ "VRT_l_bereq_connect_timeout(sp, ",
+ V_RW,
+ 0,
+ VCL_MET_PASS | VCL_MET_MISS
+ },
+ { "bereq.first_byte_timeout", TIME, 24,
+ "VRT_r_bereq_first_byte_timeout(sp)",
+ "VRT_l_bereq_first_byte_timeout(sp, ",
+ V_RW,
+ 0,
+ VCL_MET_PASS | VCL_MET_MISS
+ },
+ { "bereq.between_bytes_timeout", TIME, 27,
+ "VRT_r_bereq_between_bytes_timeout(sp)",
+ "VRT_l_bereq_between_bytes_timeout(sp, ",
+ V_RW,
+ 0,
+ VCL_MET_PASS | VCL_MET_MISS
+ },
{ "obj.proto", STRING, 9,
"VRT_r_obj_proto(sp)",
"VRT_l_obj_proto(sp, ",
Index: lib/libvcl/vcc_backend.c
===================================================================
--- lib/libvcl/vcc_backend.c (revision 3417)
+++ lib/libvcl/vcc_backend.c (working copy)
@@ -481,6 +481,8 @@
"?port",
"?host_header",
"?connect_timeout",
+ "?first_byte_timeout",
+ "?between_bytes_timeout",
"?probe",
"?max_connections",
NULL);
@@ -545,6 +547,20 @@
Fb(tl, 0, ",\n");
ExpectErr(tl, ';');
vcc_NextToken(tl);
+ } else if (vcc_IdIs(t_field, "first_byte_timeout")) {
+ Fb(tl, 0, "\t.first_byte_timeout = ");
+ vcc_TimeVal(tl);
+ ERRCHK(tl);
+ Fb(tl, 0, ",\n");
+ ExpectErr(tl, ';');
+ vcc_NextToken(tl);
+ } else if (vcc_IdIs(t_field, "between_bytes_timeout")) {
+ Fb(tl, 0, "\t.between_bytes_timeout = ");
+ vcc_TimeVal(tl);
+ ERRCHK(tl);
+ Fb(tl, 0, ",\n");
+ ExpectErr(tl, ';');
+ vcc_NextToken(tl);
} else if (vcc_IdIs(t_field, "max_connections")) {
u = vcc_UintVal(tl);
vcc_NextToken(tl);
Index: lib/libvcl/vcc_fixed_token.c
===================================================================
--- lib/libvcl/vcc_fixed_token.c (revision 3417)
+++ lib/libvcl/vcc_fixed_token.c (working copy)
@@ -349,6 +349,8 @@
vsb_cat(sb, " const unsigned char *ipv6_sockaddr;\n");
vsb_cat(sb, "\n");
vsb_cat(sb, " double connect_timeout;\n");
+ vsb_cat(sb, " double first_byte_timeout;\n");
+ vsb_cat(sb, " double between_bytes_timeout;\n");
vsb_cat(sb, " unsigned max_connections;\n");
vsb_cat(sb, " struct vrt_backend_probe probe;\n");
vsb_cat(sb, "};\n");
@@ -488,6 +490,12 @@
vsb_cat(sb, "void VRT_l_bereq_url(const struct sess *, const char *, ...);\n");
vsb_cat(sb, "const char * VRT_r_bereq_proto(const struct sess *);\n");
vsb_cat(sb, "void VRT_l_bereq_proto(const struct sess *, const char *, ...);\n");
+ vsb_cat(sb, "double VRT_r_bereq_connect_timeout(struct sess *);\n");
+ vsb_cat(sb, "void VRT_l_bereq_connect_timeout(struct sess *, double);\n");
+ vsb_cat(sb, "double VRT_r_bereq_first_byte_timeout(struct sess *);\n");
+ vsb_cat(sb, "void VRT_l_bereq_first_byte_timeout(struct sess *, double);\n");
+ vsb_cat(sb, "double VRT_r_bereq_between_bytes_timeout(struct sess *);\n");
+ vsb_cat(sb, "void VRT_l_bereq_between_bytes_timeout(struct sess *, double);\n");
vsb_cat(sb, "const char * VRT_r_obj_proto(const struct sess *);\n");
vsb_cat(sb, "void VRT_l_obj_proto(const struct sess *, const char *, ...);\n");
vsb_cat(sb, "int VRT_r_obj_status(const struct sess *);\n");
Index: bin/varnishd/mgt_param.c
===================================================================
--- bin/varnishd/mgt_param.c (revision 3417)
+++ bin/varnishd/mgt_param.c (working copy)
@@ -98,6 +98,24 @@
cli_out(cli, "%u", *dst);
}
+static void
+tweak_generic_timeout_double(struct cli *cli, volatile double *dst, const char *arg)
+{
+ double u;
+
+ if (arg != NULL) {
+ u = strtod(arg, NULL);
+ if (u < 0) {
+ cli_out(cli, "Timeout must be greater or equal to zero\n");
+ cli_result(cli, CLIS_PARAM);
+ return;
+ }
+ *dst = u;
+ } else
+ cli_out(cli, "%f", *dst);
+}
+
+
/*--------------------------------------------------------------------*/
static void
@@ -109,7 +127,15 @@
tweak_generic_timeout(cli, dest, arg);
}
+static void
+tweak_timeout_double(struct cli *cli, const struct parspec *par, const char *arg)
+{
+ volatile double *dest;
+ dest = par->priv;
+ tweak_generic_timeout_double(cli, dest, arg);
+}
+
/*--------------------------------------------------------------------*/
static void
@@ -739,14 +765,33 @@
"Cache vbe_conn's or rely on malloc, that's the question.",
EXPERIMENTAL,
"off", "bool" },
- { "connect_timeout", tweak_uint,
+ { "connect_timeout", tweak_timeout_double,
&master.connect_timeout,0, UINT_MAX,
- "Default connection timeout for backend connections. "
+ "Default connection timeout for backend connections. "
"We only try to connect to the backend for this many "
- "milliseconds before giving up. "
- "VCL can override this default value for each backend.",
+ "seconds before giving up. "
+ "VCL can override this default value for each backend "
+ "and backend request.",
0,
- "400", "ms" },
+ "0.4", "s" },
+ { "first_byte_timeout", tweak_timeout_double,
+ &master.first_byte_timeout,0, UINT_MAX,
+ "Default timeout for receiving first byte from backend. "
+ "We only wait for this many seconds for the first "
+ "byte before giving up. A value of 0 means it will never time out. "
+ "VCL can override this default value for each backend and"
+ "backend request. This parameter does not apply to pipe.",
+ 0,
+ "60", "s" },
+ { "between_bytes_timeout", tweak_timeout_double,
+ &master.between_bytes_timeout,0, UINT_MAX,
+ "Default timeout between bytes when receiving data from backend. "
+ "We only wait for this many seconds between bytes "
+ "before giving up. A value of 0 means it will never time out. "
+ "VCL can override this default value for each backend and "
+ "backend request. This parameter does not apply to pipe.",
+ 0,
+ "60", "s" },
{ "accept_fd_holdoff", tweak_timeout,
&master.accept_fd_holdoff, 0, 3600*1000,
"If we run out of file descriptors, the accept thread will "
Index: bin/varnishd/cache_backend_cfg.c
===================================================================
--- bin/varnishd/cache_backend_cfg.c (revision 3417)
+++ bin/varnishd/cache_backend_cfg.c (working copy)
@@ -222,6 +222,8 @@
REPLACE(b->hosthdr, vb->hosthdr);
b->connect_timeout = vb->connect_timeout;
+ b->first_byte_timeout = vb->first_byte_timeout;
+ b->between_bytes_timeout = vb->between_bytes_timeout;
b->max_conn = vb->max_connections;
/*
Index: bin/varnishd/varnishd.1
===================================================================
--- bin/varnishd/varnishd.1 (revision 3417)
+++ bin/varnishd/varnishd.1 (working copy)
@@ -387,6 +387,15 @@
.Pp
The default is
.Dv off .
+.It Va between_bytes_timeout
+Default timeout between bytes when receiving data from backend.
+We only wait for this many seconds between bytes before giving up.
+A value of 0 means it will never time out.
+VCL can override this default value for each backend and backend request.
+This parameter does not apply to pipe.
+.Pp
+The default is
+.Dv 60 seconds
.It Va client_http11
Whether to force the use of HTTP/1.1 when responding to client
requests, or just use the same protocol version as that used by the
@@ -394,6 +403,13 @@
.Pp
The default is
.Dv off .
+.It Va connect_timeout
+Default connection timeout for backend connections.
+We only try to connect to the backend for this many seconds before giving up.
+VCL can override this default value for each backend and backend request.
+.Pp
+The default is
+.Dv 0.4 seconds
.It Va default_ttl
The default time-to-live assigned to objects if neither the backend
nor the configuration assign one.
@@ -409,6 +425,15 @@
backend server does not specify a content length.
.Pp
The default is 128 kilobytes.
+.It Va first_byte_timeout
+Default timeout for receiving first byte from backend.
+We only wait for this many seconds for the first byte before giving up.
+A value of 0 means it will never time out.
+VCL can override this default value for each backend and backend request.
+This parameter does not apply to pipe.
+.Pp
+The default is
+.Dv 60 seconds
.It Va group
The name of an unprivileged group to which the child process should
switch before it starts accepting connections.
Index: bin/varnishd/cache_backend.c
===================================================================
--- bin/varnishd/cache_backend.c (revision 3417)
+++ bin/varnishd/cache_backend.c (working copy)
@@ -94,7 +94,7 @@
if (s < 0)
return (s);
- tmo = params->connect_timeout;
+ tmo = (int)(sp->connect_timeout * 1000);
if (bp->connect_timeout > 10e-3)
tmo = (int)(bp->connect_timeout * 1000);
Index: bin/varnishd/cache_fetch.c
===================================================================
--- bin/varnishd/cache_fetch.c (revision 3417)
+++ bin/varnishd/cache_fetch.c (working copy)
@@ -336,6 +336,8 @@
if (sp->vbe == NULL)
return (__LINE__);
vc = sp->vbe;
+ /* Inherit the backend timeouts from the selected backend */
+ SES_InheritBackendTimeouts(sp);
/*
* Now that we know our backend, we can set a default Host:
@@ -369,8 +371,12 @@
VSL_stats->backend_req++;
HTC_Init(htc, bereq->ws, vc->fd);
- do
- i = HTC_Rx(htc);
+ TCP_set_read_timeout(vc->fd, sp->first_byte_timeout);
+ do {
+ i = HTC_Rx(htc);
+ TCP_set_read_timeout(vc->fd, sp->between_bytes_timeout);
+ }
+
while (i == 0);
if (i < 0) {
Index: bin/varnishd/cache_backend.h
===================================================================
--- bin/varnishd/cache_backend.h (revision 3417)
+++ bin/varnishd/cache_backend.h (working copy)
@@ -104,6 +104,8 @@
char *ident;
char *vcl_name;
double connect_timeout;
+ double first_byte_timeout;
+ double between_bytes_timeout;
uint32_t hash;
Index: bin/varnishd/cache_vrt.c
===================================================================
--- bin/varnishd/cache_vrt.c (revision 3417)
+++ bin/varnishd/cache_vrt.c (working copy)
@@ -288,6 +288,49 @@
return (atoi(sp->http->hd[HTTP_HDR_STATUS].b));
}
+void
+VRT_l_bereq_connect_timeout(struct sess *sp, double num)
+{
+ CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
+ sp->connect_timeout = (num > 0 ? num : 0);
+}
+
+double
+VRT_r_bereq_connect_timeout(struct sess *sp)
+{
+ CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
+ return sp->connect_timeout;
+}
+
+void
+VRT_l_bereq_first_byte_timeout(struct sess *sp, double num)
+{
+ CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
+ sp->first_byte_timeout = (num > 0 ? num : 0);
+}
+
+double
+VRT_r_bereq_first_byte_timeout(struct sess *sp)
+{
+ CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
+ return sp->first_byte_timeout;
+}
+
+void
+VRT_l_bereq_between_bytes_timeout(struct sess *sp, double num)
+{
+ CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
+ sp->between_bytes_timeout = (num > 0 ? num : 0);
+}
+
+double
+VRT_r_bereq_between_bytes_timeout(struct sess *sp)
+{
+ CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
+ return sp->between_bytes_timeout;
+}
+
+
/*--------------------------------------------------------------------*/
void
Index: bin/varnishd/cache_center.c
===================================================================
--- bin/varnishd/cache_center.c (revision 3417)
+++ bin/varnishd/cache_center.c (working copy)
@@ -851,6 +851,8 @@
CHECK_OBJ_NOTNULL(sp->vcl, VCL_CONF_MAGIC);
AZ(sp->obj);
+ SES_ResetBackendTimeouts(sp);
+
/* By default we use the first backend */
AZ(sp->director);
sp->director = sp->vcl->director[0];
Index: bin/varnishd/cache_session.c
===================================================================
--- bin/varnishd/cache_session.c (revision 3417)
+++ bin/varnishd/cache_session.c (working copy)
@@ -58,6 +58,7 @@
#include "shmlog.h"
#include "cache.h"
+#include "cache_backend.h"
/*--------------------------------------------------------------------*/
@@ -316,6 +317,8 @@
sp->http = &sm->http[0];
sp->http0 = &sm->http[1];
+ SES_ResetBackendTimeouts(sp);
+
return (sp);
}
@@ -367,3 +370,37 @@
MTX_INIT(&stat_mtx);
MTX_INIT(&ses_mem_mtx);
}
+
+void
+SES_ResetBackendTimeouts(struct sess *sp)
+{
+ sp->connect_timeout = params->connect_timeout;
+ sp->first_byte_timeout = params->first_byte_timeout;
+ sp->between_bytes_timeout = params->between_bytes_timeout;
+}
+
+void
+SES_InheritBackendTimeouts(struct sess *sp)
+{
+ struct backend *be = NULL;
+
+ AN(sp);
+ AN(sp->vbe);
+ AN(sp->vbe->backend);
+
+ be = sp->vbe->backend;
+ /*
+ * We only inherit the backend's timeout if the session timeout
+ * has not already been set in the VCL, as the order of precedence
+ * is parameter < backend definition < VCL.
+ */
+ if (be->connect_timeout > 1e-3 &&
+ sp->connect_timeout == params->connect_timeout)
+ sp->connect_timeout = be->connect_timeout;
+ if (be->first_byte_timeout > 1e-3 &&
+ sp->first_byte_timeout == params->first_byte_timeout)
+ sp->first_byte_timeout = be->first_byte_timeout;
+ if (be->between_bytes_timeout > 1e-3
+ && sp->between_bytes_timeout == params->between_bytes_timeout)
+ sp->between_bytes_timeout = be->between_bytes_timeout;
+}
Index: bin/varnishd/cache.h
===================================================================
--- bin/varnishd/cache.h (revision 3417)
+++ bin/varnishd/cache.h (working copy)
@@ -344,6 +344,12 @@
double t_resp;
double t_end;
+ /* Timeouts */
+ double connect_timeout;
+ double first_byte_timeout;
+ double between_bytes_timeout;
+
+
/* Acceptable grace period */
double grace;
@@ -529,6 +535,8 @@
void SES_Delete(struct sess *sp);
void SES_RefSrcAddr(struct sess *sp);
void SES_Charge(struct sess *sp);
+void SES_ResetBackendTimeouts(struct sess *sp);
+void SES_InheritBackendTimeouts(struct sess *sp);
/* cache_shmlog.c */
void VSL_Init(void);
Index: bin/varnishd/heritage.h
===================================================================
--- bin/varnishd/heritage.h (revision 3417)
+++ bin/varnishd/heritage.h (working copy)
@@ -154,8 +154,12 @@
unsigned cache_vbe_conns;
/* Default connection_timeout */
- unsigned connect_timeout;
+ double connect_timeout;
+ /* Read timeouts for backend */
+ double first_byte_timeout;
+ double between_bytes_timeout;
+
/* How long to linger on sessions */
unsigned session_linger;
Index: man/vcl.7so
===================================================================
--- man/vcl.7so (revision 3417)
+++ man/vcl.7so (working copy)
@@ -92,6 +92,26 @@
set req.backend = www;
}
.Ed
+.Pp
+The timeout parameters can be overridden in the backend declaration.
+The timeout parameters are
+.Fa .connect_timeout
+for the time to wait for a backend connection,
+.Fa .first_byte_timeout
+for the time to wait for the first byte from the backend and
+.Fa .between_bytes_timeout
+for time to wait between each received byte.
+.Pp
+These can be set in the declaration like this:
+.Bd -literal -offset 4n
+backend www {
+ .host = "www.example.com";
+ .port = "http";
+ .connect_timeout = 1s;
+ .first_byte_timeout = 5s;
+ .between_bytes_timeout = 2s;
+}
+.Ed
.Ss Directors
Directors choose from different backends based on health status and a
per-director algorithm.
@@ -484,6 +504,14 @@
.It Va req.http. Ns Ar header
The corresponding HTTP
.Ar header .
+.It Va bereq.connect_timeout
+The time in seconds to wait for a backend connection.
+.It Va bereq.first_byte_timeout
+The time in seconds to wait for the first byte from the backend.
+Not available in pipe mode.
+.It Va bereq.between_bytes_timeout
+The time in seconds to wait between each received byte from the backend.
+Not available in pipe mode.
.El
.Pp
The following variables are available while preparing a backend

View File

@ -1,13 +0,0 @@
Index: bin/varnishtest/tests/v00002.vtc
===================================================================
--- bin/varnishtest/tests/v00002.vtc (revision 4730)
+++ bin/varnishtest/tests/v00002.vtc (revision 4731)
@@ -114,7 +114,7 @@
varnish v1 -badvcl {
/* too many IP numbers */
- backend b1 { .host = "cnn.com"; }
+ backend b1 { .host = "v00002.freebsd.dk"; }
}
varnish v1 -badvcl {

View File

@ -1,23 +0,0 @@
diff -Naur ../varnish-2.0.2.orig/bin/varnishtest/Makefile.am ./bin/varnishtest/Makefile.am
--- ../varnish-2.0.2.orig/bin/varnishtest/Makefile.am 2008-11-14 13:24:08.000000000 +0100
+++ ./bin/varnishtest/Makefile.am 2008-11-17 13:40:05.964237951 +0100
@@ -1,6 +1,6 @@
# $Id: Makefile.am 3374 2008-11-10 10:12:28Z tfheen $
-TESTS_ENVIRONMENT = ./varnishtest
+TESTS_ENVIRONMENT = ./varnishtest -v
TESTS = $(srcdir)/tests/*.vtc
DISTCLEANFILES = _.ok
diff -Naur ../varnish-2.0.2.orig/bin/varnishtest/Makefile.in ./bin/varnishtest/Makefile.in
--- ../varnish-2.0.2.orig/bin/varnishtest/Makefile.in 2008-11-14 13:59:33.000000000 +0100
+++ ./bin/varnishtest/Makefile.in 2008-11-17 13:40:51.503384938 +0100
@@ -204,7 +204,7 @@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
varnishconfdir = @varnishconfdir@
-TESTS_ENVIRONMENT = ./varnishtest
+TESTS_ENVIRONMENT = ./varnishtest -v
TESTS = $(srcdir)/tests/*.vtc
DISTCLEANFILES = _.ok
INCLUDES = -I$(top_srcdir)/include

View File

@ -1,781 +0,0 @@
diff -Naur ../varnish-2.0-rc1/bin/varnishtest/Makefile.in bin/varnishtest/Makefile.in
--- ../varnish-2.0-rc1/bin/varnishtest/Makefile.in 2008-10-08 13:39:45.000000000 +0200
+++ bin/varnishtest/Makefile.in 2008-10-09 20:05:13.000000000 +0200
@@ -96,7 +96,6 @@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DL_LIBS = @DL_LIBS@
-DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
@@ -123,7 +122,6 @@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NET_LIBS = @NET_LIBS@
-NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
diff -Naur ../varnish-2.0-rc1/bin/varnishtest/tests/a00008.vtc bin/varnishtest/tests/a00008.vtc
--- ../varnish-2.0-rc1/bin/varnishtest/tests/a00008.vtc 2008-10-08 13:18:24.000000000 +0200
+++ bin/varnishtest/tests/a00008.vtc 2008-10-09 13:49:15.000000000 +0200
@@ -1,4 +1,4 @@
-# $Id: a00008.vtc 3012 2008-07-24 12:22:35Z des $
+# $Id: a00008.vtc 3272 2008-10-09 11:39:24Z phk $
test "Sema operations"
diff -Naur ../varnish-2.0-rc1/bin/varnishtest/vtc.c bin/varnishtest/vtc.c
--- ../varnish-2.0-rc1/bin/varnishtest/vtc.c 2008-10-08 13:18:24.000000000 +0200
+++ bin/varnishtest/vtc.c 2008-10-09 13:49:16.000000000 +0200
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: vtc.c 3243 2008-10-05 10:22:21Z phk $
+ * $Id: vtc.c 3272 2008-10-09 11:39:24Z phk $
*/
#include <stdio.h>
@@ -41,7 +41,8 @@
#define MAX_FILESIZE (1024 * 1024)
#define MAX_TOKENS 100
-static struct vtclog *vl;
+const char *vtc_file;
+char *vtc_desc;
/**********************************************************************
* Read a file into memory
@@ -80,7 +81,7 @@
*/
void
-parse_string(char *buf, const struct cmds *cmd, void *priv)
+parse_string(char *buf, const struct cmds *cmd, void *priv, struct vtclog *vl)
{
char *token_s[MAX_TOKENS], *token_e[MAX_TOKENS];
char *p, *q;
@@ -183,7 +184,7 @@
}
assert(cp->cmd != NULL);
- cp->cmd(token_s, priv, cmd);
+ cp->cmd(token_s, priv, cmd, vl);
}
}
@@ -196,7 +197,7 @@
{
for (; cmd->name != NULL; cmd++)
- cmd->cmd(NULL, NULL, NULL);
+ cmd->cmd(NULL, NULL, NULL, NULL);
}
/**********************************************************************
@@ -209,6 +210,7 @@
(void)priv;
(void)cmd;
+ (void)vl;
if (av == NULL)
return;
@@ -216,6 +218,7 @@
printf("# TEST %s\n", av[1]);
AZ(av[2]);
+ vtc_desc = strdup(av[1]);
}
/**********************************************************************
@@ -270,6 +273,7 @@
{
(void)cmd;
+ (void)vl;
if (av == NULL)
return;
printf("cmd_dump(%p)\n", priv);
@@ -293,16 +297,20 @@
};
static void
-exec_file(const char *fn)
+exec_file(const char *fn, struct vtclog *vl)
{
char *buf;
- printf("# TEST %s starting\n", fn);
+ vtc_file = fn;
+ vtc_desc = NULL;
+ vtc_log(vl, 1, "TEST %s starting", fn);
buf = read_file(fn);
- parse_string(buf, cmds, NULL);
- printf("# RESETTING after %s\n", fn);
+ parse_string(buf, cmds, NULL, vl);
+ vtc_log(vl, 1, "RESETTING after %s", fn);
reset_cmds(cmds);
- printf("# TEST %s completed\n", fn);
+ vtc_log(vl, 1, "TEST %s completed", fn);
+ vtc_file = NULL;
+ free(vtc_desc);
}
/**********************************************************************
@@ -325,10 +333,11 @@
{
int ch;
FILE *fok;
+ static struct vtclog *vl;
setbuf(stdout, NULL);
setbuf(stderr, NULL);
- vl = vtc_logopen("");
+ vl = vtc_logopen("top");
AN(vl);
while ((ch = getopt(argc, argv, "qv")) != -1) {
switch (ch) {
@@ -350,7 +359,7 @@
init_sema();
for (ch = 0; ch < argc; ch++)
- exec_file(argv[ch]);
+ exec_file(argv[ch], vl);
fok = fopen("_.ok", "w");
if (fok != NULL)
fclose(fok);
diff -Naur ../varnish-2.0-rc1/bin/varnishtest/vtc_client.c bin/varnishtest/vtc_client.c
--- ../varnish-2.0-rc1/bin/varnishtest/vtc_client.c 2008-10-08 13:18:24.000000000 +0200
+++ bin/varnishtest/vtc_client.c 2008-10-09 13:49:16.000000000 +0200
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: vtc_client.c 3127 2008-08-26 07:51:12Z phk $
+ * $Id: vtc_client.c 3272 2008-10-09 11:39:24Z phk $
*/
#include <stdio.h>
@@ -51,7 +51,7 @@
char *spec;
- const char *connect;
+ char *connect;
pthread_t tp;
};
@@ -98,26 +98,42 @@
*/
static struct client *
-client_new(char *name)
+client_new(const char *name)
{
struct client *c;
+ AN(name);
ALLOC_OBJ(c, CLIENT_MAGIC);
AN(c);
- c->name = name;
+ REPLACE(c->name, name);
c->vl = vtc_logopen(name);
AN(c->vl);
- if (*name != 'c') {
+ if (*c->name != 'c')
vtc_log(c->vl, 0, "Client name must start with 'c'");
- exit (1);
- }
- c->connect = "127.0.0.1:9081";
+ REPLACE(c->connect, "127.0.0.1:9081");
VTAILQ_INSERT_TAIL(&clients, c, list);
return (c);
}
/**********************************************************************
+ * Clean up client
+ */
+
+static void
+client_delete(struct client *c)
+{
+
+ CHECK_OBJ_NOTNULL(c, CLIENT_MAGIC);
+ vtc_logclose(c->vl);
+ free(c->spec);
+ free(c->name);
+ free(c->connect);
+ /* XXX: MEMLEAK (?)*/
+ FREE_OBJ(c);
+}
+
+/**********************************************************************
* Start the client thread
*/
@@ -173,6 +189,7 @@
(void)priv;
(void)cmd;
+ (void)vl;
if (av == NULL) {
/* Reset and free */
@@ -180,8 +197,7 @@
VTAILQ_REMOVE(&clients, c, list);
if (c->tp != 0)
client_wait(c);
- FREE_OBJ(c);
- /* XXX: MEMLEAK */
+ client_delete(c);
}
return;
}
@@ -198,7 +214,7 @@
for (; *av != NULL; av++) {
if (!strcmp(*av, "-connect")) {
- c->connect = av[1];
+ REPLACE(c->connect, av[1]);
av++;
continue;
}
@@ -218,6 +234,6 @@
vtc_log(c->vl, 0, "Unknown client argument: %s", *av);
exit (1);
}
- c->spec = *av;
+ REPLACE(c->spec, *av);
}
}
diff -Naur ../varnish-2.0-rc1/bin/varnishtest/vtc.h bin/varnishtest/vtc.h
--- ../varnish-2.0-rc1/bin/varnishtest/vtc.h 2008-10-08 13:18:24.000000000 +0200
+++ bin/varnishtest/vtc.h 2008-10-09 13:49:15.000000000 +0200
@@ -23,14 +23,14 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: vtc.h 3244 2008-10-05 10:22:53Z phk $
+ * $Id: vtc.h 3272 2008-10-09 11:39:24Z phk $
*/
struct vsb;
struct vtclog;
struct cmds;
-#define CMD_ARGS char * const *av, void *priv, const struct cmds *cmd
+#define CMD_ARGS char * const *av, void *priv, const struct cmds *cmd, struct vtclog *vl
typedef void cmd_f(CMD_ARGS);
struct cmds {
@@ -38,7 +38,7 @@
cmd_f *cmd;
};
-void parse_string(char *buf, const struct cmds *cmd, void *priv);
+void parse_string(char *buf, const struct cmds *cmd, void *priv, struct vtclog *vl);
cmd_f cmd_dump;
cmd_f cmd_delay;
@@ -47,13 +47,17 @@
cmd_f cmd_varnish;
cmd_f cmd_sema;
+extern const char *vtc_file;
+extern char *vtc_desc;
+extern int vtc_verbosity;
+
void init_sema(void);
void http_process(struct vtclog *vl, const char *spec, int sock, int client);
void cmd_server_genvcl(struct vsb *vsb);
-extern int vtc_verbosity;
struct vtclog *vtc_logopen(const char *id);
+void vtc_logclose(struct vtclog *vl);
void vtc_log(struct vtclog *vl, unsigned lvl, const char *fmt, ...);
void vtc_dump(struct vtclog *vl, unsigned lvl, const char *pfx, const char *str);
diff -Naur ../varnish-2.0-rc1/bin/varnishtest/vtc_http.c bin/varnishtest/vtc_http.c
--- ../varnish-2.0-rc1/bin/varnishtest/vtc_http.c 2008-10-08 13:18:24.000000000 +0200
+++ bin/varnishtest/vtc_http.c 2008-10-09 13:49:16.000000000 +0200
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: vtc_http.c 3207 2008-09-21 06:47:37Z phk $
+ * $Id: vtc_http.c 3272 2008-10-09 11:39:24Z phk $
*/
@@ -70,7 +70,7 @@
* Generate a synthetic body
*/
-static const char *
+static char *
synth_body(const char *len)
{
int i, j, k, l;
@@ -185,6 +185,7 @@
char *rhs;
(void)cmd;
+ (void)vl;
CAST_OBJ_NOTNULL(hp, priv, HTTP_MAGIC);
assert(!strcmp(av[0], "expect"));
av++;
@@ -419,6 +420,7 @@
struct http *hp;
(void)cmd;
+ (void)vl;
CAST_OBJ_NOTNULL(hp, priv, HTTP_MAGIC);
AN(hp->client);
assert(!strcmp(av[0], "rxresp"));
@@ -445,9 +447,10 @@
const char *proto = "HTTP/1.1";
const char *status = "200";
const char *msg = "Ok";
- const char *body = NULL;
+ char *body = NULL;
(void)cmd;
+ (void)vl;
CAST_OBJ_NOTNULL(hp, priv, HTTP_MAGIC);
AZ(hp->client);
assert(!strcmp(av[0], "txresp"));
@@ -482,7 +485,7 @@
for(; *av != NULL; av++) {
if (!strcmp(*av, "-body")) {
AZ(body);
- body = av[1];
+ REPLACE(body, av[1]);
av++;
} else if (!strcmp(*av, "-bodylen")) {
AZ(body);
@@ -515,6 +518,7 @@
struct http *hp;
(void)cmd;
+ (void)vl;
CAST_OBJ_NOTNULL(hp, priv, HTTP_MAGIC);
AZ(hp->client);
assert(!strcmp(av[0], "rxreq"));
@@ -544,6 +548,7 @@
const char *body = NULL;
(void)cmd;
+ (void)vl;
CAST_OBJ_NOTNULL(hp, priv, HTTP_MAGIC);
AN(hp->client);
assert(!strcmp(av[0], "txreq"));
@@ -609,6 +614,7 @@
int i;
(void)cmd;
+ (void)vl;
CAST_OBJ_NOTNULL(hp, priv, HTTP_MAGIC);
AN(av[1]);
AZ(av[2]);
@@ -628,6 +634,7 @@
struct http *hp;
(void)cmd;
+ (void)vl;
CAST_OBJ_NOTNULL(hp, priv, HTTP_MAGIC);
AN(av[1]);
AZ(av[2]);
@@ -646,6 +653,7 @@
struct http *hp;
(void)cmd;
+ (void)vl;
CAST_OBJ_NOTNULL(hp, priv, HTTP_MAGIC);
AN(av[1]);
AZ(av[2]);
@@ -692,7 +700,7 @@
q = strchr(s, '\0');
assert(q > s);
AN(s);
- parse_string(s, http_cmds, hp);
+ parse_string(s, http_cmds, hp, vl);
vsb_delete(hp->vsb);
free(hp->rxbuf);
free(hp);
diff -Naur ../varnish-2.0-rc1/bin/varnishtest/vtc_log.c bin/varnishtest/vtc_log.c
--- ../varnish-2.0-rc1/bin/varnishtest/vtc_log.c 2008-10-08 13:18:24.000000000 +0200
+++ bin/varnishtest/vtc_log.c 2008-10-09 13:49:16.000000000 +0200
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: vtc_log.c 3248 2008-10-05 10:40:46Z phk $
+ * $Id: vtc_log.c 3272 2008-10-09 11:39:24Z phk $
*/
#include <stdio.h>
@@ -62,6 +62,15 @@
return (vl);
}
+void
+vtc_logclose(struct vtclog *vl)
+{
+
+ CHECK_OBJ_NOTNULL(vl, VTCLOG_MAGIC);
+ vsb_delete(vl->vsb);
+ FREE_OBJ(vl);
+}
+
static const char *lead[] = {
"----",
"# ",
@@ -77,6 +86,7 @@
vtc_log(struct vtclog *vl, unsigned lvl, const char *fmt, ...)
{
+ CHECK_OBJ_NOTNULL(vl, VTCLOG_MAGIC);
assert(lvl < NLEAD);
if (lvl > vtc_verbosity)
return;
@@ -91,8 +101,11 @@
AZ(vsb_overflowed(vl->vsb));
(void)fputs(vsb_data(vl->vsb), stdout);
vsb_clear(vl->vsb);
- if (lvl == 0)
+ if (lvl == 0) {
+ printf("---- TEST FILE: %s\n", vtc_file);
+ printf("---- TEST DESCRIPTION: %s\n", vtc_desc);
exit (1);
+ }
}
/**********************************************************************
@@ -105,6 +118,7 @@
{
int nl = 1;
+ CHECK_OBJ_NOTNULL(vl, VTCLOG_MAGIC);
assert(lvl < NLEAD);
if (lvl > vtc_verbosity)
return;
diff -Naur ../varnish-2.0-rc1/bin/varnishtest/vtc_sema.c bin/varnishtest/vtc_sema.c
--- ../varnish-2.0-rc1/bin/varnishtest/vtc_sema.c 2008-10-08 13:18:24.000000000 +0200
+++ bin/varnishtest/vtc_sema.c 2008-10-09 13:49:16.000000000 +0200
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: vtc_sema.c 3012 2008-07-24 12:22:35Z des $
+ * $Id: vtc_sema.c 3272 2008-10-09 11:39:24Z phk $
*/
#include <stdio.h>
@@ -42,7 +42,6 @@
unsigned magic;
#define SEMA_MAGIC 0x29b64317
char *name;
- struct vtclog *vl;
VTAILQ_ENTRY(sema) list;
pthread_mutex_t mtx;
pthread_cond_t cond;
@@ -59,17 +58,15 @@
*/
static struct sema *
-sema_new(char *name)
+sema_new(char *name, struct vtclog *vl)
{
struct sema *r;
ALLOC_OBJ(r, SEMA_MAGIC);
AN(r);
- r->vl = vtc_logopen(name);
- AN(r->vl);
r->name = name;
if (*name != 'r')
- vtc_log(r->vl, 0, "Sema name must start with 'r'");
+ vtc_log(vl, 0, "Sema name must start with 'r' (%s)", *name);
AZ(pthread_mutex_init(&r->mtx, NULL));
AZ(pthread_cond_init(&r->cond, NULL));
@@ -84,24 +81,31 @@
*/
static void
-sema_sync(struct sema *r, const char *av)
+sema_sync(struct sema *r, const char *av, struct vtclog *vl)
{
unsigned u;
+ CHECK_OBJ_NOTNULL(r, SEMA_MAGIC);
u = strtoul(av, NULL, 0);
AZ(pthread_mutex_lock(&r->mtx));
if (r->expected == 0)
r->expected = u;
- assert(r->expected == u);
+ if (r->expected != u)
+ vtc_log(vl, 0,
+ "Sema(%s) use error: different expectations (%u vs %u)",
+ r->name, r->expected, u);
if (++r->waiters == r->expected) {
- vtc_log(r->vl, 4, "Wake %u", r->expected);
+ vtc_log(vl, 4, "Sema(%s) wake %u", r->name, r->expected);
AZ(pthread_cond_broadcast(&r->cond));
r->waiters = 0;
r->expected = 0;
- } else
+ } else {
+ vtc_log(vl, 4, "Sema(%s) wait %u of %u",
+ r->name, r->waiters, r->expected);
AZ(pthread_cond_wait(&r->cond, &r->mtx));
+ }
AZ(pthread_mutex_unlock(&r->mtx));
}
@@ -121,9 +125,10 @@
AZ(pthread_mutex_lock(&sema_mtx));
/* Reset and free */
VTAILQ_FOREACH_SAFE(r, &semas, list, r2) {
- VTAILQ_REMOVE(&semas, r, list);
- FREE_OBJ(r);
- /* XXX: MEMLEAK */
+ AZ(pthread_mutex_lock(&r->mtx));
+ AZ(r->waiters);
+ AZ(r->expected);
+ AZ(pthread_mutex_unlock(&r->mtx));
}
AZ(pthread_mutex_unlock(&sema_mtx));
return;
@@ -137,7 +142,7 @@
if (!strcmp(r->name, av[0]))
break;
if (r == NULL)
- r = sema_new(av[0]);
+ r = sema_new(av[0], vl);
AZ(pthread_mutex_unlock(&sema_mtx));
av++;
@@ -145,10 +150,10 @@
if (!strcmp(*av, "sync")) {
av++;
AN(*av);
- sema_sync(r, *av);
+ sema_sync(r, *av, vl);
continue;
}
- vtc_log(r->vl, 0, "Unknown sema argument: %s", *av);
+ vtc_log(vl, 0, "Unknown sema argument: %s", *av);
}
}
diff -Naur ../varnish-2.0-rc1/bin/varnishtest/vtc_server.c bin/varnishtest/vtc_server.c
--- ../varnish-2.0-rc1/bin/varnishtest/vtc_server.c 2008-10-08 13:18:24.000000000 +0200
+++ bin/varnishtest/vtc_server.c 2008-10-09 13:49:16.000000000 +0200
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: vtc_server.c 3157 2008-09-02 20:20:48Z phk $
+ * $Id: vtc_server.c 3272 2008-10-09 11:39:24Z phk $
*/
@@ -57,7 +57,7 @@
int depth;
int sock;
- const char *listen;
+ char *listen;
struct vss_addr **vss_addr;
char *addr;
char *port;
@@ -109,20 +109,20 @@
*/
static struct server *
-server_new(char *name)
+server_new(const char *name)
{
struct server *s;
+ AN(name);
ALLOC_OBJ(s, SERVER_MAGIC);
AN(s);
- s->name = name;
+ REPLACE(s->name, name);
s->vl = vtc_logopen(name);
AN(s->vl);
- if (*name != 's') {
+ if (*s->name != 's')
vtc_log(s->vl, 0, "Server name must start with 's'");
- exit (1);
- }
- s->listen = "127.0.0.1:9080";
+
+ REPLACE(s->listen, "127.0.0.1:9080");
AZ(VSS_parse(s->listen, &s->addr, &s->port));
s->repeat = 1;
s->depth = 1;
@@ -132,6 +132,22 @@
}
/**********************************************************************
+ * Clean up a server
+ */
+
+static void
+server_delete(struct server *s)
+{
+
+ CHECK_OBJ_NOTNULL(s, SERVER_MAGIC);
+ vtc_logclose(s->vl);
+ free(s->listen);
+ free(s->name);
+ /* XXX: MEMLEAK (?) (VSS ??) */
+ FREE_OBJ(s);
+}
+
+/**********************************************************************
* Start the server thread
*/
@@ -211,6 +227,7 @@
(void)priv;
(void)cmd;
+ (void)vl;
if (av == NULL) {
/* Reset and free */
@@ -218,8 +235,7 @@
VTAILQ_REMOVE(&servers, s, list);
if (s->sock >= 0)
server_wait(s);
- FREE_OBJ(s);
- /* XXX: MEMLEAK */
+ server_delete(s);
}
return;
}
@@ -241,7 +257,7 @@
continue;
}
if (!strcmp(*av, "-listen")) {
- s->listen = av[1];
+ REPLACE(s->listen, av[1]);
AZ(VSS_parse(s->listen, &s->addr, &s->port));
av++;
continue;
diff -Naur ../varnish-2.0-rc1/bin/varnishtest/vtc_varnish.c bin/varnishtest/vtc_varnish.c
--- ../varnish-2.0-rc1/bin/varnishtest/vtc_varnish.c 2008-10-08 13:18:24.000000000 +0200
+++ bin/varnishtest/vtc_varnish.c 2008-10-09 13:49:16.000000000 +0200
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: vtc_varnish.c 3242 2008-10-01 08:27:59Z phk $
+ * $Id: vtc_varnish.c 3272 2008-10-09 11:39:24Z phk $
*/
@@ -131,21 +131,20 @@
*/
static struct varnish *
-varnish_new(char *name)
+varnish_new(const char *name)
{
struct varnish *v;
+ AN(name);
ALLOC_OBJ(v, VARNISH_MAGIC);
AN(v);
- v->name = name;
+ REPLACE(v->name, name);
v->vl = vtc_logopen(name);
AN(v->vl);
v->vl1 = vtc_logopen(name);
AN(v->vl1);
- if (*name != 'v') {
+ if (*v->name != 'v')
vtc_log(v->vl, 0, "Varnish name must start with 'v'");
- exit (1);
- }
v->args = "";
v->telnet = "127.0.0.1:9001";
@@ -156,6 +155,21 @@
}
/**********************************************************************
+ * Delete a varnish instance
+ */
+
+static void
+varnish_delete(struct varnish *v)
+{
+
+ CHECK_OBJ_NOTNULL(v, VARNISH_MAGIC);
+ vtc_logclose(v->vl);
+ free(v->name);
+ /* XXX: MEMLEAK */
+ FREE_OBJ(v);
+}
+
+/**********************************************************************
* Varnish listener
*/
@@ -418,8 +432,8 @@
*/
static void
-varnish_expect(struct varnish *v, char * const *av) {
- uint64_t val, ref;
+varnish_expect(const struct varnish *v, char * const *av) {
+ uint64_t val, ref;
int good;
char *p;
int i;
@@ -428,6 +442,7 @@
for (i = 0; i < 10; i++, usleep(100000)) {
+
#define MAC_STAT(n, t, f, d) \
if (!strcmp(av[0], #n)) { \
val = v->stats->n; \
@@ -435,6 +450,7 @@
#include "stat_field.h"
#undef MAC_STAT
{
+ val = 0;
vtc_log(v->vl, 0, "stats field %s unknown", av[0]);
}
@@ -472,6 +488,7 @@
(void)priv;
(void)cmd;
+ (void)vl;
if (av == NULL) {
/* Reset and free */
@@ -479,8 +496,7 @@
if (v->cli_fd >= 0)
varnish_wait(v);
VTAILQ_REMOVE(&varnishes, v, list);
- FREE_OBJ(v);
- /* XXX: MEMLEAK */
+ varnish_delete(v);
}
return;
}

View File

@ -1,28 +0,0 @@
diff -Naur ../varnish-2.0-beta1.orig/redhat/README.redhat ./redhat/README.redhat
--- ../varnish-2.0-beta1.orig/redhat/README.redhat 2008-08-27 09:45:40.000000000 +0200
+++ ./redhat/README.redhat 2008-09-02 16:14:43.000000000 +0200
@@ -5,6 +5,24 @@
Varnish should work fine with GCC 3.3 and above.
+Upgrading from 1.x to 2.0
+=========================
+There are a few changes in the vcl language from varnish-1.x to 2.0.
+Because of varnish' dynamic vcl loading feature, there is no way to
+guarantee that the vcl file in use actually exists on disk. Thus,
+there is no way to securely automate this process, and one must do the
+changes by hand.
+
+In vcl, the word "insert" has been replaced by "deliver".
+
+In the vcl declaration of backends, where one earlier used "set
+backend", backend parts are now just prefixed with a dot, so the
+default localhost configuration will look like this:
+
+backend default {
+ .host = "127.0.0.1";
+ .port = "80";
+}
Configuration of addresses and ports
====================================