]> err.no Git - varnish/log
varnish
17 years agofix upgrade issue in postrm script, and rename it to <package>.postrm to match other...
ssm [Wed, 16 May 2007 10:53:30 +0000 (10:53 +0000)]
fix upgrade issue in postrm script, and rename it to <package>.postrm to match other debian control files

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

17 years agoAdded example vcl to use in front of zope+plone (this could perhaps go in a contrib...
ssm [Wed, 16 May 2007 10:52:15 +0000 (10:52 +0000)]
Added example vcl to use in front of zope+plone (this could perhaps go in a contrib/ directory instead)

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

17 years agoDistribute default.vcl.
des [Wed, 16 May 2007 09:35:18 +0000 (09:35 +0000)]
Distribute default.vcl.

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

17 years agoExpand tags
des [Wed, 16 May 2007 09:34:26 +0000 (09:34 +0000)]
Expand tags

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

17 years agoRename vcl.conf to default.vcl, update and comment the sample code.
des [Tue, 15 May 2007 19:38:56 +0000 (19:38 +0000)]
Rename vcl.conf to default.vcl, update and comment the sample code.

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

17 years agoAttempt to fix the bind-to-any problem:
des [Tue, 15 May 2007 11:35:44 +0000 (11:35 +0000)]
Attempt to fix the bind-to-any problem:

 - Introduce a "struct tcp_addr" which is a lightweight form of struct
   addrinfo for our own internal use.

 - Add a TCP_resolve() function which takes the output from TCP_parse()
   and fills in a list of pointers to struct tcp_addr, one for each
   address returned by getaddrinfo().

 - Modify all TCP_open() callers to use TCP_resolve() and call TCP_open()
   once for every address returned.

 - Add some explanatory comments to tcp.c.

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

17 years agoRevert accidental commit of unfinished negative-caching patch.
des [Tue, 15 May 2007 11:15:49 +0000 (11:15 +0000)]
Revert accidental commit of unfinished negative-caching patch.

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

17 years agoAN() and XXXAN() are also useful for non-pointer results.
des [Tue, 15 May 2007 11:01:34 +0000 (11:01 +0000)]
AN() and XXXAN() are also useful for non-pointer results.

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

17 years agoMerged revisions 1394,1400-1418 via svnmerge from
des [Mon, 14 May 2007 09:42:16 +0000 (09:42 +0000)]
Merged revisions 1394,1400-1418 via svnmerge from
svn+ssh://projects.linpro.no/svn/varnish/trunk/varnish-cache

........
  r1394 | phk | 2007-05-09 12:55:33 +0200 (Wed, 09 May 2007) | 8 lines

  After compilation of a VCL program, do a test-load into the management
  process to catch any implementation-discrepancies between symbols used
  by the compiler and those implemented in the runtime.

  The situation will happen from time to time and there is no need to
  issue a panic when we can test sensibly for it.
........
  r1403 | ingvar | 2007-05-11 09:51:11 +0200 (Fri, 11 May 2007) | 5 lines

  * Fri May 11 2007 Ingvar Hagelund <ingvar@linpro.no> - 1.0.svn-20070511
  - Threw latest changes into svn trunk
  - Removed the conversion of manpages into utf8. They are all utf8 in trunk
........
  r1404 | ingvar | 2007-05-11 10:13:03 +0200 (Fri, 11 May 2007) | 1 line
........
  r1406 | des | 2007-05-11 13:06:03 +0200 (Fri, 11 May 2007) | 2 lines

  Comment out comparisons which are always true (unsigned >= 0)
........
  r1407 | des | 2007-05-11 13:06:38 +0200 (Fri, 11 May 2007) | 2 lines

  Tweak DEVELOPER_CFLAGS.
........
  r1408 | des | 2007-05-11 13:14:32 +0200 (Fri, 11 May 2007) | 2 lines

  Pull flopen() and pidfile_*() (renamed to vpf_*()) from FreeBSD.
........
  r1409 | des | 2007-05-11 13:15:46 +0200 (Fri, 11 May 2007) | 2 lines

  Expand tags.
........
  r1410 | des | 2007-05-11 13:17:09 +0200 (Fri, 11 May 2007) | 2 lines

  No use expanding tags unless there *are* tags...
........
  r1411 | des | 2007-05-11 13:34:42 +0200 (Fri, 11 May 2007) | 2 lines

  Add -D (daemonize) and -P (pid file) options.
........
  r1412 | des | 2007-05-11 13:35:59 +0200 (Fri, 11 May 2007) | 2 lines

  Remove unused header.
........
  r1413 | des | 2007-05-11 14:01:47 +0200 (Fri, 11 May 2007) | 2 lines

  Avoid gcc4-specific compiler options.
........
  r1414 | des | 2007-05-11 14:05:02 +0200 (Fri, 11 May 2007) | 2 lines

  Forgotten commit: check for <vis.h> and daemon(3) availability.
........
  r1415 | des | 2007-05-11 14:17:26 +0200 (Fri, 11 May 2007) | 2 lines

  Add -P (pid file) option.
........
  r1416 | des | 2007-05-11 14:19:48 +0200 (Fri, 11 May 2007) | 2 lines

  Minor style issues.
........
  r1417 | phk | 2007-05-11 15:15:16 +0200 (Fri, 11 May 2007) | 7 lines

  Make the sendfile threshold inifinity for now, we have evidence of
  sendfile not doing it's job in a number of operating system (-versions ?)

  This change is unlikely to cause a performance hit anywhere, because
  writev() is pretty effective in the first place.
........
  r1418 | des | 2007-05-14 11:02:23 +0200 (Mon, 14 May 2007) | 2 lines

  Document the inadvisability of enabling sendfile.
........

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

17 years agoDocument the inadvisability of enabling sendfile.
des [Mon, 14 May 2007 09:02:23 +0000 (09:02 +0000)]
Document the inadvisability of enabling sendfile.

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

17 years agoMake the sendfile threshold inifinity for now, we have evidence of
phk [Fri, 11 May 2007 13:15:16 +0000 (13:15 +0000)]
Make the sendfile threshold inifinity for now, we have evidence of
sendfile not doing it's job in a number of operating system (-versions ?)

This change is unlikely to cause a performance hit anywhere, because
writev() is pretty effective in the first place.

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

17 years agoMinor style issues.
des [Fri, 11 May 2007 12:19:48 +0000 (12:19 +0000)]
Minor style issues.

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

17 years agoAdd -P (pid file) option.
des [Fri, 11 May 2007 12:17:26 +0000 (12:17 +0000)]
Add -P (pid file) option.

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

17 years agoForgotten commit: check for <vis.h> and daemon(3) availability.
des [Fri, 11 May 2007 12:05:02 +0000 (12:05 +0000)]
Forgotten commit: check for <vis.h> and daemon(3) availability.

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

17 years agoAvoid gcc4-specific compiler options.
des [Fri, 11 May 2007 12:01:47 +0000 (12:01 +0000)]
Avoid gcc4-specific compiler options.

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

17 years agoRemove unused header.
des [Fri, 11 May 2007 11:35:59 +0000 (11:35 +0000)]
Remove unused header.

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

17 years agoAdd -D (daemonize) and -P (pid file) options.
des [Fri, 11 May 2007 11:34:42 +0000 (11:34 +0000)]
Add -D (daemonize) and -P (pid file) options.

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

17 years agoNo use expanding tags unless there *are* tags...
des [Fri, 11 May 2007 11:17:09 +0000 (11:17 +0000)]
No use expanding tags unless there *are* tags...

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

17 years agoExpand tags.
des [Fri, 11 May 2007 11:15:46 +0000 (11:15 +0000)]
Expand tags.

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

17 years agoPull flopen() and pidfile_*() (renamed to vpf_*()) from FreeBSD.
des [Fri, 11 May 2007 11:14:32 +0000 (11:14 +0000)]
Pull flopen() and pidfile_*() (renamed to vpf_*()) from FreeBSD.

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

17 years agoTweak DEVELOPER_CFLAGS.
des [Fri, 11 May 2007 11:06:38 +0000 (11:06 +0000)]
Tweak DEVELOPER_CFLAGS.

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

17 years agoComment out comparisons which are always true (unsigned >= 0)
des [Fri, 11 May 2007 11:06:03 +0000 (11:06 +0000)]
Comment out comparisons which are always true (unsigned >= 0)

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

17 years agogit-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1404 d4fa192b-c00b-0410...
ingvar [Fri, 11 May 2007 08:13:03 +0000 (08:13 +0000)]
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1404 d4fa192b-c00b-0410-8231-f00ffab90ce4

17 years ago* Fri May 11 2007 Ingvar Hagelund <ingvar@linpro.no> - 1.0.svn-20070511
ingvar [Fri, 11 May 2007 07:51:11 +0000 (07:51 +0000)]
* Fri May 11 2007 Ingvar Hagelund <ingvar@linpro.no> - 1.0.svn-20070511
- Threw latest changes into svn trunk
- Removed the conversion of manpages into utf8. They are all utf8 in trunk

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

17 years agoCorrectly detect more incompatible automake versions.
des [Wed, 9 May 2007 14:37:04 +0000 (14:37 +0000)]
Correctly detect more incompatible automake versions.

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

17 years agoImplement runtime part of VCL controlled hashing.
phk [Wed, 9 May 2007 14:28:50 +0000 (14:28 +0000)]
Implement runtime part of VCL controlled hashing.

The vcl_hash() is now used to control which fields go
into the hash algorithm, and the default is stil,
as previously, the URL + Host: header.

But now it is controlled by the vcl code, with the
default vcl_hash() being:

sub vcl_hash {
req.hash += req.url;
req.hash += req.http.host;
hash;
}

Once I get a bit further, this will be changed to

sub vcl_hash {
req.hash += req.url;
if (req.http.host) {
req.hash += req.http.host;
} else {
req.hash += server.ip;
}
hash;
}

So that we correctly hash HTTP requests without Host:
headers, that go to a machine with multiple IP numbers.

If you want to add fields to the hash, just write
a vcl_hash that does not end in "hash;":

sub vcl_hash {
req.hash += req.http.cookie;
}

If you want to override the default vcl_hash, just
say so:

sub vcl_hash {
req.hash += req.url;
hash; // do not continue into default vcl_hash
}

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

17 years agoMake req.hash have the right internal type: char *
phk [Wed, 9 May 2007 13:55:39 +0000 (13:55 +0000)]
Make req.hash have the right internal type: char *

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

17 years agoUse struct sockaddr_storage instead of our own homegrown hack.
phk [Wed, 9 May 2007 12:08:41 +0000 (12:08 +0000)]
Use struct sockaddr_storage instead of our own homegrown hack.

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

17 years agoMark variables/objects as having a string representation or not
phk [Wed, 9 May 2007 11:07:59 +0000 (11:07 +0000)]
Mark variables/objects as having a string representation or not
and create a function to figure this out, if present.

Add the req.hash variable and the += operator for it, so we
can put the actual hash contents under vcl control.

The runtime half of this stuff is not done yet.

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

17 years agoAfter compilation of a VCL program, do a test-load into the management
phk [Wed, 9 May 2007 10:55:33 +0000 (10:55 +0000)]
After compilation of a VCL program, do a test-load into the management
process to catch any implementation-discrepancies between symbols used
by the compiler and those implemented in the runtime.

The situation will happen from time to time and there is no need to
issue a panic when we can test sensibly for it.

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

17 years agoDon't use sockaddr->sa_len, it was too advanced for POSIX people
phk [Wed, 9 May 2007 09:45:01 +0000 (09:45 +0000)]
Don't use sockaddr->sa_len, it was too advanced for POSIX people

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

17 years agoDon't use sockaddr->sa_len, it was too advanced for POSIX people.
phk [Wed, 9 May 2007 09:44:35 +0000 (09:44 +0000)]
Don't use sockaddr->sa_len, it was too advanced for POSIX people.

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

17 years agoAdd back a check that was lost: You must have at least one backend.
phk [Wed, 9 May 2007 08:44:28 +0000 (08:44 +0000)]
Add back a check that was lost:  You must have at least one backend.

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

17 years agoAdd support for checking "server.ip" in addition to "client.ip".
phk [Wed, 9 May 2007 08:39:50 +0000 (08:39 +0000)]
Add support for checking "server.ip" in addition to "client.ip".

The definition of "server.ip" is what getsockname(2) returns
for our end of the connection.

Don't report ACL matches for acls created as a result of '==' or
'!=' usage on IP number variables.

Move storage for sess->sockaddr away from sessmem and expose
more code to <sys/socket.h>.  This is a network application
after all.

XXX: somebody with IPv6 connectivity needs to look at
ACLs in IPv6 context.

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

17 years agoImplement '==' and '!=' for IP number variables (presently only client.ip)
phk [Wed, 9 May 2007 08:06:00 +0000 (08:06 +0000)]
Implement '==' and '!=' for IP number variables (presently only client.ip)

It works by building a one-entry ACL of the subsequent tokens
and matching this ACL just like '~' would have done.

This means that it is possible to use the '!', '(...)', '/width'
constructs and domain-names in these comparisons.

Examples:

if (client.ip == ( "www.freebsd.org" )) {

if (client.ip == (! "localhost" )) {

if (client.ip == (! "10.0.0.0"/8 )) {

or even

if (client.ip != "somehost" / 28) {

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

17 years agoSanitize generation of white-space in generated C code.
phk [Wed, 9 May 2007 07:59:22 +0000 (07:59 +0000)]
Sanitize generation of white-space in generated C code.

(It is my intent that the compiled-to C-source should have sensible
readability)

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

17 years agoUpdate the default configuration.
des [Sun, 6 May 2007 18:57:26 +0000 (18:57 +0000)]
Update the default configuration.

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

17 years agoLook for s-maxage before max-age. This may need to be revisited.
des [Sat, 5 May 2007 14:44:37 +0000 (14:44 +0000)]
Look for s-maxage before max-age.  This may need to be revisited.

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

17 years agoRemove superfluous vsb_printf() argument
des [Sat, 5 May 2007 14:35:58 +0000 (14:35 +0000)]
Remove superfluous vsb_printf() argument

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

17 years agoTypo in comment
des [Sat, 5 May 2007 14:09:23 +0000 (14:09 +0000)]
Typo in comment

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

17 years agoWhitespace nits
des [Sat, 5 May 2007 14:08:01 +0000 (14:08 +0000)]
Whitespace nits

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

17 years agoApply the workaround suggested in #102.
des [Fri, 4 May 2007 12:28:56 +0000 (12:28 +0000)]
Apply the workaround suggested in #102.

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

17 years agoFix error reporting with -C
phk [Fri, 4 May 2007 12:25:23 +0000 (12:25 +0000)]
Fix error reporting with -C

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

17 years agos/expl/explicit/ to circumvent a bug in gcc 3.
des [Thu, 3 May 2007 08:48:51 +0000 (08:48 +0000)]
s/expl/explicit/ to circumvent a bug in gcc 3.

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

17 years agos/expl/reason/ to circumvent a bug in gcc 3.
des [Thu, 3 May 2007 08:48:43 +0000 (08:48 +0000)]
s/expl/reason/ to circumvent a bug in gcc 3.

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

17 years agos/expl/reason/ to circumvent a bug in gcc 3.
des [Thu, 3 May 2007 08:45:33 +0000 (08:45 +0000)]
s/expl/reason/ to circumvent a bug in gcc 3.

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

17 years agos/expl/reason/ to circumvent a bug in gcc 3.
des [Thu, 3 May 2007 08:41:01 +0000 (08:41 +0000)]
s/expl/reason/ to circumvent a bug in gcc 3.

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

17 years agoDon't try to lock the objhead mutex if we don't have an objhead. Doing so
des [Wed, 2 May 2007 14:37:42 +0000 (14:37 +0000)]
Don't try to lock the objhead mutex if we don't have an objhead.  Doing so
caused the Varnish child to die immediately after sending its 503 response
if the backend didn't respond.

Reviewed by: phk

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

17 years agoCorrect the URL in the error page.
des [Wed, 2 May 2007 13:56:24 +0000 (13:56 +0000)]
Correct the URL in the error page.

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

17 years agoTry fixing #95 again. The trick is that if we get a new SLT_VCL_call
des [Wed, 2 May 2007 12:20:43 +0000 (12:20 +0000)]
Try fixing #95 again.  The trick is that if we get a new SLT_VCL_call
while the F_INVCL flag is set, we need to insert a newline before the
entry for the new VCL_call.

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

17 years agoAdd and document a ping_interval parameter which controls the interval at
des [Tue, 1 May 2007 18:21:53 +0000 (18:21 +0000)]
Add and document a ping_interval parameter which controls the interval at
which the parent pings the child.  Also document pipe_timeout, which was
left out of the man page by accident.

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

17 years agoTwo minor logging fixes:
des [Tue, 1 May 2007 17:55:31 +0000 (17:55 +0000)]
Two minor logging fixes:

 - change the type of vsl_handler()'s tag argument from unsigned int to
   enum shmlogtag to allow gcc to check switch statements and gdb to show
   its value by name rather than by number.

 - fix the "missing newline after VCL_call" bug in varnishlog (#95)

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

17 years agoImprove the readability and debuggability of our tag conversion tricks.
des [Tue, 1 May 2007 17:55:13 +0000 (17:55 +0000)]
Improve the readability and debuggability of our tag conversion tricks.

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

17 years agoAdd protective #ifdef.
des [Tue, 1 May 2007 17:48:56 +0000 (17:48 +0000)]
Add protective #ifdef.

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

17 years agoForce CONFIG_SHELL to /bin/sh.
des [Thu, 26 Apr 2007 10:39:19 +0000 (10:39 +0000)]
Force CONFIG_SHELL to /bin/sh.

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

17 years agoAdd compat trick for clock_gettime()
phk [Thu, 26 Apr 2007 06:54:58 +0000 (06:54 +0000)]
Add compat trick for clock_gettime()

Submitted by: Pierre Queinnec <pierre.queinnec@zenika.com>

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

17 years agoEliminate warnings.
des [Tue, 24 Apr 2007 12:37:58 +0000 (12:37 +0000)]
Eliminate warnings.

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

17 years agoMove CFLAGS configuration to the bottom so it doesn't affect other tests.
des [Tue, 24 Apr 2007 12:36:58 +0000 (12:36 +0000)]
Move CFLAGS configuration to the bottom so it doesn't affect other tests.
This makes --enable-werror work again.

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

17 years agoMove CFLAGS configuration to the bottom so it doesn't affect other tests.
des [Tue, 24 Apr 2007 12:23:37 +0000 (12:23 +0000)]
Move CFLAGS configuration to the bottom so it doesn't affect other tests.
This makes --enable-werror work again.

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

17 years agoCorrectly detect the presence and location of all external library we use
des [Tue, 24 Apr 2007 09:39:12 +0000 (09:39 +0000)]
Correctly detect the presence and location of all external library we use
(except for the C math library, which the C standard guarantees is always
available as -lm) and more importantly, use them only where needed.

This should fix the compilation issues on SuSE.

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

17 years agoFurther eliminate fixed-size buffers.
des [Sun, 22 Apr 2007 13:09:59 +0000 (13:09 +0000)]
Further eliminate fixed-size buffers.

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

17 years agoMajor rewrite of the VSL handler for increased robustness and clarity:
des [Sat, 21 Apr 2007 21:48:56 +0000 (21:48 +0000)]
Major rewrite of the VSL handler for increased robustness and clarity:

 - Treat all request fields in a similar manner.

 - Mostly eliminate fixed-size buffers.

 - Don't print or format anything until we see ReqEnd.

 - If we saw a Host: header, use it to generate an absolute URI,
   resulting in far more useful output when processing logs from a
   server which handles multiple virtual hosts.

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

17 years agoStyle and whitespace cleanup + clarify comment explaining the log format
des [Sat, 21 Apr 2007 17:52:44 +0000 (17:52 +0000)]
Style and whitespace cleanup + clarify comment explaining the log format

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

17 years agoClarify synopsis / description
des [Sat, 21 Apr 2007 17:48:21 +0000 (17:48 +0000)]
Clarify synopsis / description

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

17 years agoWhen we have some amount of a chunk header, but not all of it, we
phk [Thu, 19 Apr 2007 15:17:35 +0000 (15:17 +0000)]
When we have some amount of a chunk header, but not all of it, we
need to read more from the fd.  The semantics we _really_ want for
that read operation is "wait until at least one char is available,
then return as many as N to us".

This can be done with a combination of system calls, but it is likely
just as cheap to just read one char at a time, so we do that.

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

17 years agoEmit acl matching code to the function body.
phk [Thu, 19 Apr 2007 10:00:37 +0000 (10:00 +0000)]
Emit acl matching code to the function body.

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

17 years agoStandards compliance: fputs(3) returns non-negative on success.
phk [Thu, 19 Apr 2007 09:34:45 +0000 (09:34 +0000)]
Standards compliance: fputs(3) returns non-negative on success.

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

17 years agoNeed to find other way to shut up flexelint.
phk [Wed, 11 Apr 2007 09:16:13 +0000 (09:16 +0000)]
Need to find other way to shut up flexelint.

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

17 years agoRemember to initialize C_flag and don't exit in far away code.
phk [Wed, 11 Apr 2007 09:09:00 +0000 (09:09 +0000)]
Remember to initialize C_flag and don't exit in far away code.

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

17 years agoAdd scripts to run flexelint over VCL compiler output
phk [Mon, 9 Apr 2007 21:08:21 +0000 (21:08 +0000)]
Add scripts to run flexelint over VCL compiler output

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

17 years agoFix stylistic Flexelint unhappiness with the compiled C source.
phk [Mon, 9 Apr 2007 21:03:12 +0000 (21:03 +0000)]
Fix stylistic Flexelint unhappiness with the compiled C source.

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

17 years agoAdd a -C argument, which compiles the VCL (either default with -b
phk [Mon, 9 Apr 2007 20:50:12 +0000 (20:50 +0000)]
Add a -C argument, which compiles the VCL (either default with -b
or user specified with -f) and outputs the C source on the stdout.

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

17 years agoTwo missing NULL initializations.
phk [Mon, 9 Apr 2007 20:34:14 +0000 (20:34 +0000)]
Two missing NULL initializations.

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

17 years ago<queue.h> is a local #include in varnish, so use "queue.h"
phk [Mon, 9 Apr 2007 20:30:05 +0000 (20:30 +0000)]
<queue.h> is a local #include in varnish, so use "queue.h"

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

17 years agoMove the function that pushes the compiled VCL programs C source through
phk [Mon, 9 Apr 2007 20:28:08 +0000 (20:28 +0000)]
Move the function that pushes the compiled VCL programs C source through
the systems cc(1) from the VCL compiler library to the varnishd process.

This reduces the VCL-compiler library to a text-procesing functionality
and makes it easier to build other tools, including test-suites,
around the VCL-compiler.

It also moves the actual compiler invocation string into the varnishd
sources, where it can be handled appropriately, possibly as a paramter.

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

17 years agoremove XXX comment which no longer applies
phk [Sun, 1 Apr 2007 19:13:07 +0000 (19:13 +0000)]
remove XXX comment which no longer applies

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

17 years agoVarious nitpicking prompted by flexelint
phk [Sun, 1 Apr 2007 19:01:38 +0000 (19:01 +0000)]
Various nitpicking prompted by flexelint

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

17 years agoFix char position in error messages to be [1...] instead of [0...]
phk [Sun, 1 Apr 2007 18:18:54 +0000 (18:18 +0000)]
Fix char position in error messages to be [1...] instead of [0...]

Fix typo in /* ... */ handling

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

17 years agoUpdate
phk [Sun, 1 Apr 2007 15:34:24 +0000 (15:34 +0000)]
Update

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

17 years agoRemove unused METHOD token.
phk [Sun, 1 Apr 2007 15:33:56 +0000 (15:33 +0000)]
Remove unused METHOD token.

Improve error handling for unterminated /* ... */ comments.

Add undocumented and unsupported facility for inline C source code
in VCL programs.  The syntax is "C{ getpid(); }C" and you are on
your own if you use this.

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

17 years agoMove backend parsing into a separate file.
phk [Sun, 1 Apr 2007 09:34:28 +0000 (09:34 +0000)]
Move backend parsing into a separate file.
Eliminate a bunch of of unnecessary #includes.

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

17 years agoEliminate the "proof of concept" tokens that were never implemented
phk [Sun, 1 Apr 2007 09:17:52 +0000 (09:17 +0000)]
Eliminate the "proof of concept" tokens that were never implemented
at runtime.

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

17 years agoImplement the returns with the new ID based table and eliminate their
phk [Sun, 1 Apr 2007 09:07:44 +0000 (09:07 +0000)]
Implement the returns with the new ID based table and eliminate their
corresponding dedicated tokens.

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

17 years agoIntroduce table based search for actions, and make "set" the first one.
phk [Sun, 1 Apr 2007 08:48:08 +0000 (08:48 +0000)]
Introduce table based search for actions, and make "set" the first one.

This eliminates the need to have the identifier "set" be its own token
rather than being a simple ID.

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

17 years agoSplit the parsing of actions into a separate file, this is the bit
phk [Sun, 1 Apr 2007 08:37:52 +0000 (08:37 +0000)]
Split the parsing of actions into a separate file, this is the bit
I expect to grow the most in the near future and all actions have
a lot more in common, than they have with conditionals etc.

Apply more vcc_ prefixes.

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

17 years agoI got confused about the terminology. An action is something we do
phk [Sun, 1 Apr 2007 08:23:48 +0000 (08:23 +0000)]
I got confused about the terminology.  An action is something we do
in the program, a "return" is when we quit the program.

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

17 years agoBetter syntax checking of "set" statements.
phk [Sat, 31 Mar 2007 18:21:14 +0000 (18:21 +0000)]
Better syntax checking of "set" statements.

Remove inapplicable comment.

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

17 years agoFix typo, so we correctly recognize '-=' as T_DECR token.
phk [Sat, 31 Mar 2007 18:20:33 +0000 (18:20 +0000)]
Fix typo, so we correctly recognize '-=' as T_DECR token.

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

17 years agoPidgin BNF syntax of VCL
phk [Sat, 31 Mar 2007 18:19:07 +0000 (18:19 +0000)]
Pidgin BNF syntax of VCL

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

17 years agoOverhaul cross reference checks in vcc compiler
phk [Sat, 31 Mar 2007 08:36:31 +0000 (08:36 +0000)]
Overhaul cross reference checks in vcc compiler

Move and isolate cross reference stuff to it's own source file
(vcc_xref.c) and use vcc_ prefix as originally intended.

Also warn about multiple definitions of objects.

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

17 years agoImprove error message layout and information.
phk [Sat, 31 Mar 2007 07:43:05 +0000 (07:43 +0000)]
Improve error message layout and information.

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

17 years agoOverhaul compiler to get rid of memory leaks and other bogons.
phk [Fri, 30 Mar 2007 21:11:15 +0000 (21:11 +0000)]
Overhaul compiler to get rid of memory leaks and other bogons.

Add a memlist to the tokenlist and a function which allocates
with malloc(3) and hangs the piece on the memlist of tokenlist.
At the end of compilation, we ditch everything on the list.

Handle vrt_obj.h like the other #includes, and stuff these
into a vsb instead of directly to a file.

Free decoded token string, if any.

Pull creation and destruction of tokenlist into separate functions
for code clarity.  Remember to destry everything in the tokenlist.

Pull invocation of cc(1) into a separate function and change the
way we do it, so we get any cc(1) groans and whines back in the
vsb so a CLI user will see them.  More errorchecks than before.

More comments throughout.

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

17 years agoRewrite using sbufs.
des [Fri, 30 Mar 2007 07:10:41 +0000 (07:10 +0000)]
Rewrite using sbufs.

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

17 years agoThe argv length calculation was not only off by one, but failed to take
des [Thu, 29 Mar 2007 10:49:58 +0000 (10:49 +0000)]
The argv length calculation was not only off by one, but failed to take
into account the extra space required by expanded quotes, backslashes and
newlines.  Instead of pre-allocating a (possibly too short) buffer, start
with a 64-byte buffer and double it every time we come close to filling
it up.  Also, avoid appending a trailing space before the final newline.

This issue was uncovered by Kristoffer Gleditsch <kristoffer@linpro.no>,
who also helped test this patch.

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

17 years agoExpand and track recent changes.
des [Wed, 28 Mar 2007 09:26:18 +0000 (09:26 +0000)]
Expand and track recent changes.

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

17 years agoActual default max is 1000, not infinity.
des [Wed, 28 Mar 2007 08:11:27 +0000 (08:11 +0000)]
Actual default max is 1000, not infinity.

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

17 years agoTwist the compiler logic around a bit.
phk [Sat, 24 Mar 2007 22:09:53 +0000 (22:09 +0000)]
Twist the compiler logic around a bit.

Concatenate all definitions of the method functions into one
instance of the function:

sub vcl_pipe {
foo;
}

sub vcl_pipe {
bar;
}

is now the same as

sub vcl_pipe {
foo;
bar;
}

This avoids all the magic related to the default functions and
hopefully makes the newly introduced "include" facility much more
useful.

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

17 years agoSplit off the parsing from vcc_compile.c into vcc_parse.c
phk [Sat, 24 Mar 2007 21:01:43 +0000 (21:01 +0000)]
Split off the parsing from vcc_compile.c into vcc_parse.c

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

17 years agouse tl-> consistently
phk [Sat, 24 Mar 2007 20:33:40 +0000 (20:33 +0000)]
use tl-> consistently

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

17 years agoImplement a facility for source file modularization in the VCL
phk [Fri, 9 Mar 2007 10:31:29 +0000 (10:31 +0000)]
Implement a facility for source file modularization in the VCL
compiler.  The syntax is:

include "filename" ;

Unlike the C preprocessors #include directive, a VCL include can
appear anywhere in the sourcefile:

if {req.Cookie == include "cookie.vcl" ; || !req.Host } {
}

and have cookie.vcl contain just:

"8435398475983275293759843"

Technically this results in a change to how we account for source
code references in the counter/profile table as well, and as a result
the entire source code of the VCL program is now compiled into the
shared library for easy reference.

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