]> err.no Git - varnish/log
varnish
17 years agoConvert the received request and pipelined bytes into txt's.
phk [Wed, 26 Sep 2007 18:59:28 +0000 (18:59 +0000)]
Convert the received request and pipelined bytes into txt's.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2045 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agostruct http_hdr is more than that, it is a general text handle, so
phk [Wed, 26 Sep 2007 18:56:18 +0000 (18:56 +0000)]
struct http_hdr is more than that, it is a general text handle, so
typedef it as "txt" instead.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2044 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoMore flexelint nit-picking of various sorts
phk [Tue, 25 Sep 2007 13:19:07 +0000 (13:19 +0000)]
More flexelint nit-picking of various sorts

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2043 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoConstify a lot of the VRT API
phk [Tue, 25 Sep 2007 11:51:49 +0000 (11:51 +0000)]
Constify a lot of the VRT API

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2042 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoMega-Const'ification
phk [Tue, 25 Sep 2007 11:11:15 +0000 (11:11 +0000)]
Mega-Const'ification

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2041 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoIf the C-compiler fails, we don't know if it created the output file or not.
phk [Tue, 25 Sep 2007 11:05:25 +0000 (11:05 +0000)]
If the C-compiler fails, we don't know if it created the output file or not.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2040 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoConstification
phk [Tue, 25 Sep 2007 10:36:59 +0000 (10:36 +0000)]
Constification

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2039 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoConstification of certain storage functions
phk [Tue, 25 Sep 2007 10:35:44 +0000 (10:35 +0000)]
Constification of certain storage functions

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2038 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoMake Tim_format() take a double time argument
phk [Tue, 25 Sep 2007 10:32:24 +0000 (10:32 +0000)]
Make Tim_format() take a double time argument

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2037 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoMake the arguments to CLI functions const-const.
phk [Tue, 25 Sep 2007 10:25:51 +0000 (10:25 +0000)]
Make the arguments to CLI functions const-const.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2036 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoCatch up with sys/queue.h changes
phk [Tue, 25 Sep 2007 10:24:34 +0000 (10:24 +0000)]
Catch up with sys/queue.h changes

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2035 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoThe previous commit made things worse rather than better, as some systems
des [Tue, 25 Sep 2007 08:48:14 +0000 (08:48 +0000)]
The previous commit made things worse rather than better, as some systems
have a <sys/queue.h> that differs in small but important details from what
we expect.  Replace our "queue.h" (which was taken from NetBSD) with a new
"vqueue.h" which is based on FreeBSD's <sys/queue.h> with the debugging
taken out and a "V" prefix added to everything.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2033 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoPortability: use -lsocket / -lns on systems that need it (read Solaris),
des [Tue, 25 Sep 2007 08:21:28 +0000 (08:21 +0000)]
Portability: use -lsocket / -lns on systems that need it (read Solaris),
use <sys/queue.h> instead of our own if present.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2032 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoUse a config cache.
des [Tue, 25 Sep 2007 08:19:50 +0000 (08:19 +0000)]
Use a config cache.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2031 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoNew more paranoid settings for FlexeLint
phk [Tue, 25 Sep 2007 07:57:21 +0000 (07:57 +0000)]
New more paranoid settings for FlexeLint

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2030 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoMake the logic visible for FlexeLint
phk [Tue, 25 Sep 2007 07:57:06 +0000 (07:57 +0000)]
Make the logic visible for FlexeLint

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2029 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoMisc changes:
phk [Tue, 25 Sep 2007 07:40:01 +0000 (07:40 +0000)]
Misc changes:

A couple of XXX comments
Some returnvalue asserts
Some pdiff() uses
Change WRK_Flush() to return unsigned

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2028 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoUnnecessary check
phk [Tue, 25 Sep 2007 07:33:07 +0000 (07:33 +0000)]
Unnecessary check

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2027 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoBail if we get unknown address families
phk [Tue, 25 Sep 2007 07:32:15 +0000 (07:32 +0000)]
Bail if we get unknown address families

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2026 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoAssert return values of system{calls,functions}
phk [Tue, 25 Sep 2007 07:30:38 +0000 (07:30 +0000)]
Assert return values of system{calls,functions}

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2025 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agotypo
phk [Tue, 25 Sep 2007 07:22:58 +0000 (07:22 +0000)]
typo

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2024 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoPolish
phk [Tue, 25 Sep 2007 07:21:40 +0000 (07:21 +0000)]
Polish

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2023 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoUse pdiff() to guard against negative point differences
phk [Tue, 25 Sep 2007 07:19:54 +0000 (07:19 +0000)]
Use pdiff() to guard against negative point differences

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2022 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoTwo consts is one const too many.
phk [Tue, 25 Sep 2007 07:12:18 +0000 (07:12 +0000)]
Two consts is one const too many.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2021 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoMore const polishing
phk [Tue, 25 Sep 2007 07:11:33 +0000 (07:11 +0000)]
More const polishing

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2020 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoMake id type "int"
phk [Tue, 25 Sep 2007 07:08:07 +0000 (07:08 +0000)]
Make id type "int"

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2019 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoConst'ifcation
phk [Tue, 25 Sep 2007 07:06:18 +0000 (07:06 +0000)]
Const'ifcation

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2018 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoPolish shmlog:
phk [Tue, 25 Sep 2007 06:56:23 +0000 (06:56 +0000)]
Polish shmlog:

The id argument is a file descriptor, so it should be typed "int".
We must have a fmt argument.
Use pdiff.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2017 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoWhen we take the difference between two pointers, the result is technically
phk [Tue, 25 Sep 2007 06:51:04 +0000 (06:51 +0000)]
When we take the difference between two pointers, the result is technically
signed.  pdiff() makes sure we never get a negative value.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2016 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoUse the correct shmlog function.
phk [Tue, 25 Sep 2007 06:46:57 +0000 (06:46 +0000)]
Use the correct shmlog function.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2015 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoThe first of a long sequence of committs, inspired by cranking up FlexeLints
phk [Tue, 25 Sep 2007 06:44:27 +0000 (06:44 +0000)]
The first of a long sequence of committs, inspired by cranking up FlexeLints
nitpicking to new heights:

Make sure VRT_int_string() has enough room and assert that this was the case.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2014 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoRe-enable the code causing bug #161 (which is now fixed)
cecilihf [Mon, 24 Sep 2007 13:21:27 +0000 (13:21 +0000)]
Re-enable the code causing bug #161 (which is now fixed)

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2013 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoFixes bug #161.
cecilihf [Mon, 24 Sep 2007 13:18:04 +0000 (13:18 +0000)]
Fixes bug #161.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2012 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoActually, we cannot touch objects on deathrow, so just ignore
phk [Mon, 24 Sep 2007 13:00:33 +0000 (13:00 +0000)]
Actually, we cannot touch objects on deathrow, so just ignore
any object with heap_idx == 0.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2011 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoRemove an assert which isn't valid: we could try to LRU_Touch an
phk [Mon, 24 Sep 2007 12:58:14 +0000 (12:58 +0000)]
Remove an assert which isn't valid:  we could try to LRU_Touch an
object on deathrow.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2010 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoMake the cli_timeout a parameter. The master will wait this long
phk [Mon, 24 Sep 2007 12:27:54 +0000 (12:27 +0000)]
Make the cli_timeout a parameter.  The master will wait this long
for the client to reply on the internal CLI pipe.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2009 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoUpdate random and round-robin backends to use the new convenience functions.
cecilihf [Mon, 24 Sep 2007 12:06:20 +0000 (12:06 +0000)]
Update random and round-robin backends to use the new convenience functions.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2008 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoAdd code to VCC to output an identifier for each simple backend which
phk [Mon, 24 Sep 2007 11:25:15 +0000 (11:25 +0000)]
Add code to VCC to output an identifier for each simple backend which
varnishd can use to decide if a backend state can be shared between
multiple VCL programs.

Originally the idea was to calculate a strong hash over the tokens
which define the backend.

Considering the relatively short lengths of backend declarations
and the infrequency of comparisons, we have opted for an extremely
weak hash instead:  We simply output the space separted tokens as
a string.

The net change in code for simple backends is marginal, but for
complex backends this will be a lot simpler to implement.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2007 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoOur first cut at a LRU processing contained a three way race and can
phk [Mon, 24 Sep 2007 08:23:34 +0000 (08:23 +0000)]
Our first cut at a LRU processing contained a three way race and can
cause Really Weird Problems if you really provoke it.

+++ Redo from start +++

LRU processing is only relevant for objects which are in the cache and
on the EXP binary heap so we merge the LRU functionality with the EXP
code in order to share locks and object reference counts.

Another thing we overlooked in the first implementation is that the VCL
callout for LRU should be able to examine the client information for
the session which tries to push stuff out, so that QoS/DoS issues can be
considered:

sub vcl_dicard {
if (client.bandwidth > 10 mb/s) {
keep;
}
}

(which sort of indicates that "error" should be a legal action as well)

To enable this, pass the session into the stevedore when we try to
allocate space and temporarily substitute the target object for its
own object while we call vcl_discard().

The outcome of an attempt to make space can take three values, did,
didn't and couldn't.  In the latter case there is no point in trying
again and again, in particular if the cause is incurable, such as
the requested size being larger than the storage.   We still need to
handle failure to allocate storage for that case rather than core dump.

When looking for targets to nuke, we only consider objects on the
binheap which has reference count of 1, objects with higher reference
counts would not free space.

We take prospective targets off the binheap, but retain their
refcount, and tag them with a magic marker while we ponder their
destiny.

It is quite possible that another session could pick the object up
via the cache while we do so, and therefore attempts to update the
ttl or shift them in the lru chain must ignore objects which has
the magic marker.  If the object is kept, the updated ttl will
automatically take effect when we reinsert it in the binheap.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2006 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoAdd a couple of statistics counters for LRU
phk [Mon, 24 Sep 2007 08:01:07 +0000 (08:01 +0000)]
Add a couple of statistics counters for LRU

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2005 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoFix a NULL pointer dereference which cannot currently happen.
phk [Mon, 24 Sep 2007 07:37:40 +0000 (07:37 +0000)]
Fix a NULL pointer dereference which cannot currently happen.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2004 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoReverse the logic in r1997 from !is_get to is_head.
des [Sun, 23 Sep 2007 14:19:42 +0000 (14:19 +0000)]
Reverse the logic in r1997 from !is_get to is_head.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1998 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoFix another cornercase that fell out as part of the pass->fetch rewrite:
phk [Sun, 23 Sep 2007 13:46:43 +0000 (13:46 +0000)]
Fix another cornercase that fell out as part of the pass->fetch rewrite:

If we pass a HEAD request, we should not rewrite it to GET and not expect
a body either.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1997 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoUnbreak header ordering.
des [Sun, 23 Sep 2007 13:18:50 +0000 (13:18 +0000)]
Unbreak header ordering.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1994 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoWhen a workerthread dies of old age, make sure to nuke the mutex it may
phk [Sun, 23 Sep 2007 13:11:51 +0000 (13:11 +0000)]
When a workerthread dies of old age, make sure to nuke the mutex it may
have in its cached nobjhead.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1991 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoPart of this commit sneaked into the previous #1985:
phk [Sun, 23 Sep 2007 13:09:56 +0000 (13:09 +0000)]
Part of this commit sneaked into the previous #1985:

Close a supposedly rare memory leak: when we loose the race to create
an objhead, we need to free the hash-string we created before our
second attempt.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1990 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoPartially revert previous optimization: it wasn't.
phk [Sun, 23 Sep 2007 13:04:20 +0000 (13:04 +0000)]
Partially revert previous optimization: it wasn't.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1985 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoPolish, including use of CHECK_OBJ_ORNULL()
phk [Sun, 23 Sep 2007 12:46:52 +0000 (12:46 +0000)]
Polish, including use of CHECK_OBJ_ORNULL()

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1983 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoUse CHECK_OBJ_ORNULL() macro
phk [Sun, 23 Sep 2007 12:46:19 +0000 (12:46 +0000)]
Use CHECK_OBJ_ORNULL() macro

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1982 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoAdd CHECK_OBJ_ORNULL() macro
phk [Sun, 23 Sep 2007 12:44:12 +0000 (12:44 +0000)]
Add CHECK_OBJ_ORNULL() macro

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1981 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoPolish while reading review.
phk [Sun, 23 Sep 2007 12:39:27 +0000 (12:39 +0000)]
Polish while reading review.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1980 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoAdd an experimental runtime parameter for the lru_timeout.
phk [Fri, 21 Sep 2007 13:18:10 +0000 (13:18 +0000)]
Add an experimental runtime parameter for the lru_timeout.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1979 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoA temporary work-around for #161
phk [Fri, 21 Sep 2007 10:38:01 +0000 (10:38 +0000)]
A temporary work-around for #161

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1978 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoDon't leak 50 bytes when creating the new Date: header.
phk [Fri, 21 Sep 2007 09:49:44 +0000 (09:49 +0000)]
Don't leak 50 bytes when creating the new Date: header.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1977 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoDon't copy the Date: header from the object to the reply
phk [Fri, 21 Sep 2007 09:49:05 +0000 (09:49 +0000)]
Don't copy the Date: header from the object to the reply

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1976 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoMove implicit reference to first backend to the xref code.
phk [Fri, 21 Sep 2007 08:16:02 +0000 (08:16 +0000)]
Move implicit reference to first backend to the xref code.

Don't panic if no backend.port is specified.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1975 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoFix an extremely fine C-standard point and remove the vcc_FreeToken()
phk [Thu, 20 Sep 2007 22:27:25 +0000 (22:27 +0000)]
Fix an extremely fine C-standard point and remove the vcc_FreeToken()
prototype

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1974 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agovcc_FreeToken() is no longer necessary
phk [Thu, 20 Sep 2007 22:26:53 +0000 (22:26 +0000)]
vcc_FreeToken() is no longer necessary

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1973 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoAvoid a double free when we encounter a 'include' directive.
phk [Thu, 20 Sep 2007 22:26:31 +0000 (22:26 +0000)]
Avoid a double free when we encounter a 'include' directive.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1972 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoDon't core dump if VCL tries to compare NULL pointers, just let the
phk [Thu, 20 Sep 2007 22:25:27 +0000 (22:25 +0000)]
Don't core dump if VCL tries to compare NULL pointers, just let the
comparison fail.  This typically happens if a paticular header is
not present.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1971 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoFix a brain-o in my last commit. "cls" is a flag for closing the fd,
phk [Thu, 20 Sep 2007 10:44:18 +0000 (10:44 +0000)]
Fix a brain-o in my last commit.  "cls" is a flag for closing the fd,
not for generating Content-Length: header.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1970 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoAdded some checks for NULL-pointers.
cecilihf [Thu, 20 Sep 2007 08:58:54 +0000 (08:58 +0000)]
Added some checks for NULL-pointers.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1969 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoAfter we moved pass to use the same code as fetch, we have run into
phk [Thu, 20 Sep 2007 08:46:25 +0000 (08:46 +0000)]
After we moved pass to use the same code as fetch, we have run into
a unnecessary connection timeout wait when the returned object does
not have a body.

Rework the "does this response have a body" logic to be more in line
with the RFC.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1968 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoAdd a http_GetProto() function
phk [Thu, 20 Sep 2007 08:44:59 +0000 (08:44 +0000)]
Add a http_GetProto() function

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1967 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoUse VBE_CheckFd() convenience function
phk [Thu, 20 Sep 2007 08:23:21 +0000 (08:23 +0000)]
Use VBE_CheckFd() convenience function

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1966 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoAdd a convenience function more for backend methods:
phk [Thu, 20 Sep 2007 08:22:59 +0000 (08:22 +0000)]
Add a convenience function more for backend methods:

VBE_CheckFd(): Check that a filedescriptor is reusable.

Right now we simply poll it with a zero timeout, and if there are
any events, we can't reuse it.

This check may need refinement down the road.

One option would be to attempt to write a CRNL onto the fd and see
that it works.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1965 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoGo over the simple backend and make it more readable.
phk [Thu, 20 Sep 2007 08:16:01 +0000 (08:16 +0000)]
Go over the simple backend and make it more readable.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1964 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoAdd a VBE_TryConnect() which tries to connected to a given backend+addrinfo
phk [Thu, 20 Sep 2007 08:14:40 +0000 (08:14 +0000)]
Add a VBE_TryConnect() which tries to connected to a given backend+addrinfo
combination.  This will be necessary in most if not all backend methods,
so it should be generic.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1963 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoMake init an optional method for backends
phk [Thu, 20 Sep 2007 07:22:56 +0000 (07:22 +0000)]
Make init an optional method for backends

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1962 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoMake updatehealth an optional method for backends
phk [Thu, 20 Sep 2007 07:19:34 +0000 (07:19 +0000)]
Make updatehealth an optional method for backends

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1961 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoCall the init methods of all backend styles.
phk [Thu, 20 Sep 2007 07:14:40 +0000 (07:14 +0000)]
Call the init methods of all backend styles.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1960 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoUse FREE_OBJ() and REPLACE() macros
phk [Thu, 20 Sep 2007 07:09:53 +0000 (07:09 +0000)]
Use FREE_OBJ() and REPLACE() macros

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1959 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoUse REPLACE macro to manipulate malloc'ed string variables.
phk [Thu, 20 Sep 2007 07:03:09 +0000 (07:03 +0000)]
Use REPLACE macro to manipulate malloc'ed string variables.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1958 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoAdd a REPLACE() macro, for manipulating malloced string variables.
phk [Thu, 20 Sep 2007 07:02:35 +0000 (07:02 +0000)]
Add a REPLACE() macro, for manipulating malloced string variables.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1957 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoMake regular expressions case insensitive.
phk [Thu, 20 Sep 2007 06:26:17 +0000 (06:26 +0000)]
Make regular expressions case insensitive.

This is not optimal, but a better compromise than the alternative.

DNS names are case insensitive, but URLs are not.

However, URLs are very often filenames and having files which differ
only in case is already asking for trouble.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1956 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoFixes #157. Always replace Date with current time on varnish server.
cecilihf [Tue, 18 Sep 2007 11:40:44 +0000 (11:40 +0000)]
Fixes #157. Always replace Date with current time on varnish server.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1955 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoAdditional markup fixes, bump date
des [Wed, 12 Sep 2007 15:55:51 +0000 (15:55 +0000)]
Additional markup fixes, bump date

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1949 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoMan page fixes
ssm [Wed, 12 Sep 2007 15:21:12 +0000 (15:21 +0000)]
Man page fixes
* Close list in varnishreplay.1
* Remove macro after Cm, as this cancelled the effect of Cm

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1948 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoDebian package: Rename library and development packages to reflect soname
ssm [Wed, 12 Sep 2007 14:31:22 +0000 (14:31 +0000)]
Debian package: Rename library and development packages to reflect soname

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1946 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoDebian package: Fix lintian warnings
ssm [Wed, 12 Sep 2007 14:30:36 +0000 (14:30 +0000)]
Debian package: Fix lintian warnings
* Add magic tag in varnish.postinst for debhelper
* Remove old overrides, add two overrides for update-rc.d

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1945 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoBump debian version-revision to 1.1.2-1
ssm [Wed, 12 Sep 2007 13:19:27 +0000 (13:19 +0000)]
Bump debian version-revision to 1.1.2-1

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1944 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoInstall man pages into the correct directory.
des [Wed, 12 Sep 2007 08:37:42 +0000 (08:37 +0000)]
Install man pages into the correct directory.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1943 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoMake sure to initialize t_end if we drop sessions.
phk [Wed, 12 Sep 2007 06:12:18 +0000 (06:12 +0000)]
Make sure to initialize t_end if we drop sessions.

Fixes #132

Many thanks to Janis Putrams for debugging this.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1942 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years ago* Added recognition of HEAD responses.
knutroy [Fri, 7 Sep 2007 11:31:18 +0000 (11:31 +0000)]
* Added recognition of HEAD responses.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1941 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoAdded health checks for individual servers within a balanced backend cluster.
cecilihf [Fri, 7 Sep 2007 09:22:30 +0000 (09:22 +0000)]
Added health checks for individual servers within a balanced backend cluster.
The health checks work the same as for a general backend. The worse the health of
an individual server within a balanced backend, the less likely it will be to get new
connections.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1940 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoLimit the width to a sensible value so text will still be readable when you
des [Thu, 6 Sep 2007 23:22:06 +0000 (23:22 +0000)]
Limit the width to a sensible value so text will still be readable when you
maximize your browser window.
Add formatting for <emphasis>.
Correct whitespace handling for <screen>.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1939 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoForgot to update MANIFEST.
knutroy [Wed, 5 Sep 2007 14:53:25 +0000 (14:53 +0000)]
Forgot to update MANIFEST.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1938 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years ago* Added POD.
knutroy [Wed, 5 Sep 2007 12:49:05 +0000 (12:49 +0000)]
* Added POD.
* Moved Varnish::Test::Server::Connection to its own module file.
* Removed TODO which was not too exciting anyway.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1937 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years ago* Added information about test framework to "Inside Varnish".
knutroy [Tue, 4 Sep 2007 14:00:13 +0000 (14:00 +0000)]
* Added information about test framework to "Inside Varnish".

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1936 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years ago* Set statedir to /var/lib, to conform to debian packaging standards.
ssm [Tue, 4 Sep 2007 10:55:25 +0000 (10:55 +0000)]
* Set statedir to /var/lib, to conform to debian packaging standards.

* Removed -n switch from varnish defaults file and varnishlog init script.
  Use the default instance name instead.  This makes sure varnish utilities work
  without having to use the -n switch for the default instance.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1935 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoMissing 0
cecilihf [Tue, 4 Sep 2007 08:04:48 +0000 (08:04 +0000)]
Missing 0

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1934 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoCopy-paste error.
cecilihf [Tue, 4 Sep 2007 08:03:43 +0000 (08:03 +0000)]
Copy-paste error.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1933 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years ago* Added Makefile.PL to test framework.
knutroy [Mon, 3 Sep 2007 10:12:29 +0000 (10:12 +0000)]
* Added Makefile.PL to test framework.
* Moved varnish-regress.pl to subdirectory "bin".
* Minor POD additions.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1932 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoAdded support for load balancing among backends in varnish. It is still experimental
cecilihf [Fri, 31 Aug 2007 12:14:06 +0000 (12:14 +0000)]
Added support for load balancing among backends in varnish. It is still experimental
and very basic, but it should be ready for testing. Two strategies for load balancing
are implemented: a simple round robin, and a simple weighted random. The following
is an example configuration in vcl. The weight parameter for random is optional. Default
is equal weight.

backend foo {
set backend.host = "foo.bar.com";
set backend.port = "http";
}

backend_round_robin rr {
set backend.set = {
{ "foo1.bar.com", "http" }
{ "foo2.bar.com", "http" }
{ "foo3.bar.com", "http" }
};
}

backend_random rrr {
set backend.set = {
{ "foo1.bar.com", "http", 0.3 }
{ "foo2.bar.com", "http", 0.6 }
{ "foo3.bar.com", "http", 0.1 }
};
}

sub vcl_recv {
if {req.http.host ~ "foo"} {
req.backend = foo;
} elseif {req.http.host ~ "bar"} {
req.backend = rr;
} else {
req.backend = rrr;
}
}

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1931 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoFix typo that made worker process panic whenever a request came in without
phk [Fri, 31 Aug 2007 07:03:32 +0000 (07:03 +0000)]
Fix typo that made worker process panic whenever a request came in without
a Host: header.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1930 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoReadability
des [Wed, 29 Aug 2007 15:25:58 +0000 (15:25 +0000)]
Readability

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1928 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoAdd missing files.
des [Wed, 29 Aug 2007 15:24:42 +0000 (15:24 +0000)]
Add missing files.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1927 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoTabify
des [Wed, 29 Aug 2007 15:23:52 +0000 (15:23 +0000)]
Tabify

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1926 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoImprove readability.
des [Wed, 29 Aug 2007 15:21:59 +0000 (15:21 +0000)]
Improve readability.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1925 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years agoAdd style information for <screen>, and fix marker placement for ordered
des [Sat, 25 Aug 2007 21:35:11 +0000 (21:35 +0000)]
Add style information for <screen>, and fix marker placement for ordered
lists.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1924 d4fa192b-c00b-0410-8231-f00ffab90ce4