]> err.no Git - varnish/log
varnish
17 years agoMove VCL_pipe_method() processing into cache_center.c where it belongs.
phk [Tue, 3 Jul 2007 20:49:42 +0000 (20:49 +0000)]
Move VCL_pipe_method() processing into cache_center.c where it belongs.

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

17 years agoEmply the new vbe_bereq structure for holding backend request and reply.
phk [Tue, 3 Jul 2007 20:38:38 +0000 (20:38 +0000)]
Emply the new vbe_bereq structure for holding backend request and reply.

There should be no functional change as a result of this.

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

17 years agoAdd functions for allocating and freeing bereq structures.
phk [Tue, 3 Jul 2007 19:32:21 +0000 (19:32 +0000)]
Add functions for allocating and freeing bereq structures.

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

17 years agoImplement "now" and "obj.lastuse", with a note to the effect that the use
des [Tue, 3 Jul 2007 14:19:40 +0000 (14:19 +0000)]
Implement "now" and "obj.lastuse", with a note to the effect that the use
of timestamps and clock_gettime() throughout Varnish needs reviewing (as
per IRC discussion with phk)

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

17 years agoRegenerate.
des [Tue, 3 Jul 2007 14:18:24 +0000 (14:18 +0000)]
Regenerate.

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

17 years agoAdd two VCL variables, "now" and "obj.lastuse". The former returns the
des [Tue, 3 Jul 2007 14:17:28 +0000 (14:17 +0000)]
Add two VCL variables, "now" and "obj.lastuse".  The former returns the
current time, the latter returns the number of seconds since an object
was last requested.  The exact semantics of both are slightly fluid at
the moment, and will be revisited at a later date.

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

17 years agoDocument vcl.show.
des [Tue, 3 Jul 2007 12:22:42 +0000 (12:22 +0000)]
Document vcl.show.

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

17 years agoAdd a 'vcl.show' command which displays the source code for a given VCL
des [Tue, 3 Jul 2007 12:21:50 +0000 (12:21 +0000)]
Add a 'vcl.show' command which displays the source code for a given VCL
script.

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

17 years agoAdditional paranoia.
des [Tue, 3 Jul 2007 11:34:16 +0000 (11:34 +0000)]
Additional paranoia.

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

17 years agoUse strcmp instead of strncmp
cecilihf [Tue, 3 Jul 2007 09:20:50 +0000 (09:20 +0000)]
Use strcmp instead of strncmp

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

17 years agoReorganize the code a little, and add code to wait for all threads to finish
des [Tue, 3 Jul 2007 09:09:55 +0000 (09:09 +0000)]
Reorganize the code a little, and add code to wait for all threads to finish
processing pending messages before we exit.

Note that VSL_Dispatch() will read in log data as fast as it can, so when
working from a log file, varnishreplay will usually read in the entire file
into memory within the first few seconds.

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

17 years agoConvert pipe mode to use the bereq in struct worker.
phk [Tue, 3 Jul 2007 08:50:34 +0000 (08:50 +0000)]
Convert pipe mode to use the bereq in struct worker.

(See architect notes on wiki for reasoning)

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

17 years agoRename the backend connections two http's "bereq" and "beresp"
phk [Tue, 3 Jul 2007 08:11:17 +0000 (08:11 +0000)]
Rename the backend connections two http's "bereq" and "beresp"

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

17 years agoparellising varnishreplay. Work in progress.
cecilihf [Tue, 3 Jul 2007 08:07:09 +0000 (08:07 +0000)]
parellising varnishreplay. Work in progress.

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

17 years agoAlso reset the workspaces when we do not reuse the backend connection,
phk [Mon, 2 Jul 2007 17:30:03 +0000 (17:30 +0000)]
Also reset the workspaces when we do not reuse the backend connection,
we still reuse the structure.

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

17 years agoImprove assignments a bit
phk [Mon, 2 Jul 2007 13:30:06 +0000 (13:30 +0000)]
Improve assignments a bit

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

17 years agoGenerate correct code for bereq.http and obj.http
phk [Mon, 2 Jul 2007 13:28:03 +0000 (13:28 +0000)]
Generate correct code for bereq.http and obj.http

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

17 years agoUpdate the list of variables in accordance with the new scheme.
phk [Mon, 2 Jul 2007 13:22:36 +0000 (13:22 +0000)]
Update the list of variables in accordance with the new scheme.

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

17 years agoAdjust props.
des [Mon, 2 Jul 2007 13:18:03 +0000 (13:18 +0000)]
Adjust props.

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

17 years agoAdjust props
des [Mon, 2 Jul 2007 13:16:28 +0000 (13:16 +0000)]
Adjust props

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

17 years agoUpdate to reflect the latest changes to cache_center.c.
des [Mon, 2 Jul 2007 13:16:04 +0000 (13:16 +0000)]
Update to reflect the latest changes to cache_center.c.

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

17 years agoAdd vcl_deliver() method where touch-up's to the returned reply can
phk [Mon, 2 Jul 2007 13:08:07 +0000 (13:08 +0000)]
Add vcl_deliver() method where touch-up's to the returned reply can
be performed.

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

17 years agoUpdate the embedded dot-graph to include request/object visibility in
phk [Mon, 2 Jul 2007 12:33:22 +0000 (12:33 +0000)]
Update the embedded dot-graph to include request/object visibility in
the various VCL methods.

Loose the state names, they're obvious in the source code.

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

17 years agoFixed some number conversion issues
cecilihf [Mon, 2 Jul 2007 12:01:55 +0000 (12:01 +0000)]
Fixed some number conversion issues

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

17 years agoInstall into libexec, not sbin.
des [Mon, 2 Jul 2007 11:52:48 +0000 (11:52 +0000)]
Install into libexec, not sbin.

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

17 years agoSome improvements to the nagios plugin. Default parameter is now hitrate.
cecilihf [Mon, 2 Jul 2007 11:09:29 +0000 (11:09 +0000)]
Some improvements to the nagios plugin. Default parameter is now hitrate.

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

17 years agoTweak props
des [Mon, 2 Jul 2007 10:07:55 +0000 (10:07 +0000)]
Tweak props

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

17 years agoAutoconfuse.
des [Mon, 2 Jul 2007 08:24:52 +0000 (08:24 +0000)]
Autoconfuse.

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

17 years agoInstall headers, and register with pkg-config.
des [Mon, 2 Jul 2007 08:23:31 +0000 (08:23 +0000)]
Install headers, and register with pkg-config.

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

17 years agoAdded nagios plugin for varnish. It is very basic, and still needs some more work.
cecilihf [Mon, 2 Jul 2007 07:14:53 +0000 (07:14 +0000)]
Added nagios plugin for varnish. It is very basic, and still needs some more work.
All parameters shown with the use of varnishstat -1 can be monitored.

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

17 years agoGreatly improve this test; see $DESCR + comments for details.
des [Fri, 29 Jun 2007 14:05:49 +0000 (14:05 +0000)]
Greatly improve this test; see $DESCR + comments for details.

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

17 years agoAdd an usleep() method based on select().
des [Fri, 29 Jun 2007 14:05:21 +0000 (14:05 +0000)]
Add an usleep() method based on select().

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

17 years agoAdd a regression test for the LRU. Currently, it tests that the child does
des [Fri, 29 Jun 2007 12:57:55 +0000 (12:57 +0000)]
Add a regression test for the LRU.  Currently, it tests that the child does
not crash when the cache fills up, and that a request for a document that
ought to have been evicted does not result in a cache hit.

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

17 years agoShut down the client before returning.
des [Fri, 29 Jun 2007 12:56:44 +0000 (12:56 +0000)]
Shut down the client before returning.

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

17 years agoRun varnishd with the smallest allowable storage file.
des [Fri, 29 Jun 2007 12:54:24 +0000 (12:54 +0000)]
Run varnishd with the smallest allowable storage file.

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

17 years agoOops!
des [Fri, 29 Jun 2007 10:15:10 +0000 (10:15 +0000)]
Oops!

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

17 years agoSimplify.
des [Fri, 29 Jun 2007 10:04:41 +0000 (10:04 +0000)]
Simplify.

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

17 years agoSimplify.
des [Fri, 29 Jun 2007 10:04:12 +0000 (10:04 +0000)]
Simplify.

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

17 years agoFix some style nits and an out-of-bounds array dereference.
des [Fri, 29 Jun 2007 10:03:55 +0000 (10:03 +0000)]
Fix some style nits and an out-of-bounds array dereference.

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

17 years agoWhitespace cleanup
des [Fri, 29 Jun 2007 08:20:36 +0000 (08:20 +0000)]
Whitespace cleanup

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

17 years agoAlmost complete rewrite to address a number of interface issues. Most
des [Thu, 28 Jun 2007 15:10:24 +0000 (15:10 +0000)]
Almost complete rewrite to address a number of interface issues.  Most
importantly, the display will now dynamically scale when the terminal is
resized, and will be updated regularly regardless of the rate at which log
data arrive.

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

17 years agoRewrite to better handle both the curses case and the one-shot case.
des [Thu, 28 Jun 2007 13:34:44 +0000 (13:34 +0000)]
Rewrite to better handle both the curses case and the one-shot case.

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

17 years agoFurther cosmetic improvements + documentation updates
des [Thu, 28 Jun 2007 13:33:59 +0000 (13:33 +0000)]
Further cosmetic improvements + documentation updates

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

17 years agoHandle Ctrl-Z and Ctrl-T.
des [Thu, 28 Jun 2007 12:07:51 +0000 (12:07 +0000)]
Handle Ctrl-Z and Ctrl-T.

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

17 years agoNumerous improvements: display the instance name in the upper right corner;
des [Thu, 28 Jun 2007 10:29:27 +0000 (10:29 +0000)]
Numerous improvements: display the instance name in the upper right corner;
don't show more lines than the terminal can fit; correctly react to terminal
size changes; react to Ctrl-L (redraw) and Ctrl-C / Ctrl-Q (quit).

The layout code could use a cleanup, and we still fail to DTRT if the width
of the terminal is less than that of our data, but this should not be a
problem in daily use.

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

17 years agoExpose the instance name associated with the currently open VSL file.
des [Thu, 28 Jun 2007 10:25:47 +0000 (10:25 +0000)]
Expose the instance name associated with the currently open VSL file.

This is a bletcherous hack - the entire API needs cleaning up.

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

17 years agoSome of the statistics we gather are accumulated totals, while others are
des [Thu, 28 Jun 2007 09:35:56 +0000 (09:35 +0000)]
Some of the statistics we gather are accumulated totals, while others are
instantaneous measurements.  For instance, we report the total number of
allocator requests made over the child's lifetime, but we also report the
amount of storage in use at any particular moment.

The difference is important, because accumulated totals can be averaged
over the program's lifetime (or over the last N seconds), but instantaneous
measurements can't.

Recycle the format field in MAC_STAT() (it was never used anyway) into a
single-character flag indicating whether each item is an accumulated total
('a') or an instantaneous measure ('i').  Use this in varnishstat to skip
averaging non-averageable numbers.

Also rework varnishstat's "once" mode to show 1) each statistic's symbolic
name, 2) its current value, 3) if appropriate, its value averaged over the
process lifetime, and 4) its description.

The reason for displaying the symbolic name is to simplify scripting, and
to serve as a reference for looking up symbolic names to pass to e.g. the
upcoming Nagios plugin.

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

17 years agoMostly finish the LRU code and its integration:
des [Wed, 27 Jun 2007 12:56:04 +0000 (12:56 +0000)]
Mostly finish the LRU code and its integration:

 - Wrap the storage code so we don't need to duplicate the "toss out some old
   crap and try again" logic everywhere.  This will also help when / if we
   decide to add support for multiple concurrent storage arenas.

 - While I'm at it, implement sma_trim().

 - Rework the interaction between the LRU and expiry code.  Instead of placing
   objects retired by the LRU on death row, immediately terminate them.

 - Give the LRU code its own fake session and worker so we don't have to pass
   it a session pointer.

 - Rework the LRU API, and add LRU_DiscardOne() which discards a single
   object.  This is what the stevedore code uses.

Known or suspected issues:

 - The LRU and expiry code should use the same mutex, and / or the possiblity
   for races between them should be examined closely.

 - LRU_Init() needs to be looked at and possibly moved.

 - LRU_DiscardSpace() and LRU_DiscardTime() are unused and quite possibly useless.

 - Logging and statistics related to the LRU need more attention.

 - The stevedore API can probably be improved.

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

17 years agoDon't fill the entire workspace with read-ahead data.
phk [Wed, 27 Jun 2007 12:43:08 +0000 (12:43 +0000)]
Don't fill the entire workspace with read-ahead data.

Eventually we need to separate the "max http header size" from the
workspace size, but that will take a bit of pondering.

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

17 years agoMake sure to reset the workspaces of the backend connection between
phk [Wed, 27 Jun 2007 12:37:34 +0000 (12:37 +0000)]
Make sure to reset the workspaces of the backend connection between
requests, otherwise we end up filling it up with Content-Length: headers
if we manage to keep the backend busy.

Also make the snapshot of the preferred workspace-size volatile to ensure
that we are consistent.

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

17 years agoAdded munin plugins.
cecilihf [Wed, 27 Jun 2007 12:21:58 +0000 (12:21 +0000)]
Added munin plugins.

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

17 years agoCreate $(localstatedir)/varnish at install time.
des [Tue, 26 Jun 2007 12:18:01 +0000 (12:18 +0000)]
Create $(localstatedir)/varnish at install time.

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

17 years agoFurther refine -n handling. The argument to -n is now either an absolute
des [Tue, 26 Jun 2007 11:52:25 +0000 (11:52 +0000)]
Further refine -n handling.  The argument to -n is now either an absolute
path, or a path relative to $localstatedir/varnish.  By default, it is set
to the host name, which results in $localstatedir/varnish/$hostname.

This logic is centralized in instance.c, which is compiled into both
varnishd and libvarnishapi, with prototypes in varnishapi.h and heritage.h.

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

17 years agoAdd missing Nd
des [Tue, 26 Jun 2007 11:42:30 +0000 (11:42 +0000)]
Add missing Nd

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

17 years agoCorrect copyright + some style nits
des [Tue, 26 Jun 2007 11:41:23 +0000 (11:41 +0000)]
Correct copyright + some style nits

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

17 years agoIgnore generated files
des [Tue, 26 Jun 2007 11:37:34 +0000 (11:37 +0000)]
Ignore generated files

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

17 years agoReorder, expand tags
des [Tue, 26 Jun 2007 11:36:36 +0000 (11:36 +0000)]
Reorder, expand tags

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

17 years agoMarkup all VCL variables as RO, WO or RW and generate and check code
phk [Tue, 26 Jun 2007 10:01:49 +0000 (10:01 +0000)]
Markup all VCL variables as RO, WO or RW and generate and check code
accordingly.

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

17 years agoRetire the crc32_2s() function.
phk [Tue, 26 Jun 2007 09:37:18 +0000 (09:37 +0000)]
Retire the crc32_2s() function.

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

17 years agoTraffic replay tool. Parses varnish logs and attempts to recreate the traffic
cecilihf [Tue, 26 Jun 2007 06:56:03 +0000 (06:56 +0000)]
Traffic replay tool. Parses varnish logs and attempts to recreate the traffic

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

17 years agoremove "name" from the parameters, it isn't one.
phk [Mon, 25 Jun 2007 21:24:27 +0000 (21:24 +0000)]
remove "name" from the parameters, it isn't one.

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

17 years agoRedo the -n argument code, it had too many problems:
phk [Mon, 25 Jun 2007 21:12:17 +0000 (21:12 +0000)]
Redo the -n argument code, it had too many problems:

We need to process -P and -f arguments before we change directory.
(ticket 120)

(XXX: what about storage and hash arguments ??)

The daemon(3) call should not change our directory subsequently.
(ticket 121)

There is no need to enforce a hostname style format on the argument,
a directory nam makes much more sense, since that is what we need.
Defaulting to /tmp instead of our hostname makes more sense (ticket 119).

This also allows the admin to use a different directory if /tmp is
mounted noexec (ticket 111)

Put the directoryname used in the proctitle (via heritage)

XXX: for docs: vcl.load CLI commands will work relative to the -n directory.

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

17 years agoMake it possible to pass a filedescriptor to VCC_CompileFile() if the file
phk [Mon, 25 Jun 2007 20:44:06 +0000 (20:44 +0000)]
Make it possible to pass a filedescriptor to VCC_CompileFile() if the file
is already open.  The filedescriptor will be closed.

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

17 years agoFirst step in implementing early retirement of objects when the cache fills
des [Mon, 25 Jun 2007 17:04:09 +0000 (17:04 +0000)]
First step in implementing early retirement of objects when the cache fills
up: implement a "sloppy" LRU list.  An object is placed on the list (or moved
to the head of the list if it's already on it and hasn't moved recently) by
calling LRU_Enter(), and removed by calling LRU_Remove().  LRU_DiscardSpace()
will iterate through the LRU list, starting at the back, and retire objects
(by adding them to the deathrow list) until the sum of the length of the
retired objects reaches a certain number.  Similarly, LRU_DiscardTime() will
retire objects which haven't moved since a specified cutoff date.  In both
cases, vcl_discard() will be given a chance to inspect the object and veto
its retirement.

Currently, LRU_Enter() and LRU_Remove() are called from HSH_Lookup() and
HSH_Deref() respectively.  There may be better alternatives.

Neither LRU_DiscardSpace() nor LRU_DiscardTime() is currently called from
anywhere.  There are a number of issues to consider: for instance, even if
LRU_DiscardSpace() is called when a high-water mark is reached, there is
still a possibility that the cache might fill up before it has had a chance
to finish and the hangman has had a chance to process the deathrow list.

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

17 years agoUse FREE_OBJ() instead of just free() when freeing miniobjs.
des [Mon, 25 Jun 2007 16:25:29 +0000 (16:25 +0000)]
Use FREE_OBJ() instead of just free() when freeing miniobjs.

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

17 years agoAvoid an assertion failure by not calling EXP_TTLChange() for objects which
des [Mon, 25 Jun 2007 16:24:18 +0000 (16:24 +0000)]
Avoid an assertion failure by not calling EXP_TTLChange() for objects which
are not on the expiry heap.

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

17 years agoDocument vcl_discard().
des [Mon, 25 Jun 2007 15:54:22 +0000 (15:54 +0000)]
Document vcl_discard().

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

17 years agoWhitespace nits.
des [Mon, 25 Jun 2007 14:24:49 +0000 (14:24 +0000)]
Whitespace nits.

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

17 years agoMaintain statistics about the number of allocations made and the amount of
des [Mon, 25 Jun 2007 14:24:09 +0000 (14:24 +0000)]
Maintain statistics about the number of allocations made and the amount of
allocated and free space.

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

17 years agoAdd fields for storage manager statistics.
des [Mon, 25 Jun 2007 14:15:52 +0000 (14:15 +0000)]
Add fields for storage manager statistics.

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

17 years agoActually get the logic right here, if there is no Vary string, the
phk [Mon, 25 Jun 2007 14:12:54 +0000 (14:12 +0000)]
Actually get the logic right here, if there is no Vary string, the
object is acceptable to all clients.

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

17 years agoFix a NULL pointer deref in the Vary code.
phk [Mon, 25 Jun 2007 14:10:34 +0000 (14:10 +0000)]
Fix a NULL pointer deref in the Vary code.

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

17 years agoGive vcl_discard() valid return-actions "keep" and "discard".
phk [Mon, 25 Jun 2007 12:38:20 +0000 (12:38 +0000)]
Give vcl_discard() valid return-actions "keep" and "discard".

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

17 years agoImplement resp.proto resp.status and resp.response.
phk [Mon, 25 Jun 2007 10:37:11 +0000 (10:37 +0000)]
Implement resp.proto resp.status and resp.response.

Visible from vcl_fetch() only.

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

17 years agoDiscard any listen sockets that fail to bind().
phk [Mon, 25 Jun 2007 10:22:44 +0000 (10:22 +0000)]
Discard any listen sockets that fail to bind().

This can happen if you get an IPv6 address for the -a argument, but
runs without IPv6 enabled in your kernel.  Typically happens only
for localhost.

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

17 years agoMake sure that -F and -d are exclusive.
phk [Mon, 25 Jun 2007 09:46:30 +0000 (09:46 +0000)]
Make sure that -F and -d are exclusive.

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

17 years agoAdd -F flag, to force varnishd to run in the foreground.
phk [Mon, 25 Jun 2007 09:44:54 +0000 (09:44 +0000)]
Add -F flag, to force varnishd to run in the foreground.

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

17 years agoUse the correct target of sizeof().
phk [Mon, 25 Jun 2007 09:23:14 +0000 (09:23 +0000)]
Use the correct target of sizeof().

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

17 years agoA friendly reminder
phk [Mon, 25 Jun 2007 09:20:02 +0000 (09:20 +0000)]
A friendly reminder

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

17 years agoUse an enum instead of magic '1' and '2' values to VRT_GetHdr.
phk [Mon, 25 Jun 2007 09:10:20 +0000 (09:10 +0000)]
Use an enum instead of magic '1' and '2' values to VRT_GetHdr.

Remove bogus "has_string" variable marking, it can be derived from the type.

Make obj.* variables valid in vcl_timeout() and vcl_discard()

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

17 years agoMove variable related stuff to vcc_var.c
phk [Mon, 25 Jun 2007 08:57:09 +0000 (08:57 +0000)]
Move variable related stuff to vcc_var.c

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

17 years agoMake the VCL compiler complain about attempts to access variables outside
phk [Mon, 25 Jun 2007 08:17:25 +0000 (08:17 +0000)]
Make the VCL compiler complain about attempts to access variables outside
their scope.  One example of this is the "req.hash" variable which only
exists in the vcl_hash method.

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

17 years agoAdd bitmap of methods where they are valid to all objects.
phk [Mon, 25 Jun 2007 07:14:08 +0000 (07:14 +0000)]
Add bitmap of methods where they are valid to all objects.

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

17 years agoAdd VCL_MET_${METHOD} bitmap defines
phk [Mon, 25 Jun 2007 07:04:13 +0000 (07:04 +0000)]
Add VCL_MET_${METHOD} bitmap defines

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

17 years agoAlso tun the compiled VCL through cc(1) and try to load it into mgt process
phk [Mon, 25 Jun 2007 06:46:34 +0000 (06:46 +0000)]
Also tun the compiled VCL through cc(1) and try to load it into mgt process
when -C is specified, this makes it easier to do completeness test on the
VRT interface.

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

17 years agoAdd vcl_discard{} method, which can return discard or pass actions.
phk [Mon, 25 Jun 2007 06:14:40 +0000 (06:14 +0000)]
Add vcl_discard{} method, which can return discard or pass actions.

This is for DES' work on LRU list.

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

17 years agoFurther sockaddr/sockaddr_storage sanitation in order to quiet FlexeLint
phk [Sun, 24 Jun 2007 10:43:15 +0000 (10:43 +0000)]
Further sockaddr/sockaddr_storage sanitation in order to quiet FlexeLint

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

17 years agostrchr(const char *) returns a const char *.
phk [Sun, 24 Jun 2007 10:42:08 +0000 (10:42 +0000)]
strchr(const char *) returns a const char *.

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

17 years agoRoll a couple of layers off these asserts
phk [Sun, 24 Jun 2007 10:17:29 +0000 (10:17 +0000)]
Roll a couple of layers off these asserts

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

17 years agoExplicitly cat to int: we mean it.
phk [Sun, 24 Jun 2007 10:17:03 +0000 (10:17 +0000)]
Explicitly cat to int: we mean it.

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

17 years agoWhitespace nit
phk [Sun, 24 Jun 2007 10:16:41 +0000 (10:16 +0000)]
Whitespace nit

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

17 years agoUse C-unsigned for VCL-BOOL variables
phk [Sun, 24 Jun 2007 10:03:09 +0000 (10:03 +0000)]
Use C-unsigned for VCL-BOOL variables

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

17 years agoMark WS_Init() as custodial
phk [Sun, 24 Jun 2007 10:02:41 +0000 (10:02 +0000)]
Mark WS_Init() as custodial

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

17 years agoDont free(3) stack variables.
phk [Sun, 24 Jun 2007 09:55:53 +0000 (09:55 +0000)]
Dont free(3) stack variables.

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

17 years agoRemove unused #includes
phk [Sun, 24 Jun 2007 09:41:55 +0000 (09:41 +0000)]
Remove unused #includes

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

17 years agoUse sockaddr_storage also here.
phk [Sun, 24 Jun 2007 09:40:22 +0000 (09:40 +0000)]
Use sockaddr_storage also here.

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

17 years agoMake sure we cache a consistent view of the workspace size.
phk [Sun, 24 Jun 2007 09:40:09 +0000 (09:40 +0000)]
Make sure we cache a consistent view of the workspace size.

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

17 years agoremove unnecessary struct tcp_addr forward decl.
phk [Sun, 24 Jun 2007 09:29:21 +0000 (09:29 +0000)]
remove unnecessary struct tcp_addr forward decl.

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

17 years agoMake HSH_Freestore() static
phk [Sun, 24 Jun 2007 09:27:18 +0000 (09:27 +0000)]
Make HSH_Freestore() static

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

17 years agoRemove http_IsBodyless, it is no longer used.
phk [Sun, 24 Jun 2007 09:23:38 +0000 (09:23 +0000)]
Remove http_IsBodyless, it is no longer used.

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