]> err.no Git - varnish/log
varnish
16 years agoProperly truncate bytes before hexdumping.
phk [Thu, 24 Jul 2008 20:16:04 +0000 (20:16 +0000)]
Properly truncate bytes before hexdumping.

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

16 years agoTest caching of synthetic error pages (broken since 2266). This will need revisiting...
des [Thu, 24 Jul 2008 12:33:32 +0000 (12:33 +0000)]
Test caching of synthetic error pages (broken since 2266).  This will need revisiting once caching has been reimplemented.

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

16 years agoSet svn:keywords
des [Thu, 24 Jul 2008 12:24:17 +0000 (12:24 +0000)]
Set svn:keywords

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

16 years agoSet svn:keywords on files that didn't already have it
des [Thu, 24 Jul 2008 12:22:35 +0000 (12:22 +0000)]
Set svn:keywords on files that didn't already have it

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

16 years agoFix temp file names
des [Thu, 24 Jul 2008 12:21:30 +0000 (12:21 +0000)]
Fix temp file names

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

16 years agoCorrect copyright statement.
des [Thu, 24 Jul 2008 11:23:16 +0000 (11:23 +0000)]
Correct copyright statement.

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

16 years agoReindent
des [Thu, 24 Jul 2008 11:21:35 +0000 (11:21 +0000)]
Reindent

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

16 years agoMarkup
des [Thu, 24 Jul 2008 11:04:46 +0000 (11:04 +0000)]
Markup

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

16 years agoMake the manager respect the diag_bitmap for child core creation.
phk [Wed, 23 Jul 2008 21:10:17 +0000 (21:10 +0000)]
Make the manager respect the diag_bitmap for child core creation.

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

16 years agoPrevent loading multiple VCL's with the same name if the client is not
phk [Wed, 23 Jul 2008 21:04:12 +0000 (21:04 +0000)]
Prevent loading multiple VCL's with the same name if the client is not
there to stop us.

Fixes #281

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

16 years agoCopy&Paste'o
phk [Wed, 23 Jul 2008 20:57:40 +0000 (20:57 +0000)]
Copy&Paste'o

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

16 years agoMore Flexelint nitpickery
phk [Wed, 23 Jul 2008 17:37:44 +0000 (17:37 +0000)]
More Flexelint nitpickery

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

16 years agoFlexelint nits
phk [Wed, 23 Jul 2008 17:09:53 +0000 (17:09 +0000)]
Flexelint nits

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

16 years agoAdd a missing error check.
phk [Wed, 23 Jul 2008 17:04:53 +0000 (17:04 +0000)]
Add a missing error check.

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

16 years agoNote that this testcase may fail on linux.
phk [Wed, 23 Jul 2008 15:44:46 +0000 (15:44 +0000)]
Note that this testcase may fail on linux.

The problem is that a TCP connection to 127.0.0.1 appearantly does
not originate on the loopback interface, but on some other interface
on the machine.

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

16 years agoWe should not open the shm file until we have a cli connection, it
phk [Wed, 23 Jul 2008 15:34:40 +0000 (15:34 +0000)]
We should not open the shm file until we have a cli connection, it
might not be there yet.

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

16 years agoPrefix acl functions with "named_" and "anon_" to avoid naming conflicts.
phk [Wed, 23 Jul 2008 15:30:02 +0000 (15:30 +0000)]
Prefix acl functions with "named_" and "anon_" to avoid naming conflicts.

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

16 years agoDon't make assumptions about pthread_t
phk [Wed, 23 Jul 2008 15:21:48 +0000 (15:21 +0000)]
Don't make assumptions about pthread_t

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

16 years agouse strtod() instead of strtof()
phk [Wed, 23 Jul 2008 15:20:37 +0000 (15:20 +0000)]
use strtod() instead of strtof()

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

16 years agodon't make assumptions about pthread_t
phk [Wed, 23 Jul 2008 15:19:38 +0000 (15:19 +0000)]
don't make assumptions about pthread_t

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

16 years agoACL code rewrite:
phk [Wed, 23 Jul 2008 15:01:54 +0000 (15:01 +0000)]
ACL code rewrite:

Add IPv6 support (untested!)

Implement evil-acls

IPv6 support
------------

I have implemented IPv6 filtering support, but I have done so blindly
as I have no IPv6 networks to test with.

Please double check before relying on this to work, and please report
your findings back to us.

Syntax
------

The ACL rules still have the same syntax, but the sematics have
expanded to handle IPv6 also:

    acl foo {

        "foohost";              // Match, if the address is one of the
                                // ipv4 or ipv6 addresses of "foohost"

        ! "foohost";            // Fail, if...

        "192.168.1.7" / 24;     // Use mask for comparison:  The '7' is
                                // ignored

// Implicit masks:
!"172.16"; // Fail 172.16.0.0 to 172.16.255.255
"10.0.0"; // Match 10.0.0.0 to 10.0.0.255

        "www.freebsd.org" / 24; // This will give compile error, because
                                // the "www.freebsd.org" has both ipv4
                                // and ipv6 addresses, and using the same
                                // mask for both kinds do not make sense.

        ( ... );                // Ignore this rule if DNS lookup fails.

        ( ! "idiot.net" );      // If we can resolve "idiot.net", then
                                // return Failure to match, if we see them.
    }

Please notice that DNS lookup happens *only* on VCL compilation, if a
DNS record changes you need to recompile (ie: vcl.load or vcl.inline)
your VCL code again, it is not enough to just switch vcl (vcl.use).

(This is the same as with backend DNS lookups)

Evil-acls
---------

Most firewall or ip-filtering facilities, compile the lists of
networks and masks to a table, and matches proceed sequentially
through that table until the table is exhausted or a match is found.

Since we compile our ACLs into C-code, we might as well implement the
"evil-acl" concept, and compile the rules directly into C-code instead.

An ACL like this:

acl foo {
"172.16";
!"172.16.17";
"172.16.17.18";
"172.16"/18;
}

Compiles to:

if (fam == 2) {
 if (a[0] == 172) {
          if (a[1] == 16) {
           if (a[2] == 17) {
            if (a[3] == 18) {
             VRT_acl_log(sp, "MATCH bar " "172.16.17.18");
             return (1);
            }
            VRT_acl_log(sp, "NEG_MATCH bar " "172.16.17");
            return (0);
           }
           else if ((a[3] & 0xc0) == 0) {
            VRT_acl_log(sp, "MATCH bar " "172.16" "/18" );
            return (1);
           }
           VRT_acl_log(sp, "MATCH bar " "172.16");
           return (1);
          }
         }
        }
VRT_acl_log(sp, "NO_MATCH bar");
return (0);

As can be seen, for example the comparison with "172" is now shared
for all four rules in the ACL, instead of being carried out once for
each of the four rules.

In addition to this optimization, the C-compiler will of course use
its usual (and unusual) tricks to speed things up, quite likely inlining
the ACL code in the VCL functions where they are referenced.

It will also be noticed, that the compiler sorts the rules in "most
specific order".

This means that:
"172.16.17.18";
gets tested before
!"172.16.17";
even though it is listed later in the ACL.

Previously we tested the rules in the order given.

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

16 years agoUpdated the default.vcl and man page with the latest config from mgt_vcc.c.
petter [Wed, 23 Jul 2008 09:07:24 +0000 (09:07 +0000)]
Updated the default.vcl and man page with the latest config from mgt_vcc.c.
The following perl one-liner is useful:
perl -ne 'if( $print == 1 ) { exit if( /^$/ ); eval "print " . $_; } $print = 1 if /default_vcl/;' mgt_vcc.c
Fixes #135 (for now)

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

16 years agoAdd a counter for shmlog wraparounds.
phk [Tue, 22 Jul 2008 14:40:33 +0000 (14:40 +0000)]
Add a counter for shmlog wraparounds.

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

16 years agoconstage.
phk [Tue, 22 Jul 2008 14:40:13 +0000 (14:40 +0000)]
constage.

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

16 years agoUpdated the man page with the granularity option for the file storage.
petter [Tue, 22 Jul 2008 11:12:51 +0000 (11:12 +0000)]
Updated the man page with the granularity option for the file storage.

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

16 years agoForce -w thread limits
phk [Tue, 22 Jul 2008 09:59:41 +0000 (09:59 +0000)]
Force -w thread limits

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

16 years agorenovate tackle_warg()
phk [Tue, 22 Jul 2008 09:57:11 +0000 (09:57 +0000)]
renovate tackle_warg()

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

16 years agoAdded granularity as a subargument to the options for file storage:
petter [Tue, 22 Jul 2008 09:42:06 +0000 (09:42 +0000)]
Added granularity as a subargument to the options for file storage:
-s file,<dir_or_file>,<size>,<granularity>
Fixes #244

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

16 years agoslightly more delay seems necessary for stability.
phk [Tue, 22 Jul 2008 09:02:17 +0000 (09:02 +0000)]
slightly more delay seems necessary for stability.

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

16 years agoUse exit(4) when we don't want a panic coredump.
phk [Tue, 22 Jul 2008 08:37:41 +0000 (08:37 +0000)]
Use exit(4) when we don't want a panic coredump.

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

16 years agoAdd a testcase which panics the child, see the manager restart it.
phk [Tue, 22 Jul 2008 08:21:29 +0000 (08:21 +0000)]
Add a testcase which panics the child, see the manager restart it.

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

16 years agoAdd a "panic" vcl command, which does what you would expect.
phk [Tue, 22 Jul 2008 08:06:16 +0000 (08:06 +0000)]
Add a "panic" vcl command, which does what you would expect.

Takes a string argument, so it is possible to do:

 panic "Trouble with " req.url " (not the way I expected it!);

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

16 years agoAdded the variable server.port that holds the port on which the server has answered...
petter [Tue, 22 Jul 2008 07:52:00 +0000 (07:52 +0000)]
Added the variable server.port that holds the port on which the server has answered the request in the same way that server.ip holds the IP number. Fixes #264.

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

16 years agoAdd a cli_quote() function for quoting a string properly when reporting
phk [Tue, 22 Jul 2008 07:37:32 +0000 (07:37 +0000)]
Add a cli_quote() function for quoting a string properly when reporting
it in the CLI.

Use it for cc_command and listen_address parameters

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

16 years agoAccept comma separation for the -a subargs for consistency with -s and -h
phk [Tue, 22 Jul 2008 07:19:40 +0000 (07:19 +0000)]
Accept comma separation for the -a subargs for consistency with -s and -h

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

16 years agoAlso check the "stats" command.
phk [Sun, 20 Jul 2008 20:24:37 +0000 (20:24 +0000)]
Also check the "stats" command.

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

16 years agoAlso dump workspaces in panic.
phk [Sun, 20 Jul 2008 12:03:14 +0000 (12:03 +0000)]
Also dump workspaces in panic.

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

16 years agoIgnore a couple of return values
phk [Sun, 20 Jul 2008 11:44:29 +0000 (11:44 +0000)]
Ignore a couple of return values

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

16 years agoAdd diag_bitmap controls for panic behaviour.
phk [Sun, 20 Jul 2008 11:40:30 +0000 (11:40 +0000)]
Add diag_bitmap controls for panic behaviour.

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

16 years agoRemove the session-specific assert facility, the general assert facility
phk [Sun, 20 Jul 2008 11:28:40 +0000 (11:28 +0000)]
Remove the session-specific assert facility, the general assert facility
dumps details now.

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

16 years agoReconstitute the dumping of sessions, objects &c &c, but now do it for
phk [Sun, 20 Jul 2008 11:28:10 +0000 (11:28 +0000)]
Reconstitute the dumping of sessions, objects &c &c, but now do it for
all asserts from a thread with a registered session.

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

16 years agopanicstr is deliberately not static
phk [Sun, 20 Jul 2008 11:24:57 +0000 (11:24 +0000)]
panicstr is deliberately not static

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

16 years agoRemove debug hack which sneaked in.
phk [Sun, 20 Jul 2008 10:46:00 +0000 (10:46 +0000)]
Remove debug hack which sneaked in.

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

16 years agoReport thread name and thread session in panic messages.
phk [Sun, 20 Jul 2008 10:45:09 +0000 (10:45 +0000)]
Report thread name and thread session in panic messages.

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

16 years agoMake room in the shared memory segment for a panic string
phk [Sun, 20 Jul 2008 10:36:28 +0000 (10:36 +0000)]
Make room in the shared memory segment for a panic string
buffer.

Replace the default libvarnish assert handler with a child specific
function.

This function which fills the static panic string and copy the
result to the shared memory panicstring.

In the manager process, report the content of the panic string
when the child dies.

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

16 years agoMake the backend function of libvarnish' assert facilities pluggable.
phk [Sun, 20 Jul 2008 10:03:42 +0000 (10:03 +0000)]
Make the backend function of libvarnish' assert facilities pluggable.

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

16 years agoStore the current session in thread private data.
phk [Sun, 20 Jul 2008 09:57:25 +0000 (09:57 +0000)]
Store the current session in thread private data.

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

16 years agoMore assorted FlexeLint polishing
phk [Sat, 19 Jul 2008 12:38:28 +0000 (12:38 +0000)]
More assorted FlexeLint polishing

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

16 years agoTechnically speaking, vsb_len() could return -1, except it won't because
phk [Sat, 19 Jul 2008 12:04:25 +0000 (12:04 +0000)]
Technically speaking, vsb_len() could return -1, except it won't because
of the vsb_overflow() assert.

Make this explicit for FlexeLint.

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

16 years agoExplain to FlexeLint that _storage is not referenced.
phk [Sat, 19 Jul 2008 12:03:16 +0000 (12:03 +0000)]
Explain to FlexeLint that _storage is not referenced.

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

16 years agoConstify WS_Free()
phk [Sat, 19 Jul 2008 11:50:09 +0000 (11:50 +0000)]
Constify WS_Free()

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

16 years agoExplicitly specify index in name array.
phk [Sat, 19 Jul 2008 11:49:43 +0000 (11:49 +0000)]
Explicitly specify index in name array.

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

16 years agoDeal appropriately with ParseArgv returning NULL
phk [Sat, 19 Jul 2008 11:44:41 +0000 (11:44 +0000)]
Deal appropriately with ParseArgv returning NULL

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

16 years agoExplicitly silence three FlexeLint complaints
phk [Sat, 19 Jul 2008 11:43:51 +0000 (11:43 +0000)]
Explicitly silence three FlexeLint complaints

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

16 years agoFlexeLint inspired polishing:
phk [Sat, 19 Jul 2008 11:38:31 +0000 (11:38 +0000)]
FlexeLint inspired polishing:

Better choice of data types.

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

16 years agoFlexeLint inspired polishing:
phk [Sat, 19 Jul 2008 11:33:24 +0000 (11:33 +0000)]
FlexeLint inspired polishing:

Detect empty args.
Handle 'b' suffix in switch.

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

16 years agoAdd a protocol version number ("1.0") to the ping response.
phk [Sat, 19 Jul 2008 10:40:13 +0000 (10:40 +0000)]
Add a protocol version number ("1.0") to the ping response.

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

16 years agoUnused struct member.
phk [Sat, 19 Jul 2008 09:51:41 +0000 (09:51 +0000)]
Unused struct member.

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

16 years agoRemove pointless volatile
phk [Sat, 19 Jul 2008 09:50:42 +0000 (09:50 +0000)]
Remove pointless volatile

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

16 years agoDon't constify the cli argument to cli_out()
phk [Sat, 19 Jul 2008 09:44:40 +0000 (09:44 +0000)]
Don't constify the cli argument to cli_out()

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

16 years agoWash & cleaning of the -h and -s argument handling.
phk [Sat, 19 Jul 2008 09:24:07 +0000 (09:24 +0000)]
Wash & cleaning of the -h and -s argument handling.

No functional changes.

Add ARGV_ERR() macro for reporting argument trouble.

Do selection of method in varnishd.c, using generic choice function.

Split subarguments into argc+argv at commans, and pass those down to
avoid repetitive and bogus string munging.

Catch more error conditions with respect to subarguments.

Add mini_obj magics to stevedores and slingers.

Generally tidy up along the way.

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

16 years agoAugment ParseArgv() to also split comma separated lists.
phk [Sat, 19 Jul 2008 07:19:12 +0000 (07:19 +0000)]
Augment ParseArgv() to also split comma separated lists.

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

16 years agoAvoid home-rolled circular list in stevedore, use regular VTAILQ,
phk [Sat, 19 Jul 2008 06:46:42 +0000 (06:46 +0000)]
Avoid home-rolled circular list in stevedore, use regular VTAILQ,
the microoptimization does not justify the manual handling of ->prev
and ->next.

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

16 years agotypo.
phk [Sat, 19 Jul 2008 06:43:34 +0000 (06:43 +0000)]
typo.

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

16 years agoPolish the tokenizer
phk [Fri, 18 Jul 2008 21:30:01 +0000 (21:30 +0000)]
Polish the tokenizer

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

16 years agoThere was no need to send the err_ttl as parameter as SYN_ErrorPage had access to...
petter [Fri, 18 Jul 2008 07:16:45 +0000 (07:16 +0000)]
There was no need to send the err_ttl as parameter as SYN_ErrorPage had access to the it directly.

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

16 years agoAdded the parameter err_ttl, which sets the TTL for synthesized error pages. Default...
petter [Fri, 18 Jul 2008 07:01:42 +0000 (07:01 +0000)]
Added the parameter err_ttl, which sets the TTL for synthesized error pages. Default value is 0. Fixes #126.

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

16 years agoAdded support for choosing what fields to show in varniststat. This is done by using...
petter [Thu, 17 Jul 2008 09:58:54 +0000 (09:58 +0000)]
Added support for choosing what fields to show in varniststat. This is done by using the new -f option. To list avaialble fields, use the new -l option. Fixes #208.

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

16 years agoOoops, FlexeLint was wrong, the consts are not possible.
phk [Mon, 14 Jul 2008 15:53:22 +0000 (15:53 +0000)]
Ooops, FlexeLint was wrong, the consts are not possible.

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

16 years agoThree minor style nits from FlexeLint
phk [Mon, 14 Jul 2008 15:49:41 +0000 (15:49 +0000)]
Three minor style nits from FlexeLint

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

16 years agoAdded a round robin director. The round robin director can be created like this:
petter [Mon, 14 Jul 2008 12:59:10 +0000 (12:59 +0000)]
Added a round robin director. The round robin director can be created like this:

director batman round-robin {
{ .backend = b1; }
{ .backend = b2; }
{ .backend = b3; }
}

sub vcl_recv {
set req.backend = batman;
}

The backend will then be chosen in a round robin fashion.

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

16 years agoAdd a bit of variation to the Connection header
phk [Fri, 11 Jul 2008 22:13:29 +0000 (22:13 +0000)]
Add a bit of variation to the Connection header

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

16 years agoTest that "Connection:" header deletes http headers in both directions.
phk [Fri, 11 Jul 2008 22:07:10 +0000 (22:07 +0000)]
Test that "Connection:" header deletes http headers in both directions.

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

16 years agoRetire mgt_event.[ch] and use instead the (new) copy of it in libvarnish.
phk [Fri, 11 Jul 2008 21:34:17 +0000 (21:34 +0000)]
Retire mgt_event.[ch] and use instead the (new) copy of it in libvarnish.

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

16 years agoCopy mgt_event.[ch] from varnishd into libvarnish and give it the
phk [Fri, 11 Jul 2008 21:33:26 +0000 (21:33 +0000)]
Copy mgt_event.[ch] from varnishd into libvarnish and give it the
prefix "VEV".

This is a general purpose eventmanager and as such should live in
the library where other programs can get at it.

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

16 years agoAdd a backend property ".host_header" to set default content of Host:
phk [Fri, 11 Jul 2008 21:02:05 +0000 (21:02 +0000)]
Add a backend property ".host_header" to set default content of Host:
header if client didn't provide one.

If .host_header is not specified, it defaults to .host.

Add testcase for this logic.

(Incidental change: Use "interval" instead of "rate" for backend pollers.)

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

16 years agoAdd scaffold code for backend polling.
phk [Fri, 11 Jul 2008 20:41:39 +0000 (20:41 +0000)]
Add scaffold code for backend polling.

It doesn't actually do anything yet.

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

16 years agoDrop pseudo-automatic support for multihomed backends and require
phk [Fri, 11 Jul 2008 19:49:20 +0000 (19:49 +0000)]
Drop pseudo-automatic support for multihomed backends and require
clear expression of intent in VCL.

We now fail backend hostnames that resolve to multiple IPv4 or multiple
IPv6 addresses, in other words, you cannot use "cnn.com" as a backend
hostname specification without the compiler yelling at you:

    % ./varnishd -d -d -b cnn.com -a :8080
    Backend host "cnn.com": resolves to multiple IPv4 addresses.
    Only one address is allowed.
    Please specify which exact address you want to use, we found these:
    64.236.16.20
    64.236.16.52
    64.236.24.12
    64.236.29.120
    [...]
    VCL compilation failed

However, you _can_ use a hostname that resolves to both an IPv4 and
an IPv6 address, and the new paramter "prefer_ipv6" will determine
which one we try first in such cases.

The other part of this change is that we now do the DNS lookup at
VCL compiletime, and only then.

If your backend's DNS record (or /etc/hosts entry) changes IP#, you
must reload your VCL code to notify varnish.

Finer technical points:

We build a bytestring representation of the sockaddr's in VCC and
include them in the concept of backend identity, for an existing
backend (+ connections) to be reused for a new VCL the backend must
now be defined exactly the same way AND have the same resolved
IPv4/IPv6 addresses.

Since we never muck about with the address in the backend struct
anymore, it's static for the life of the struct backend instance,
we can simplify and eliminate the locking dance around our connection
attempts.

Also eliminate the struct vrt_backend inclusion in struct backend,
and instead make the relevat fields full-blown members of struct
backend.  This eliminates a number of TRUST_ME() calls.

This is the companion commit to #2934 which prepared the VCL compiler.

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

16 years agoEmit backend probe data to ->fb.
phk [Fri, 11 Jul 2008 18:57:13 +0000 (18:57 +0000)]
Emit backend probe data to ->fb.

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

16 years agoReject backend hostnames that resolve to multiple IPv4 or multiple
phk [Fri, 11 Jul 2008 10:12:52 +0000 (10:12 +0000)]
Reject backend hostnames that resolve to multiple IPv4 or multiple
IPv6 addresses, but accept one of each.

Emit a bytestring representation of the sockaddr we found for each
of these, into the shared object, so we avoid doing a DNS lookup
again in the cacher.

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

16 years agoMake the vcl.list use the same layout in stopped mode as in started mode.
phk [Thu, 10 Jul 2008 21:55:48 +0000 (21:55 +0000)]
Make the vcl.list use the same layout in stopped mode as in started mode.

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

16 years agoCheck counters to make sure the right thing happens.
phk [Thu, 10 Jul 2008 21:51:19 +0000 (21:51 +0000)]
Check counters to make sure the right thing happens.

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

16 years agoOne more.
phk [Thu, 10 Jul 2008 21:43:44 +0000 (21:43 +0000)]
One more.

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

16 years agoAdd more trouble
phk [Thu, 10 Jul 2008 21:34:44 +0000 (21:34 +0000)]
Add more trouble

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

16 years agoMore XML/ESI testcases
phk [Thu, 10 Jul 2008 21:24:07 +0000 (21:24 +0000)]
More XML/ESI testcases

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

16 years agoYet another XML/ESI parse corner case:
phk [Thu, 10 Jul 2008 21:23:52 +0000 (21:23 +0000)]
Yet another XML/ESI parse corner case:
<esi:include  foo=bar src=/body2 />

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

16 years agoMore XML/ESI syntax checks
phk [Thu, 10 Jul 2008 21:11:30 +0000 (21:11 +0000)]
More XML/ESI syntax checks

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

16 years agoTackle another XML/ESI syntax error corner-case:
phk [Thu, 10 Jul 2008 21:11:11 +0000 (21:11 +0000)]
Tackle another XML/ESI syntax error corner-case:
<esi:include  src= />
would result in a NUL byte when looking for the next attribute.

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

16 years agoTrigger a couple more XML/ESI parser errors
phk [Thu, 10 Jul 2008 20:50:04 +0000 (20:50 +0000)]
Trigger a couple more XML/ESI parser errors

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

16 years agoFix two bugs in esi parsing:
phk [Thu, 10 Jul 2008 20:49:45 +0000 (20:49 +0000)]
Fix two bugs in esi parsing:

Ignore unknown include attributes and
Warn about src attributes without value

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

16 years agoMore XML/ESI errors
phk [Thu, 10 Jul 2008 20:25:40 +0000 (20:25 +0000)]
More XML/ESI errors

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

16 years agoTest XML/ESI syntax errors etc.
phk [Thu, 10 Jul 2008 20:08:57 +0000 (20:08 +0000)]
Test XML/ESI syntax errors etc.

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

16 years agoTest the vcl.load CLI command while we are at it.
phk [Thu, 10 Jul 2008 19:59:56 +0000 (19:59 +0000)]
Test the vcl.load CLI command while we are at it.

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

16 years agoAdd a test for the -f argument
phk [Thu, 10 Jul 2008 19:40:17 +0000 (19:40 +0000)]
Add a test for the -f argument

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

16 years agoFix an off-by one in the random director
phk [Thu, 10 Jul 2008 18:09:42 +0000 (18:09 +0000)]
Fix an off-by one in the random director

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

16 years agoAdd a testcase for the random director doing actual work
phk [Thu, 10 Jul 2008 18:08:42 +0000 (18:08 +0000)]
Add a testcase for the random director doing actual work

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

16 years agoAdd a testcase to show that we can in fact get rid of both VCL's and
phk [Thu, 10 Jul 2008 11:17:22 +0000 (11:17 +0000)]
Add a testcase to show that we can in fact get rid of both VCL's and
backend hosts.

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

16 years agoAdd a testcase for the sema operations
phk [Thu, 10 Jul 2008 10:27:43 +0000 (10:27 +0000)]
Add a testcase for the sema operations

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

16 years agoAdd Semaphore facility to synchronize different treads in the tester
phk [Thu, 10 Jul 2008 10:26:17 +0000 (10:26 +0000)]
Add Semaphore facility to synchronize different treads in the tester
with each other.

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

16 years agoThe emminently sensible INFTIM isn't portable, use -1
phk [Thu, 10 Jul 2008 09:34:47 +0000 (09:34 +0000)]
The emminently sensible INFTIM isn't portable, use -1

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