]> err.no Git - varnish/log
varnish
15 years agoAdd a "banner" command to the CLI interface.
phk [Fri, 13 Feb 2009 10:13:27 +0000 (10:13 +0000)]
Add a "banner" command to the CLI interface.

Add a parameter "cli_banner" (default on) which injects an implicit
"banner" CLI command on all cli connections when opened.

The net result is that you get a CLI response when you connect to
the CLI ports:

200 193
-----------------------------
Varnish HTTP accelerator CLI.
-----------------------------
Type 'help' for command list.
Type 'quit' to close CLI session.
Type 'start' to launch worker process.

Presently the contents of the CLI response is "undefined", in the
sense that you should not programatically depend on anything besides
the "200" reply code.

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

15 years agoUpdate copyright year
phk [Fri, 13 Feb 2009 09:49:11 +0000 (09:49 +0000)]
Update copyright year

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

15 years agoAdd VLU_Data() function for injecting input
phk [Fri, 13 Feb 2009 09:38:57 +0000 (09:38 +0000)]
Add VLU_Data() function for injecting input

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

15 years agoparameter name change "acceptor" -> "waiter"
phk [Fri, 13 Feb 2009 09:25:33 +0000 (09:25 +0000)]
parameter name change "acceptor" -> "waiter"

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

15 years agoDue to lack og foresight,the threads that keep an eye on client connections
phk [Fri, 13 Feb 2009 09:19:50 +0000 (09:19 +0000)]
Due to lack og foresight,the threads that keep an eye on client connections
to see if they get reused ended up being named "acceptors", which is a bad
name because we have another thread which accepts new connections.

Rename the "fake" acceptors to "waiters"

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

15 years agoMove the LRU timestamp from the objcore to the object, we only access
phk [Thu, 12 Feb 2009 22:26:44 +0000 (22:26 +0000)]
Move the LRU timestamp from the objcore to the object, we only access
it when we have used the object anyway.

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

15 years agoMove objcore over objects, so that objhead has a list of objcore
phk [Thu, 12 Feb 2009 17:23:16 +0000 (17:23 +0000)]
Move objcore over objects, so that objhead has a list of objcore
which point to the objects.

Preallocate objcore with obj+objhead before we enter locked
hash sections.

Rename objcore.list to objcore.lru_list.

Eliminate obj.list and objhead.hashlen

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

15 years agoMerge r3752: Added som changelog changes from fedora package
tfheen [Wed, 11 Feb 2009 14:55:26 +0000 (14:55 +0000)]
Merge r3752: Added som changelog changes from fedora package

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

15 years agoMerge r3751 into trunk: Packaging fixes
tfheen [Wed, 11 Feb 2009 14:55:02 +0000 (14:55 +0000)]
Merge r3751 into trunk: Packaging fixes

- Changelog item to specfile for the rpm package
- Added html doc to the rpm package

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

15 years agoPull struct objexp out of the closet and call it objcore.
phk [Wed, 11 Feb 2009 11:24:12 +0000 (11:24 +0000)]
Pull struct objexp out of the closet and call it objcore.

In the future, this will be the bits of a cached object we cannot
realistically expect to stay paged out for any period of time.

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

15 years agoFix backslashes.
des [Fri, 6 Feb 2009 21:21:50 +0000 (21:21 +0000)]
Fix backslashes.

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

15 years agoWhitespace cleanup
des [Fri, 6 Feb 2009 21:12:46 +0000 (21:12 +0000)]
Whitespace cleanup

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

15 years agoRegression testcase for #433
phk [Tue, 3 Feb 2009 21:49:47 +0000 (21:49 +0000)]
Regression testcase for #433

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

15 years agoOverhaul the ESI parser in light of #433 and the prospect of future
phk [Tue, 3 Feb 2009 21:49:26 +0000 (21:49 +0000)]
Overhaul the ESI parser in light of #433 and the prospect of future
addition of features to the ESI code.

The particular situation in #433 arises because a XML comment is not
bounded in length, the same way as an <esi:include...> element naturally
is.  This opens the window for trouble when large sections of XML is
commented out for some reason or another.

Bite the bullet and create a "storage-pointer" consisting of a pointer
to a storage segment and a pointer into that segment.

Add a main-loop which uses these pointers to walks over the entire
object, looking for stuff we care about, and handle each appropriately.

In addition to coping properly with the situation in #433, this code is
also close to 100 lines shorter and has a more logical structure.

The downside is that it is isn't quite as memory-access-alergic as the
previous version.  (I challenge anybody to measure the effect of this.)

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

15 years agoAdd line numbers to this test, so we can see where it croaks, when it does.
phk [Tue, 3 Feb 2009 21:22:52 +0000 (21:22 +0000)]
Add line numbers to this test, so we can see where it croaks, when it does.

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

15 years agoAdd a counter for esi parse errors and test it in all ESI related
phk [Tue, 3 Feb 2009 18:44:21 +0000 (18:44 +0000)]
Add a counter for esi parse errors and test it in all ESI related
tests cases.

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

15 years agoAdd bodylen expects to the ESI test cases
phk [Tue, 3 Feb 2009 17:34:08 +0000 (17:34 +0000)]
Add bodylen expects to the ESI test cases

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

15 years agoUpdate this test to actually test what it should.
phk [Tue, 3 Feb 2009 12:59:13 +0000 (12:59 +0000)]
Update this test to actually test what it should.

I suspect a white-space cleanup got it at some point.

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

15 years agoMake it possible (at great performance loss) to force straight
phk [Tue, 3 Feb 2009 12:45:06 +0000 (12:45 +0000)]
Make it possible (at great performance loss) to force straight
time sequencing of shmlog records for debugging purposes.

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

15 years agoMark that we do limited segment size fetches for debugging
phk [Tue, 3 Feb 2009 12:42:39 +0000 (12:42 +0000)]
Mark that we do limited segment size fetches for debugging

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

15 years agoOpps, debugging hack leaked in.
phk [Tue, 3 Feb 2009 10:48:20 +0000 (10:48 +0000)]
Opps, debugging hack leaked in.

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

15 years agoThe esi detector should also spot esi comments.
phk [Tue, 3 Feb 2009 10:47:29 +0000 (10:47 +0000)]
The esi detector should also spot esi comments.

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

15 years agoAdd an (unlocked) counter for number of ESI objects we have parsed.
phk [Tue, 3 Feb 2009 10:26:02 +0000 (10:26 +0000)]
Add an (unlocked) counter for number of ESI objects we have parsed.

Add two test-cases for objects we should not esi parse.

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

15 years agoClose a race where VCL tries to modify the obj.ttl at the same moment
phk [Mon, 2 Feb 2009 16:48:28 +0000 (16:48 +0000)]
Close a race where VCL tries to modify the obj.ttl at the same moment
the grim reaper has taken the object off the binheap to inspect it.

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

15 years agoMove mybe{32,64}enc definitions outside of ifdef so we work on 64 bit BE platforms...
tfheen [Fri, 30 Jan 2009 14:40:32 +0000 (14:40 +0000)]
Move mybe{32,64}enc definitions outside of ifdef so we work on 64 bit BE platforms too.

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

15 years agoMore FlexeLint silencing.
phk [Wed, 28 Jan 2009 11:48:07 +0000 (11:48 +0000)]
More FlexeLint silencing.

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

15 years agoAdd missing header file to tarball
tfheen [Wed, 28 Jan 2009 11:48:03 +0000 (11:48 +0000)]
Add missing header file to tarball

Fixes build failure

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

15 years agosilence a couple of Flexelint complaints.
phk [Wed, 28 Jan 2009 10:46:54 +0000 (10:46 +0000)]
silence a couple of Flexelint complaints.

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

15 years agoStop processing ESI elements as soon as we discover that the client
phk [Tue, 27 Jan 2009 21:14:35 +0000 (21:14 +0000)]
Stop processing ESI elements as soon as we discover that the client
has closed the connection on us.

Fixes #427

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

15 years agoproper errorchecks for regsub syntax.
phk [Tue, 27 Jan 2009 12:18:12 +0000 (12:18 +0000)]
proper errorchecks for regsub syntax.

(The recent change that moved the compiler into its own subprocess
eliminates risk that a compiler error causes the management process
to die, you just do not get a sensible syntax error).

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

15 years agoDon't modify the obj_timer_when field outside the binheap lock.
phk [Tue, 27 Jan 2009 08:46:51 +0000 (08:46 +0000)]
Don't modify the obj_timer_when field outside the binheap lock.

This hopefully finaly lays the sporadic
assert(oe2->timer_when >= oe->timer_when);
panics to rest.

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

15 years agoLack of a backend name is no reasonable cause for a panic.
phk [Tue, 27 Jan 2009 08:17:29 +0000 (08:17 +0000)]
Lack of a backend name is no reasonable cause for a panic.

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

15 years agoTest that we know the purge variable when it is compiled in.
phk [Sat, 24 Jan 2009 12:56:27 +0000 (12:56 +0000)]
Test that we know the purge variable when it is compiled in.

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

15 years agoImplement the new-purge case where the entire expression comes
phk [Sat, 24 Jan 2009 10:36:46 +0000 (10:36 +0000)]
Implement the new-purge case where the entire expression comes
from VCL.

It is possible to instigate purges two ways from VCL now:

        sub vcl_recv {
# Purge the req.url
                if (req.request == "PURGE") {
                        purge (req.url == req.url);
                        error 410;
                }

# Take entire purge instruction from "Purge:" header
                if (req.request == "PURGESTR") {
                        purge ("" req.http.purge);
                        error 410;
                }

Testcase for this.

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

15 years agoFirst cut at VCL support for new-purge.
phk [Fri, 23 Jan 2009 21:17:02 +0000 (21:17 +0000)]
First cut at VCL support for new-purge.

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

15 years agoDon't append a CRNL to the body.
phk [Fri, 23 Jan 2009 13:22:43 +0000 (13:22 +0000)]
Don't append a CRNL to the body.

And add separate rxhdrs and rxbody primitives.

Submitted by: Yonatan Broza & Dmitry Rubinstein

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

15 years agoDon't need debug patch outside fedora package
ingvar [Thu, 22 Jan 2009 13:07:20 +0000 (13:07 +0000)]
Don't need debug patch outside fedora package

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

15 years agoMove the purgable variables into a CPP table, so we can share them with
phk [Thu, 22 Jan 2009 10:42:58 +0000 (10:42 +0000)]
Move the purgable variables into a CPP table, so we can share them with
the VCL compiler

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

15 years agoEnforce a minimum ttl for "hit for pass" objects to prevent a value
phk [Wed, 21 Jan 2009 23:00:43 +0000 (23:00 +0000)]
Enforce a minimum ttl for "hit for pass" objects to prevent a value
of zero from serializing access to an object with very draconian
backend cache-control headers.

We could get far even with a one second TTL, but following our general
"there is a reason people put Varnish there in the first place" logic
we use the default_ttl parameter (default: 120 s) for this value.

If another value is desired, this can be set in vcl_fetch, even if it
looks somewhat counter-intuitive:

sub vcl_fetch {
if (obj.http.set-cookie) {
set obj.ttl = 10s;
pass;
}
}

Fixes #425

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

15 years agoAdd "no match" operator !~ to VCL regexps
phk [Mon, 19 Jan 2009 13:46:31 +0000 (13:46 +0000)]
Add "no match" operator !~ to VCL regexps

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

15 years agoBe much more BOFH about bereq, more asserts, free them where they
phk [Mon, 19 Jan 2009 12:58:44 +0000 (12:58 +0000)]
Be much more BOFH about bereq, more asserts, free them where they
obviously should be freed.

This could fix 421 or make it much worse, but give us more info.

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

15 years agoMake make dist happier; distribute the files we need
tfheen [Mon, 19 Jan 2009 12:44:57 +0000 (12:44 +0000)]
Make make dist happier; distribute the files we need

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

15 years agoAdd a new paramter "purge_hash" which defaults to "off".
phk [Mon, 19 Jan 2009 11:45:03 +0000 (11:45 +0000)]
Add a new paramter "purge_hash" which defaults to "off".

Only save the hash-string in the session workspace and objects when
this paramter is set to "on".

For sites with many small objects, this will save significant VM.

When this paramter is set to "off", the "purge.hash" facility will
not work, but this should not be a problem, because the new purging
facility allow much more expressive purging, the typical case
being:

purge req.http.host ~ www.foo.com && req.url ~ "article2383"

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

15 years agoMove the vca_pipes to a more proper header file
phk [Mon, 19 Jan 2009 09:48:16 +0000 (09:48 +0000)]
Move the vca_pipes to a more proper header file

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

15 years agoMove the fiddling of banned objects to cache_ban.c
phk [Mon, 19 Jan 2009 09:36:07 +0000 (09:36 +0000)]
Move the fiddling of banned objects to cache_ban.c

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

15 years agoA couple of FlexeLint nits
phk [Mon, 19 Jan 2009 09:22:49 +0000 (09:22 +0000)]
A couple of FlexeLint nits

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

15 years agoList referenced, but gone purges, mark them with a "G"
phk [Sun, 18 Jan 2009 16:57:29 +0000 (16:57 +0000)]
List referenced, but gone purges, mark them with a "G"

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

15 years agoAdd a protective object to prevent purge.list from pruning our
phk [Sun, 18 Jan 2009 16:57:06 +0000 (16:57 +0000)]
Add a protective object to prevent purge.list from pruning our
purges before we test their numbers.

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

15 years agoSet cost 10 on regexp tests.
phk [Sun, 18 Jan 2009 16:43:46 +0000 (16:43 +0000)]
Set cost 10 on regexp tests.

Let purge.list prune the tail of the list before dumping.

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

15 years agoAdd the ability to purge on random request or object headers.
phk [Sun, 18 Jan 2009 16:25:54 +0000 (16:25 +0000)]
Add the ability to purge on random request or object headers.

For instance:

purge req.http.host ~ www.foo.com && req.url ~ "\.png$"
purge obj.http.set-cookie ~ USER=383839

Now, why would you want purge on request headers and not object headers ?

Simple, some information the object does not have, the Host: header is
a good example.

Assuming that the Host: header is part of the hash we use to lookup
an object (as is the default), we can avoid copying that field into
the object (saving memory: O(nObjects)) by using the request value
to purge against.

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

15 years agoImplement exact matching and negatives for bans.
phk [Sun, 18 Jan 2009 15:42:29 +0000 (15:42 +0000)]
Implement exact matching and negatives for bans.

You can now purge using these four conditionals:

purge req.url == "/diediedie.html"
purge req.url != "/index.html"
purge req.url !~ "\.html$"
purge req.url ~ "\.jpg$"

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

15 years agoDon't list gone bans.
phk [Sun, 18 Jan 2009 15:14:54 +0000 (15:14 +0000)]
Don't list gone bans.

Emit && \ for line continuation.

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

15 years agoProperly quote the ban descriptions.
phk [Sun, 18 Jan 2009 14:54:41 +0000 (14:54 +0000)]
Properly quote the ban descriptions.

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

15 years agoMove the body of cli_quote() to vsb_quote() and give it a, presently
phk [Sun, 18 Jan 2009 14:50:20 +0000 (14:50 +0000)]
Move the body of cli_quote() to vsb_quote() and give it a, presently
unused, "how" argument flag.

We currently have far too many "quote this string properly" implementations
in varnish, hopefully, this will replace most of them.

Once this stabilizes, vsb_quote() will be contributed back to FreeBSD.

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

15 years agoredo the purge.list function with proper locking
phk [Sun, 18 Jan 2009 14:26:32 +0000 (14:26 +0000)]
redo the purge.list function with proper locking

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

15 years agoAfter HSH_Lookup() returns NULL indicating a busy object, we diddled
phk [Wed, 14 Jan 2009 20:40:54 +0000 (20:40 +0000)]
After HSH_Lookup() returns NULL indicating a busy object, we diddled
the session a bit to transfer the per-request stats to the session
counters with SES_Charge().

Not only was it inconsistent to charge accounting data in the middle
of a request, it was also illegal because after the hash lock was
released we no longer owned the session.

Once a system is under sufficient load that there is a queue for the
CPU, a race could happen where upon hitting a busy object, the hash lock
was released, another thread would schedule, finish the busy object,
start the sessions on the waiting list, finish off the request we had
and then when we get the cpu again and access it, it's gone.

The previous commit (r3512) eliminated the need to call SES_Charge,
this commit removes the (option) shmlog message inside the hash lock
thus, hopefully, eliminating the race that caused #418.

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

15 years agoOriginally we shaved 64 bytes from the session to the worker thread
phk [Wed, 14 Jan 2009 20:28:27 +0000 (20:28 +0000)]
Originally we shaved 64 bytes from the session to the worker thread
by keeping the current requests accounting stats in the worker thread.

For reasons which will be explained in the next commit, this is no
longer a good idea, and this commit moves these counters from
the worker thread to the session at a slight but all in all
trivial cost in memory footprint.

Remove the call to SES_Charge() when we hit a busy object, it is
not necessary to clean the worker thread counters here now.

Move these counters from the worker thread to the see

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

15 years agoAdd testcase for cli:purge
phk [Tue, 13 Jan 2009 14:18:54 +0000 (14:18 +0000)]
Add testcase for cli:purge

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

15 years agoAdd CLI_PURGE definition
phk [Tue, 13 Jan 2009 14:18:08 +0000 (14:18 +0000)]
Add CLI_PURGE definition

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

15 years agoCommit the old urge facilities to the new world order.
phk [Tue, 13 Jan 2009 14:05:54 +0000 (14:05 +0000)]
Commit the old urge facilities to the new world order.

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

15 years agoChange the way bans/purges are stored, so that each ban has a list of
phk [Tue, 13 Jan 2009 12:30:14 +0000 (12:30 +0000)]
Change the way bans/purges are stored, so that each ban has a list of
conditions to test.

This paves the way for a much more expressive ban/purge syntax where
things like:

purge req.http.host ~ "web1.com" && req.url ~ "\.png"
purge obj.age > 1w && obj.size > 1MB
purge obj.http.set-cookie ~ "USER=838339" && req.url ~ "\.html"

become possible.

Not quite there yet though.

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

15 years agoDitch HSH_Compare() and just check the digest with memcmp()
phk [Mon, 12 Jan 2009 13:51:33 +0000 (13:51 +0000)]
Ditch HSH_Compare() and just check the digest with memcmp()

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

15 years agodon't overload the waiting list (yet), I suspect it causes #414b
phk [Mon, 12 Jan 2009 13:19:14 +0000 (13:19 +0000)]
don't overload the waiting list (yet), I suspect it causes #414b

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

15 years agoExpand critbit test for more coverage
phk [Mon, 12 Jan 2009 13:13:59 +0000 (13:13 +0000)]
Expand critbit test for more coverage

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

15 years agoMake SHA256 digest standard and use it in hash_classic.c
phk [Mon, 12 Jan 2009 13:09:51 +0000 (13:09 +0000)]
Make SHA256 digest standard and use it in hash_classic.c

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

15 years agoAdd a minimal testcase of critbit
phk [Mon, 12 Jan 2009 12:57:30 +0000 (12:57 +0000)]
Add a minimal testcase of critbit

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

15 years agoAddendum to r3501: remove the file from the list.
phk [Sat, 10 Jan 2009 22:49:44 +0000 (22:49 +0000)]
Addendum to r3501: remove the file from the list.

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

15 years agoDon't panic if we fail to delete shared objects in atexit().
phk [Sat, 10 Jan 2009 22:30:04 +0000 (22:30 +0000)]
Don't panic if we fail to delete shared objects in atexit().

Fixes #376

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

15 years agoDon't panic if the chunked header is ridiculously long, just fail
phk [Sat, 10 Jan 2009 22:27:39 +0000 (22:27 +0000)]
Don't panic if the chunked header is ridiculously long, just fail
the transaction.

Fixes #387

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

15 years agoThis is a regression test
phk [Sat, 10 Jan 2009 22:14:58 +0000 (22:14 +0000)]
This is a regression test

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

15 years agoIf we get more HTTP headers than we have room for (default: 28) we
phk [Sat, 10 Jan 2009 22:11:26 +0000 (22:11 +0000)]
If we get more HTTP headers than we have room for (default: 28) we
used to ignore the rest.

This is not a bright solution if crucial HTTP headers like
"Content-Length" or "Transfer-Encoding" are last and get ignored.

In general, it is highly suspect to randomly ignore HTTP headers,
as opposed to deliberately ignoring them, either by having first
looked at them and found them uninteresting, or by having looked
for the headers we care about, and having not matched some others.

Change too many headers to firm error condition: 400 if from the
client, and 503 (like every other trouble) if from the backend.

Fixes #416

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

15 years agoMinor polishing for the benefit of Glorius Checker of Code FlexeLint.
phk [Sun, 21 Dec 2008 18:42:48 +0000 (18:42 +0000)]
Minor polishing for the benefit of Glorius Checker of Code FlexeLint.

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

15 years agoMake vsb_new() a tad easier for FlexeLint to figure out.
phk [Sun, 21 Dec 2008 18:41:43 +0000 (18:41 +0000)]
Make vsb_new() a tad easier for FlexeLint to figure out.

Give it proper semantics

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

15 years agoProperly ignore the return value from cli_readres(), we get it in status.
phk [Sun, 21 Dec 2008 18:40:35 +0000 (18:40 +0000)]
Properly ignore the return value from cli_readres(), we get it in status.

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

15 years agoSet the status to CLIS_COMMS if we fal to read the body.
phk [Sun, 21 Dec 2008 18:40:10 +0000 (18:40 +0000)]
Set the status to CLIS_COMMS if we fal to read the body.

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

15 years agoRemove pointless initialization.
phk [Sun, 21 Dec 2008 18:35:47 +0000 (18:35 +0000)]
Remove pointless initialization.

Fix indentation.

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

15 years agoBe more stringent about our timeout: fail even if we did get a
phk [Sun, 21 Dec 2008 18:35:24 +0000 (18:35 +0000)]
Be more stringent about our timeout: fail even if we did get a
socket, but took to.

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

15 years agoCheck close(2) status.
phk [Sun, 21 Dec 2008 18:34:39 +0000 (18:34 +0000)]
Check close(2) status.
Assert that we read the C-source file.

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

15 years agoAssert that realloc() did.
phk [Sun, 21 Dec 2008 18:34:02 +0000 (18:34 +0000)]
Assert that realloc() did.

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

15 years agoremove pointless assignment
phk [Sun, 21 Dec 2008 18:33:44 +0000 (18:33 +0000)]
remove pointless assignment

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

15 years agoAssert fcntl(2) have not failed.
phk [Sun, 21 Dec 2008 18:33:30 +0000 (18:33 +0000)]
Assert fcntl(2) have not failed.

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

15 years agoMore flexelinting.
phk [Sun, 21 Dec 2008 17:46:51 +0000 (17:46 +0000)]
More flexelinting.

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

15 years agoFlexelint'ing
phk [Sun, 21 Dec 2008 17:40:50 +0000 (17:40 +0000)]
Flexelint'ing

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

15 years agoAdjust to VCL_RET_* being enum instead of bitmap.
phk [Sun, 21 Dec 2008 17:03:37 +0000 (17:03 +0000)]
Adjust to VCL_RET_* being enum instead of bitmap.

This solves the "restart" procaction issue in a non-hackish way
and looks better overall.

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

15 years agoGenerate VCL_RET_* as enumbering instead of bitmap, compensate
phk [Sun, 21 Dec 2008 17:01:58 +0000 (17:01 +0000)]
Generate VCL_RET_* as enumbering instead of bitmap, compensate
elsewhere as required.

Remove unecessary args to VCL_[RM]ET_MAC().

Rely on VCL_RET_* definition in vcl.h

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

15 years agoMove the enum MET/RET macros to vcl.h
phk [Sun, 21 Dec 2008 16:19:14 +0000 (16:19 +0000)]
Move the enum MET/RET macros to vcl.h

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

15 years agoMove the enum MET/RET macros to vcl.h
phk [Sun, 21 Dec 2008 16:18:39 +0000 (16:18 +0000)]
Move the enum MET/RET macros to vcl.h

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

15 years agoFlexelint adjustments
phk [Sun, 21 Dec 2008 10:56:11 +0000 (10:56 +0000)]
Flexelint adjustments

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

15 years agoMake VCC_Return_Name() return lower case, and use it also for the SMH
phk [Sun, 21 Dec 2008 10:55:53 +0000 (10:55 +0000)]
Make VCC_Return_Name() return lower case, and use it also for the SMH
logging.

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

15 years agoUse VCC_Return_Name() instead of rolling our own.
phk [Sun, 21 Dec 2008 10:47:09 +0000 (10:47 +0000)]
Use VCC_Return_Name() instead of rolling our own.

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

15 years agoAdd a VCC_Return_Name() function to convert a return action to a string.
phk [Sun, 21 Dec 2008 10:46:34 +0000 (10:46 +0000)]
Add a VCC_Return_Name() function to convert a return action to a string.

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

15 years agoMake it entirely clear to the compiler that the WRONG() macro stops
phk [Sun, 21 Dec 2008 10:45:33 +0000 (10:45 +0000)]
Make it entirely clear to the compiler that the WRONG() macro stops

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

15 years agoThis is a bandaid for a pointer dereference when "restart" is used.
phk [Sat, 20 Dec 2008 23:47:45 +0000 (23:47 +0000)]
This is a bandaid for a pointer dereference when "restart" is used.

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

15 years agoRemove http_GetProto(), it's unused.
phk [Sat, 20 Dec 2008 23:27:00 +0000 (23:27 +0000)]
Remove http_GetProto(), it's unused.

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

15 years agoAssert lock properly held, inspired by unease about #378.
phk [Thu, 18 Dec 2008 12:16:45 +0000 (12:16 +0000)]
Assert lock properly held, inspired by unease about #378.

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

15 years agoOnly fail -T argument if none of the addresses it resolves to
phk [Thu, 18 Dec 2008 12:00:43 +0000 (12:00 +0000)]
Only fail -T argument if none of the addresses it resolves to
can be listend on.

Fixes #97

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

15 years agoAdd test for two corner cases in backend body determination.
phk [Thu, 18 Dec 2008 11:48:56 +0000 (11:48 +0000)]
Add test for two corner cases in backend body determination.

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

15 years agoAdd regression test for #400
phk [Thu, 18 Dec 2008 11:30:17 +0000 (11:30 +0000)]
Add regression test for #400

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

15 years agoChange the logic that decides when we attempt EOF fetches from the
phk [Thu, 18 Dec 2008 11:30:02 +0000 (11:30 +0000)]
Change the logic that decides when we attempt EOF fetches from the
backend.

The new logic is:
If (HEAD) /* happens only on pass */
do not fetch body.
else if (Content-Length)
fetch body according to length
else if (chunked)
fetch body as chunked
else if (other transfer-encoding)
fail
else if (Connection: keep-alive)
fetch no body, set Length = 0
else if (Connection: close)
fetch body until EOF
else if (HTTP < 1.1)
fetch body until EOF
else
fetch no body, set Length = 0

let me know if this breaks anything that should work.

Fixes #400

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

15 years agoWe should have a body length on a 200 reply
phk [Thu, 18 Dec 2008 10:58:17 +0000 (10:58 +0000)]
We should have a body length on a 200 reply

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