]> err.no Git - varnish/log
varnish
16 years agoWe don't need cryptographic-strength randomness here. Try /dev/urandom
des [Thu, 21 Feb 2008 21:14:57 +0000 (21:14 +0000)]
We don't need cryptographic-strength randomness here.  Try /dev/urandom
first, then /dev/random, then fall back to pid and time.  Using an
uninitialized stack variable as seed is just silly, and Coverity rightly
complains about it (CID#19)

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

16 years agoDump some information about the VCL configuration if we have one.
des [Thu, 21 Feb 2008 20:55:08 +0000 (20:55 +0000)]
Dump some information about the VCL configuration if we have one.

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

16 years agoWhere applicable, use SPAZ() instead of AZ().
des [Thu, 21 Feb 2008 20:50:16 +0000 (20:50 +0000)]
Where applicable, use SPAZ() instead of AZ().

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

16 years agoAdd SPAZ() and SPAN() macros which combine AZ() and AN() with spassert().
des [Thu, 21 Feb 2008 20:49:11 +0000 (20:49 +0000)]
Add SPAZ() and SPAN() macros which combine AZ() and AN() with spassert().

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

16 years agoTypo patrol
ssm [Wed, 20 Feb 2008 13:39:59 +0000 (13:39 +0000)]
Typo patrol

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

16 years agoDebian packaging: Disable running of varnishlog by default
ssm [Wed, 20 Feb 2008 12:02:07 +0000 (12:02 +0000)]
Debian packaging: Disable running of varnishlog by default

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

16 years agoCount directors as backends.
phk [Wed, 20 Feb 2008 10:59:25 +0000 (10:59 +0000)]
Count directors as backends.

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

16 years agoMake logging of mutex operations or just contests controlled under diag_bitmap
phk [Tue, 19 Feb 2008 12:05:41 +0000 (12:05 +0000)]
Make logging of mutex operations or just contests controlled under diag_bitmap

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

16 years agoOops, this should not have been deleted in my previous commit
phk [Tue, 19 Feb 2008 12:00:47 +0000 (12:00 +0000)]
Oops, this should not have been deleted in my previous commit

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

16 years agoIf HSH_Lookup() returns non-NULL, assert that sp->objhead != NULL.
des [Tue, 19 Feb 2008 11:57:04 +0000 (11:57 +0000)]
If HSH_Lookup() returns non-NULL, assert that sp->objhead != NULL.
HSH_Lookup() is supposed to guarantee this, but it appears that it
sometimes doesn't (perhaps a bug snuck in with grace mode?)

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

16 years agoMove the #include of heritage.h to cache.h.
phk [Tue, 19 Feb 2008 11:52:27 +0000 (11:52 +0000)]
Move the #include  of heritage.h to cache.h.

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

16 years agoRevise the kqueue_acceptor with a sledgehammer.
phk [Tue, 19 Feb 2008 11:10:12 +0000 (11:10 +0000)]
Revise the kqueue_acceptor with a sledgehammer.

Use EV_ONESHOT for all session events to make the kernel delete the
event when it fires, to remove any chance of any race with session
state and kqueue event arming.

For sessions with acceptfilter, this does just what we want (and I
kick myself for not realizing this much sooner).

For sessions where the acceptfilter is not enabled or has given up,
this results in an extra kevent arming operation for each read, but
this is still a much lower overhead than synchrnously deleting
the event when before passing the session on.

Delete all the workarounds and band-aids that had accumulated.

All in all, a win-win-win situation.

I have no idea how many tickets this will close.

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

16 years agoMove the assertions around; it is apparently possible to get a null event
des [Mon, 18 Feb 2008 17:04:30 +0000 (17:04 +0000)]
Move the assertions around; it is apparently possible to get a null event
on a session that no longer has the fd that the event was registered on.

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

16 years agoUncapitalize DIAGNOSTICS, since diag_bitmap is not related to the
phk [Mon, 18 Feb 2008 12:00:19 +0000 (12:00 +0000)]
Uncapitalize DIAGNOSTICS, since diag_bitmap is not related to the
#ifdef, which we retain for really heavy duty instrumentation, should
we ever need that.

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

16 years agoMove kqueue debugging under diag_bitmap control
phk [Mon, 18 Feb 2008 11:54:30 +0000 (11:54 +0000)]
Move kqueue debugging under diag_bitmap control

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

16 years agoMove the workspace debugging under diag_bitmap control.
phk [Mon, 18 Feb 2008 11:50:39 +0000 (11:50 +0000)]
Move the workspace debugging under diag_bitmap control.

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

16 years agoMove the logging of state engine states to use the diag_bitmap
phk [Mon, 18 Feb 2008 11:47:55 +0000 (11:47 +0000)]
Move the logging of state engine states to use the diag_bitmap
instead of #ifdef DIAGNOSTICS for control.

Also reduce VSL mutex cost by 50% for the common case where we have
a worker thread: We did a WSL_Flush() followed by a VSL(), doing a
WSL() before the WSL_FLush saves one VSL mutex op.

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

16 years agoMake a parameter "diag_bitflag" which can control deeper diagnostics for
phk [Mon, 18 Feb 2008 11:45:58 +0000 (11:45 +0000)]
Make a parameter "diag_bitflag" which can control deeper diagnostics for
us, instead of the #ifdef DIAGNOSTICS which is always not there when you
need it or there when you don't want it.

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

16 years agoKill debugging shmlogging overlooked for too long.
phk [Mon, 18 Feb 2008 11:04:35 +0000 (11:04 +0000)]
Kill debugging shmlogging overlooked for too long.

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

16 years agoAdd a stats field to monitor the LRU move rate.
phk [Mon, 18 Feb 2008 09:59:08 +0000 (09:59 +0000)]
Add a stats field to monitor the LRU move rate.

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

16 years agoAdd green icon.
des [Sun, 17 Feb 2008 23:36:12 +0000 (23:36 +0000)]
Add green icon.

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

16 years agoAdd a log message for short reads in the content-length case.
des [Sun, 17 Feb 2008 23:29:24 +0000 (23:29 +0000)]
Add a log message for short reads in the content-length case.
Also, clean up some variable names and declarations.

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

16 years agoA number of changes made while trying to reproduce #176:
des [Sun, 17 Feb 2008 22:37:41 +0000 (22:37 +0000)]
A number of changes made while trying to reproduce #176:

 - modify thread_log() to take an "errcode" argument (typically errno) so
   we don't have to sprinkle the code with strerror() calls.

 - read_line() and read_block() would sometimes unnecessarily log an error
   for a short read; let the caller decide whether a short read is
   acceptable.

 - reorder the if / else if / else blocks in receive_response() so the
   logic is easier to follow.

 - remove test code which we no longer need.

 - fix some style issues; there are still a couple of long lines, though.

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

16 years agoFix assert in thread_close() for fd == nthreads == 0.
des [Sun, 17 Feb 2008 10:02:07 +0000 (10:02 +0000)]
Fix assert in thread_close() for fd == nthreads == 0.

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

16 years agoUnfinished Firefox plugin.
des [Sun, 17 Feb 2008 09:32:50 +0000 (09:32 +0000)]
Unfinished Firefox plugin.

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

16 years agoNo longer necessary
des [Sun, 17 Feb 2008 09:28:44 +0000 (09:28 +0000)]
No longer necessary

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

16 years agoNo longer necessary
des [Sun, 17 Feb 2008 09:28:24 +0000 (09:28 +0000)]
No longer necessary

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

16 years agoFree leftover buffers when the loop ends (Coverity CID#10)
des [Sun, 17 Feb 2008 09:03:32 +0000 (09:03 +0000)]
Free leftover buffers when the loop ends (Coverity CID#10)

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

16 years agoMake sure buf is freed in error case (Coverity CID#9)
des [Sun, 17 Feb 2008 08:54:53 +0000 (08:54 +0000)]
Make sure buf is freed in error case (Coverity CID#9)

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

16 years agoRequest is bogus if df_m, df_Uq or df_H are NULL (Coverity CID#2, CID#3)
des [Sun, 17 Feb 2008 08:53:01 +0000 (08:53 +0000)]
Request is bogus if df_m, df_Uq or df_H are NULL (Coverity CID#2, CID#3)

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

16 years agoWe may get spurious events on an unclosed fd as well. It won't cause
des [Sat, 16 Feb 2008 11:03:37 +0000 (11:03 +0000)]
We may get spurious events on an unclosed fd as well.  It won't cause
any harm, but I still want to catch it early so we get a log entry for
it.

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

16 years agoFlexelint pleasing
phk [Fri, 15 Feb 2008 14:22:23 +0000 (14:22 +0000)]
Flexelint pleasing

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

16 years agoMake this cast less suspect to Flexelint
phk [Fri, 15 Feb 2008 13:35:22 +0000 (13:35 +0000)]
Make this cast less suspect to Flexelint

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

16 years agoUnused variable
phk [Fri, 15 Feb 2008 13:32:41 +0000 (13:32 +0000)]
Unused variable

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

16 years agoDefine VARNISH_STATE_DIR
phk [Fri, 15 Feb 2008 13:32:04 +0000 (13:32 +0000)]
Define VARNISH_STATE_DIR

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

16 years agoSomebody ate my ')' on the way to the commit.
phk [Fri, 15 Feb 2008 13:31:47 +0000 (13:31 +0000)]
Somebody ate my ')' on the way to the commit.

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

16 years agoTell if we could not write the PID file.
phk [Fri, 15 Feb 2008 13:19:49 +0000 (13:19 +0000)]
Tell if we could not write the PID file.

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

16 years agoFlexelint does not react to the assert, so tell it what we know.
phk [Fri, 15 Feb 2008 13:04:36 +0000 (13:04 +0000)]
Flexelint does not react to the assert, so tell it what we know.

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

16 years agoCheck VLU_Fd return for good measure.
phk [Fri, 15 Feb 2008 12:59:59 +0000 (12:59 +0000)]
Check VLU_Fd return for good measure.

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

16 years agoRemove a spurious debugging message.
phk [Fri, 15 Feb 2008 12:56:01 +0000 (12:56 +0000)]
Remove a spurious debugging message.
Account for the HTTP bits we do know about and handle.
Ignore return value from shutdown(2)

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

16 years agoAssert that VCC did its job with respect to weights.
phk [Fri, 15 Feb 2008 12:47:42 +0000 (12:47 +0000)]
Assert that VCC did its job with respect to weights.

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

16 years agoInsist on a non-zero weight for random director memebers and
phk [Fri, 15 Feb 2008 12:44:42 +0000 (12:44 +0000)]
Insist on a non-zero weight for random director memebers and

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

16 years agoDon't advance the token in vcc_UintVal(), that prevents precise
phk [Fri, 15 Feb 2008 12:42:48 +0000 (12:42 +0000)]
Don't advance the token in vcc_UintVal(), that prevents precise
error messages based on the value of the integer.

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

16 years agoUse the abort2(2) function to record our panic string, if we have it.
phk [Fri, 15 Feb 2008 12:30:47 +0000 (12:30 +0000)]
Use the abort2(2) function to record our panic string, if we have it.

Protect macros with do {....} while(0)

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

16 years agoAdd a paramter for maximum CLI buffer size and use it both in child
phk [Fri, 15 Feb 2008 11:52:41 +0000 (11:52 +0000)]
Add a paramter for maximum CLI buffer size and use it both in child
and manager.  To take effect, it must be specified with -p on the
command line.

Use VLU for managers CLI handling.

Note CLI connection events on stderr.

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

16 years agoGive uint parameters the same treatment as bool and timeouts: eliminate
phk [Fri, 15 Feb 2008 11:27:25 +0000 (11:27 +0000)]
Give uint parameters the same treatment as bool and timeouts: eliminate
a lot of silly trivial functions.

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

16 years agoRewrite the childs CLI handling to use VLU
phk [Fri, 15 Feb 2008 11:15:59 +0000 (11:15 +0000)]
Rewrite the childs CLI handling to use VLU

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

16 years agoRemove a duplicated message on the childs stdout.
phk [Fri, 15 Feb 2008 11:15:41 +0000 (11:15 +0000)]
Remove a duplicated message on the childs stdout.

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

16 years agoA Give VLU_New() an optional buffersize argument
phk [Fri, 15 Feb 2008 10:57:20 +0000 (10:57 +0000)]
A Give VLU_New() an optional buffersize argument

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

16 years agoLog everything we see on the childs stdout/stderr to syslog.
phk [Fri, 15 Feb 2008 10:36:21 +0000 (10:36 +0000)]
Log everything we see on the childs stdout/stderr to syslog.

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

16 years agoAdd VLU (Varnish Line Up) a copy of LineUp from my private utility library:
phk [Fri, 15 Feb 2008 10:34:42 +0000 (10:34 +0000)]
Add VLU (Varnish Line Up) a copy of LineUp from my private utility library:

A set of simple functions for cutting a byte stream into text-lines and
calling a function for each of them, as the they become available.

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

16 years agoAdd ALLOC_OBJ macro
phk [Fri, 15 Feb 2008 10:28:00 +0000 (10:28 +0000)]
Add ALLOC_OBJ macro

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

16 years agoMove the sizeof debugging output to an undocumented debug.sizeof
phk [Fri, 15 Feb 2008 10:08:02 +0000 (10:08 +0000)]
Move the sizeof debugging output to an undocumented debug.sizeof
CLI command.

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

16 years agoremove dump.pool prototype
phk [Fri, 15 Feb 2008 10:02:45 +0000 (10:02 +0000)]
remove dump.pool prototype

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

16 years agoremove the undocumented and unimplemented dump.pool command
phk [Fri, 15 Feb 2008 10:01:19 +0000 (10:01 +0000)]
remove the undocumented and unimplemented dump.pool command

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

16 years agoGive the param structure a void *priv, and use it to avoid a large
phk [Fri, 15 Feb 2008 09:41:23 +0000 (09:41 +0000)]
Give the param structure a void *priv, and use it to avoid a large
number of pointless trivial functions for bools and timeouts.

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

16 years agoAdjust to direct inclusion of config.h
phk [Fri, 15 Feb 2008 09:09:47 +0000 (09:09 +0000)]
Adjust to direct inclusion of config.h

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

16 years agoDetermine our backend (using the director) before we filter the req
phk [Fri, 15 Feb 2008 08:54:20 +0000 (08:54 +0000)]
Determine our backend (using the director) before we filter the req
into the bereq, in order to be able to assign a default Host: header
if there is none.

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

16 years agoPut a ULL suffix on numeric constants too large for 32 bit systems.
phk [Fri, 15 Feb 2008 08:33:41 +0000 (08:33 +0000)]
Put a ULL suffix on numeric constants too large for 32 bit systems.

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

16 years agoDetect and gracefully recover from what appears to be a bug in the FreeBSD
des [Fri, 15 Feb 2008 07:51:15 +0000 (07:51 +0000)]
Detect and gracefully recover from what appears to be a bug in the FreeBSD
kernel, which will sometimes report a null kqueue event.

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

16 years agoRegenerate
des [Wed, 13 Feb 2008 17:25:57 +0000 (17:25 +0000)]
Regenerate

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

16 years agoForgot config.h here
des [Wed, 13 Feb 2008 17:25:52 +0000 (17:25 +0000)]
Forgot config.h here

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

16 years agoNever mind trying to avoid libm, we already use it anyway.
des [Wed, 13 Feb 2008 17:19:52 +0000 (17:19 +0000)]
Never mind trying to avoid libm, we already use it anyway.

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

16 years agoEnable tests + allow overrides from command line.
des [Wed, 13 Feb 2008 17:12:59 +0000 (17:12 +0000)]
Enable tests + allow overrides from command line.

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

16 years agoSLT_Length is not relevant for backend requests.
des [Wed, 13 Feb 2008 17:10:04 +0000 (17:10 +0000)]
SLT_Length is not relevant for backend requests.

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

16 years agoDisable tools that require curses if no curses library was found.
des [Wed, 13 Feb 2008 14:58:48 +0000 (14:58 +0000)]
Disable tools that require curses if no curses library was found.

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

16 years agoUse #include "config.h" instead of -include config.h
des [Wed, 13 Feb 2008 13:55:39 +0000 (13:55 +0000)]
Use #include "config.h" instead of -include config.h

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

16 years agoRewrite str2bytes, add unit test
des [Wed, 13 Feb 2008 13:29:40 +0000 (13:29 +0000)]
Rewrite str2bytes, add unit test

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

16 years agoSome source files (especially in libraries) have embedded test
des [Wed, 13 Feb 2008 13:05:36 +0000 (13:05 +0000)]
Some source files (especially in libraries) have embedded test
programs.  Add a configure option and a corresponding automake
conditional to enable these tests.

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

16 years agoFix a bug relating to vbe_conn statistics counter.
phk [Wed, 13 Feb 2008 11:35:10 +0000 (11:35 +0000)]
Fix a bug relating to vbe_conn statistics counter.

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

16 years agoGo over the backend code and privatize a lot of stuff
phk [Wed, 13 Feb 2008 10:59:25 +0000 (10:59 +0000)]
Go over the backend code and privatize a lot of stuff
that now belongs only in cache_backend.c

Control the caching of bereq's via the parameter.

Found no bugs, so I think I will release -trunk for
adventurous testers again.

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

16 years agoAdd two new stat fields for counting bereq's and backends.
phk [Wed, 13 Feb 2008 10:57:17 +0000 (10:57 +0000)]
Add two new stat fields for counting bereq's and backends.

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

16 years agoAdd a parameter for controlling caching of vbe_conn structures.
phk [Wed, 13 Feb 2008 10:56:36 +0000 (10:56 +0000)]
Add a parameter for controlling caching of vbe_conn structures.

(the code that it controls follows in a minute)

I'm very interested to hear if there is any measurable effect
of this variable on heavily loaded systems.

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

16 years agoFix example to new backend syntax
phk [Wed, 13 Feb 2008 10:55:03 +0000 (10:55 +0000)]
Fix example to new backend syntax

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

16 years agoAdd information to \"-a\" about how to listen on multiple hosts or ports
ssm [Tue, 12 Feb 2008 06:52:33 +0000 (06:52 +0000)]
Add information to \"-a\" about how to listen on multiple hosts or ports

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

16 years agoUpdate backend declaration syntax. Note that a) vcl.7 needs a partial
des [Mon, 11 Feb 2008 10:46:09 +0000 (10:46 +0000)]
Update backend declaration syntax.  Note that a) vcl.7 needs a partial
rewrite to track this change, and b) there have been other changes which
also need to be merged in.

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

16 years agoSeparate the handling of backend and client requests, greatly simplifying
des [Mon, 11 Feb 2008 02:58:41 +0000 (02:58 +0000)]
Separate the handling of backend and client requests, greatly simplifying
both.

Skip piped requests, and requests that are interrupted by an error.  This
should eliminate or at least greatly reduce the (null)s seen in logs.

Fix a conditional that blocked backend requests from being printed.

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

16 years agoAlphabetize command-line options.
des [Sun, 10 Feb 2008 18:00:33 +0000 (18:00 +0000)]
Alphabetize command-line options.

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

16 years ago<sys/types.h> required by <sys/mman.h>
phk [Sat, 9 Feb 2008 15:59:21 +0000 (15:59 +0000)]
<sys/types.h> required by <sys/mman.h>

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

16 years agoMake the random director work, and remove the old code.
phk [Thu, 7 Feb 2008 09:54:42 +0000 (09:54 +0000)]
Make the random director work, and remove the old code.

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

16 years agoEmit the vcl_name from the backend host.
phk [Thu, 7 Feb 2008 09:53:28 +0000 (09:53 +0000)]
Emit the vcl_name from the backend host.

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

16 years agoRemove ident string from directors, they are not recycled.
phk [Thu, 7 Feb 2008 09:52:26 +0000 (09:52 +0000)]
Remove ident string from directors, they are not recycled.

Add vcl_name to backend hosts.  Simple backends get the obvious
name.  Directors inlined backend hosts gets the directors name
with an array suffix, for instance "b1[1]".

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

16 years agoUse the correct ident (nuke the other one) and do only one dns lookup.
phk [Thu, 7 Feb 2008 09:33:30 +0000 (09:33 +0000)]
Use the correct ident (nuke the other one) and do only one dns lookup.

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

16 years ago_islocked_np() was renamed to isowned_np() in FreeBSD.
des [Thu, 7 Feb 2008 01:40:15 +0000 (01:40 +0000)]
_islocked_np() was renamed to isowned_np() in FreeBSD.

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

16 years agoFirst part of major backend overhaul.
phk [Wed, 6 Feb 2008 15:19:49 +0000 (15:19 +0000)]
First part of major backend overhaul.

*** Please do not use -trunk in production until I say so again ***

I have not entirely decided in the precise terminology, so the following
may sound a lot more complicated than it really is:

In VCL we can now have "backends" and "directors" both of which we
treat as a "backend".

When we define backends and directors in VCL, they refer to "backend
hosts" which is just another way to say "hostname+portname" but later
these will grow other parameters (max connections etc).

A director is a piece of code that selects a "backend host" somehow,
"random" and "round-robin" are the first algorithms.  A backend
can still be specified directly of course, that's the "simple director"
that always return the same "backend host".

This is probably where an example is in order:

/* A backend as we know it */
backend b1 {
.host = "fs";
.port = "80";
}

/* A director */
director b2 random {
{
/* We can refer to named backends */
.backend        = b1;
.weight         = 7;
}
{
/* Or define them inline */
.backend        = {
.host = "fs2";
}
.weight         = 3;
}
}

sub vcl_recv {
if (req.url ~ "\[[a-z]]") {
set req.backend = b2;
} else {
set req.backend = b1;
}
}

This results in quite a lot of changes in the C code, VRT API and
VCL compiler, the major thrust being:

Directors like "simple" and "random" will not have to think about
the actual connections to the backends, but just concentrate on
selecting which backend should be used.

When a new VCL is loaded, it will instantiate all directors, but
try to reuse any preexisting "backend hosts" (which we still
call "backend" in the C code).

This is simple for a backend like "b1" in the example above, but
sligthly more complex for the backend inlined in b2.  The VCL
compiler solves this, by qualifying the ident string for the inlined
backend host with the prefix "b2 random :: 2 :: ", so that a reload
of the same director with the same (unchanged) inline backend host
will match, but none other will.

One implication of instantiating all directors for every VCL load,
is that private statistics cannot be reused, but stats on the
backend host can.  This is likely a very fine point of no consequence.

Once the backend is selected by the director, the generic code in
cache_backend.c will cope with reusing the connection pool,
establishing connections and all that, moving most of the nastyness
out of directors, leaving cache_dir_simple.c with only 96 lines of
code, of which the license is a large fraction.

Until now, we have done automatic DNS re-lookups, but they seem to
cause more grief than advantage (I suspect some of the DNS lookups
to be resposible for long timeouts), so that will be dropped, and
instead we might add an explicit CLI command for this later.

The code as here committed can handle a couple of simple requests,
but there are a large number of INCOMPL()'s that need to be resolved
before this is ready for prime time again.

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

16 years agoVBE_AddBackend() needs to always return the backend, so make it a pointer arg
phk [Wed, 6 Feb 2008 09:47:24 +0000 (09:47 +0000)]
VBE_AddBackend() needs to always return the backend, so make it a pointer arg
and use the return int to tell if it was a reuse.

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

16 years agoI forgot to include the vcl_name of the random director in the structure.
phk [Wed, 6 Feb 2008 09:43:22 +0000 (09:43 +0000)]
I forgot to include the vcl_name of the random director in the structure.

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

16 years agoAdd more settings to vcl-mode.el, and make them customizable
ssm [Wed, 6 Feb 2008 07:26:28 +0000 (07:26 +0000)]
Add more settings to vcl-mode.el, and make them customizable

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

16 years agoAdd vcl_fetch to list of subroutines
ssm [Wed, 6 Feb 2008 06:36:58 +0000 (06:36 +0000)]
Add vcl_fetch to list of subroutines

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

16 years agoPut vcl-mode.el nearer to working order
ssm [Tue, 5 Feb 2008 19:41:11 +0000 (19:41 +0000)]
Put vcl-mode.el nearer to working order
* Clean up unused functions
* Set default indent-level to 8
* Actually provide 'vcl-mode (quite useful)

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

16 years agoAdd the missing bits to actually allow discards of VCL code.
phk [Tue, 5 Feb 2008 11:19:22 +0000 (11:19 +0000)]
Add the missing bits to actually allow discards of VCL code.

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

16 years agoAdd a discard flag to the VCL_conf.
phk [Tue, 5 Feb 2008 10:50:33 +0000 (10:50 +0000)]
Add a discard flag to the VCL_conf.

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

16 years agoRename VBE_NewBackend() to VBE_AddBackend() and make it responsible for
phk [Tue, 5 Feb 2008 09:57:46 +0000 (09:57 +0000)]
Rename VBE_NewBackend() to VBE_AddBackend() and make it responsible for
the identity check for reusing backends between VCL.

Disable the round-robin code for now, I'm trying to get the random code
working first.

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

16 years agoWe assume that all CLI processing in the child process happens in the
phk [Tue, 5 Feb 2008 09:46:30 +0000 (09:46 +0000)]
We assume that all CLI processing in the child process happens in the
same thread (the main thread in fact).

Add an assert facility to mark the affected functions, just to make sure
nobody (else) gets an anciety attack over missing locking.

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

16 years agocli_out() already has NULL check.
phk [Tue, 5 Feb 2008 09:31:00 +0000 (09:31 +0000)]
cli_out() already has NULL check.

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

16 years agoAdd a VCL major mode for emacs
ssm [Tue, 5 Feb 2008 08:26:31 +0000 (08:26 +0000)]
Add a VCL major mode for emacs

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

16 years agoBackend fini functions are methods of the class, call the generic one.
phk [Mon, 4 Feb 2008 09:58:55 +0000 (09:58 +0000)]
Backend fini functions are methods of the class, call the generic one.

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

16 years agoAdd X-ref definition of random directors.
phk [Mon, 4 Feb 2008 09:55:53 +0000 (09:55 +0000)]
Add X-ref definition of random directors.

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

16 years agoComplete the VCC part of random directors, runtime code next.
phk [Mon, 4 Feb 2008 09:51:23 +0000 (09:51 +0000)]
Complete the VCC part of random directors, runtime code next.

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

16 years agoTypo patrol
ssm [Mon, 4 Feb 2008 09:35:53 +0000 (09:35 +0000)]
Typo patrol

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