]> err.no Git - varnish/log
varnish
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

15 years agoAdd regressiont test for #409
phk [Thu, 18 Dec 2008 10:32:48 +0000 (10:32 +0000)]
Add regressiont test for #409

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

15 years agoAdd a missing newline
phk [Thu, 18 Dec 2008 10:32:30 +0000 (10:32 +0000)]
Add a missing newline

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

15 years agoAdd a missing error check.
phk [Thu, 18 Dec 2008 10:31:08 +0000 (10:31 +0000)]
Add a missing error check.

Fixes #409

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

15 years agoAdd regression test for ticket 412
phk [Thu, 18 Dec 2008 10:13:42 +0000 (10:13 +0000)]
Add regression test for ticket 412

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

15 years agoA bit of cleanup while I ponder ticket 412:
phk [Thu, 18 Dec 2008 10:04:15 +0000 (10:04 +0000)]
A bit of cleanup while I ponder ticket 412:

make VBE_free_bereq() and HSH_Deref() null their argument pointer.

Add HSH_Drop() for deorbiting unwanted busy objects.

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

15 years agoChanged rpm summary string as requested by the Fedora project
ingvar [Thu, 18 Dec 2008 09:47:05 +0000 (09:47 +0000)]
Changed rpm summary string as requested by the Fedora project

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

15 years agoFixed so that server_host is the hostname and not IP, as javscript will fail if the...
petter [Fri, 12 Dec 2008 11:47:32 +0000 (11:47 +0000)]
Fixed so that server_host is the hostname and not IP, as javscript will fail if the URL doesn't match.

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

15 years agoInitial checkin of a work in progress of the web GUI
petter [Fri, 12 Dec 2008 10:10:05 +0000 (10:10 +0000)]
Initial checkin of a work in progress of the web GUI

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

15 years agoAdd support for, and use a new syntax for terminating actions in VCL,
phk [Tue, 9 Dec 2008 13:54:09 +0000 (13:54 +0000)]
Add support for, and use a new syntax for terminating actions in VCL,
basically "return(action)" instead of just "action".

The previos syntax is still available.

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

15 years agoIncrease session workspace to 16k
phk [Mon, 8 Dec 2008 12:37:42 +0000 (12:37 +0000)]
Increase session workspace to 16k

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

15 years agoSilence debug noise
phk [Mon, 8 Dec 2008 10:16:25 +0000 (10:16 +0000)]
Silence debug noise

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

15 years agoImplement the cooling period before objhead's are deleted in the
phk [Mon, 8 Dec 2008 10:03:31 +0000 (10:03 +0000)]
Implement the cooling period before objhead's are deleted in the
critbit hasher.

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

15 years agoResolve the remove/lookup race the simple way.
phk [Wed, 3 Dec 2008 16:40:45 +0000 (16:40 +0000)]
Resolve the remove/lookup race the simple way.

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

15 years agoAnd as always I forgot to svn add the new file...
phk [Wed, 3 Dec 2008 10:50:04 +0000 (10:50 +0000)]
And as always I forgot to svn add the new file...

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

15 years agoAdd preliminary version of lock-less tree based lookup (see below)
phk [Wed, 3 Dec 2008 10:49:34 +0000 (10:49 +0000)]
Add preliminary version of lock-less tree based lookup (see below)

Enable SHA256 digests by default, and put it in the objhead.  This
increases the size of the objhead by 32 bytes, but may drop
a bit again later, when other now unnecessary fields go away.

Test SHA256 for correct operation on startup.

About the "critbit" lookup:

To enable this, use "-hcritbit" argument.

"Crit Bit" trees, are also known under various other names, the original
version of the idea is probably the PATRICIA tree.

The basic concept is a tree structure which has nodes only where necessary
to tell the indices apart.

Our version of it, has some additional bells and whistles.

First lookups do not require any locks until we reach the objhead
we were looking for, or until we need to insert one which wasn't
there.

Second, the branch nodes are part of the objhead, as all but the
very first will need one, this saves malloc operations big time.

Now the down-sides:

There are still missing bits, amongst these the "cooling off" list,
for objheads that have been dereferenced, but where the branch-node
is not.  Currently we just leak that memory.

There is a race relating to node deref and unlocked lookup that is
not closed, weird things may happen until I fix it.

I'd be interested to hear how long it survives before it croaks,
but apart from that, would not advocate that you use it, until
I fix those remaining issues.

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

15 years agoWrap some long lines
phk [Wed, 3 Dec 2008 10:39:15 +0000 (10:39 +0000)]
Wrap some long lines

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

15 years agoFix an embarrasing bug in my Flexlinting of this code yesterday, and
phk [Tue, 2 Dec 2008 20:48:11 +0000 (20:48 +0000)]
Fix an embarrasing bug in my Flexlinting of this code yesterday, and
add a couple of test-vectors to avoid it happening again.

And now for the funny and educational story:

In july of 1994, I added the "libmd" to FreeBSD, containing the
MD2, MD4 and MD5 functions from RFC 1319, RFC 1186 and RFC1321.

I meticulously replicated the test-vectors from the RFCs, so that
"make test" would validate the result.

Duing the intermediate 14 years, various slight shifts and adjustments
to things like the make(1) programs defaults, the shared library
resolution algorithm and other totally unrelated things, meant that
"make test" now tests the installed version of the library, rather
than the version you just built with "make all".

Needless to say, when I tested my patch yesterday, I didn't install
the built version, wanting first to hear what Colin Percival, FreeBSD
Security Wiz, generally swell fella and the guy who wrote this
SHA256 implementation, thought of these "stylistic" patches.

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

15 years agoFix build on !FreeBSD systems.
phk [Mon, 1 Dec 2008 22:17:37 +0000 (22:17 +0000)]
Fix build on !FreeBSD systems.

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

15 years agoVarious minor cleanups while we wait...
phk [Mon, 1 Dec 2008 21:46:20 +0000 (21:46 +0000)]
Various minor cleanups while we wait...

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

15 years agoShut FlexeLint up about SHA256 implementation.
phk [Mon, 1 Dec 2008 21:34:53 +0000 (21:34 +0000)]
Shut FlexeLint up about SHA256 implementation.

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

15 years agoWe cannot gain a reference to an object unless it has an objhead,
phk [Mon, 1 Dec 2008 20:24:46 +0000 (20:24 +0000)]
We cannot gain a reference to an object unless it has an objhead,
assert that we have one.

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

15 years agoSupress stats in the curses mode until we have see a non-zero value.
phk [Mon, 1 Dec 2008 14:13:49 +0000 (14:13 +0000)]
Supress stats in the curses mode until we have see a non-zero value.

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

15 years agoAlways release WRW, also on error.
phk [Wed, 26 Nov 2008 16:10:19 +0000 (16:10 +0000)]
Always release WRW, also on error.

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

15 years agoAdd asserts to find where WRW is leaking in ticket 390
phk [Wed, 26 Nov 2008 12:05:44 +0000 (12:05 +0000)]
Add asserts to find where WRW is leaking in ticket 390

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

15 years agoAdd code to calculate a SHA256 over the hash string if param hash_sha256
phk [Tue, 25 Nov 2008 16:04:47 +0000 (16:04 +0000)]
Add code to calculate a SHA256 over the hash string if param hash_sha256
is set.

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

15 years agoMake it possible to declare paramters in other source files, and move
phk [Tue, 25 Nov 2008 14:09:39 +0000 (14:09 +0000)]
Make it possible to declare paramters in other source files, and move
the thread-pool related params into a new file mgt_pool.c as proof.

The paramters happen in management process context, and should therefore
not end up in cache_* files for namespace and sanity reasons.

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

15 years agoName that file "vparam.h" instead of "param.h" which is just too
phk [Tue, 25 Nov 2008 13:44:52 +0000 (13:44 +0000)]
Name that file "vparam.h" instead of "param.h" which is just too
generic for comfort.

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

15 years agoMove parameter declaration into a .h file of its own.
phk [Tue, 25 Nov 2008 13:42:40 +0000 (13:42 +0000)]
Move parameter declaration into a .h file of its own.

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

15 years agoSort the parameters alphabetically, it's too hard to find anything right
phk [Tue, 25 Nov 2008 13:39:15 +0000 (13:39 +0000)]
Sort the parameters alphabetically, it's too hard to find anything right
now.

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

15 years agoTry to get the endianess optimization working, by including an assortment
phk [Tue, 25 Nov 2008 12:02:10 +0000 (12:02 +0000)]
Try to get the endianess optimization working, by including an assortment
of possibly relevant headers and only go with the fast path if we have
credible information that this is a big-endian platform.

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

15 years agoNeuther the FreeBSD specifics of SHA256 implementation.
phk [Tue, 25 Nov 2008 11:45:59 +0000 (11:45 +0000)]
Neuther the FreeBSD specifics of SHA256 implementation.

In the end, it comes down to lack of POSIX definition of a way to find
out byte-endianess, sigh...

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

15 years agoAdd a parameter to enable SHA256 hashing.
phk [Tue, 25 Nov 2008 11:09:38 +0000 (11:09 +0000)]
Add a parameter to enable SHA256 hashing.

This does not do anything yet.

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

15 years agoHook SHA256 into the build
phk [Tue, 25 Nov 2008 11:07:39 +0000 (11:07 +0000)]
Hook SHA256 into the build

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

15 years agoAdd SHA256 hashing code.
phk [Tue, 25 Nov 2008 11:07:19 +0000 (11:07 +0000)]
Add SHA256 hashing code.

This code was written by Colin Percival for the FreeBSD project.

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

15 years agoIsolate some hash-string building nastyness in cache_hash.c
phk [Tue, 25 Nov 2008 10:20:16 +0000 (10:20 +0000)]
Isolate some hash-string building nastyness in cache_hash.c

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

15 years agoWhen we receive an If-Modified-Since on an ESI object, do not process the conditional
phk [Tue, 25 Nov 2008 08:37:34 +0000 (08:37 +0000)]
When we receive an If-Modified-Since on an ESI object, do not process the conditional
for the child object and pretend to send a 304 reply for them, if we have decided to
deliver the main object.

Fixes #386

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

15 years agoLog debugs with correct id
phk [Mon, 24 Nov 2008 20:21:51 +0000 (20:21 +0000)]
Log debugs with correct id

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

15 years agoControl the ESI parsing debug records with the esi_syntax bitmap parameter.
phk [Mon, 24 Nov 2008 19:44:36 +0000 (19:44 +0000)]
Control the ESI parsing debug records with the esi_syntax bitmap parameter.

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

15 years agoInclude relevant bit of ansidecl.h directly
tfheen [Mon, 24 Nov 2008 19:08:36 +0000 (19:08 +0000)]
Include relevant bit of ansidecl.h directly

Avoids build-dependency on binutils-dev

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

15 years agoRename the write-buffering functions to WRW_*().
phk [Mon, 24 Nov 2008 17:47:21 +0000 (17:47 +0000)]
Rename the write-buffering functions to WRW_*().

Make reservation and release explicit.

Add asserts that this it happens.

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

15 years agoMake the maximum record length in the shm log a paramter "shm_reclen".
phk [Mon, 24 Nov 2008 15:53:26 +0000 (15:53 +0000)]
Make the maximum record length in the shm log a paramter "shm_reclen".

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

15 years agoOnly emit debug message for writes that fail
phk [Mon, 24 Nov 2008 14:41:36 +0000 (14:41 +0000)]
Only emit debug message for writes that fail

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

15 years agoFix typo (s/timeout/interval/) in default parameters for backend health
tfheen [Mon, 24 Nov 2008 14:04:42 +0000 (14:04 +0000)]
Fix typo (s/timeout/interval/) in default parameters for backend health

Thanks to Jonny @ globo for noticing.

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

15 years agoLog write errors under SLT_Debug.
phk [Mon, 24 Nov 2008 13:03:41 +0000 (13:03 +0000)]
Log write errors under SLT_Debug.

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

15 years agoUse == for comparison.
phk [Mon, 24 Nov 2008 12:30:29 +0000 (12:30 +0000)]
Use == for comparison.

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

15 years agoCount ESI processed objects in acct.bodybytes
phk [Mon, 24 Nov 2008 12:27:25 +0000 (12:27 +0000)]
Count ESI processed objects in acct.bodybytes

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

15 years agoDo not count chunked encoding headers in stat.hdrbytes.
phk [Mon, 24 Nov 2008 12:24:55 +0000 (12:24 +0000)]
Do not count chunked encoding headers in stat.hdrbytes.

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

15 years agoEliminate <vis.h> and it's compat version, it is unused.
phk [Mon, 24 Nov 2008 10:17:24 +0000 (10:17 +0000)]
Eliminate <vis.h> and it's compat version, it is unused.

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

15 years agoUpdate license to remove the advertising clause, reflecting similar change
phk [Mon, 24 Nov 2008 10:05:55 +0000 (10:05 +0000)]
Update license to remove the advertising clause, reflecting similar change
in the FreeBSD original.

Approved by: des

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

15 years agoFix typo
tfheen [Sat, 22 Nov 2008 01:35:16 +0000 (01:35 +0000)]
Fix typo

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

15 years agoAlso run the VCL->C compiler stage in a sub-process.
phk [Fri, 21 Nov 2008 13:00:35 +0000 (13:00 +0000)]
Also run the VCL->C compiler stage in a sub-process.

This isolates the mangement process from the compilers bugs
and memory usage.

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

15 years agoMake it possible to supress all or no lines of output
phk [Fri, 21 Nov 2008 12:53:34 +0000 (12:53 +0000)]
Make it possible to supress all or no lines of output

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

15 years agoSimplify how we manage the -f argument:
phk [Fri, 21 Nov 2008 12:09:46 +0000 (12:09 +0000)]
Simplify how we manage the -f argument:

The VCL file specified to -f must be read relative to the directory
from which varnishd is started, before we chdir to the workdir.

We used to deal with this by opening the file and passing the file
handle down.  It's simpler to just read the file and pass the actual
VCL code down.

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

15 years agoAdd a vreadfile() utility function, which reads a file into malloc'ed
phk [Fri, 21 Nov 2008 11:32:56 +0000 (11:32 +0000)]
Add a vreadfile() utility function, which reads a file into malloc'ed
memory

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