]> err.no Git - varnish/log
varnish
16 years agoParse a random director into an appropriate data structure,
phk [Tue, 22 Jan 2008 10:48:49 +0000 (10:48 +0000)]
Parse a random director into an appropriate data structure,
still bits missing.

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

16 years agoMake it possible to refer to backend hosts (== simple backends) by name.
phk [Tue, 22 Jan 2008 09:55:36 +0000 (09:55 +0000)]
Make it possible to refer to backend hosts (== simple backends) by name.

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

16 years agoDebian packaging: update changelog
ssm [Tue, 22 Jan 2008 08:36:07 +0000 (08:36 +0000)]
Debian packaging: update changelog

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

16 years agoBail if there are multiple .host or .port fields in one backend host.
phk [Tue, 22 Jan 2008 08:32:23 +0000 (08:32 +0000)]
Bail if there are multiple .host or .port fields in one backend host.

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

16 years agoDebian packaging: Only reload varnishlog if it is running.
ssm [Tue, 22 Jan 2008 08:28:18 +0000 (08:28 +0000)]
Debian packaging: Only reload varnishlog if it is running.
(Debian bug #462029)

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

16 years agoDebian packaging: Add a debian revision to the version number
ssm [Mon, 21 Jan 2008 19:04:41 +0000 (19:04 +0000)]
Debian packaging: Add a debian revision to the version number

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

16 years agoStart the long awaited overhaul of the backend code and syntax.
phk [Mon, 21 Jan 2008 13:09:17 +0000 (13:09 +0000)]
Start the long awaited overhaul of the backend code and syntax.

Off the bat, this affects only the simple backend case, and the
main thrust is a syntax change from a dynamic procedural assignment
style:

backend b1 {
set backend.host = "fs.freebsd.dk";
set backend..port = "80";
}

to a constant structural definition style:

backend b1 {
.host = "fs.freebsd.dk";
.port = "80";
}

A helpfull compile error will advice on this change.

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

16 years agoMake sure to terminate the movement of a request's body if we get an
phk [Fri, 18 Jan 2008 10:42:27 +0000 (10:42 +0000)]
Make sure to terminate the movement of a request's body if we get an
EOF from the client.

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

16 years agoUse 192.0.2.0/24 in our examples, this net is reserved for documentation in RFC3330
ssm [Fri, 18 Jan 2008 07:35:17 +0000 (07:35 +0000)]
Use 192.0.2.0/24 in our examples, this net is reserved for documentation in RFC3330

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

16 years agoRework the handling of message-bodies in requests to be closer to
phk [Wed, 16 Jan 2008 15:15:39 +0000 (15:15 +0000)]
Rework the handling of message-bodies in requests to be closer to
RFC2616 and catch things we don't deal with better.

Move code to receive body from request into separate function,
FetchReqBody() so it can be invoked when center::STP_HIT.

Check read errors and make FetchReqBody() return an error code for
client/server side so we don't penalize backends for client trouble.

Make it a client error, for now, to send chunked encoding.

This also isolates the big stack buffer from the subsequent function
calls in Fetch() and will be saner if we ever add chunked-encoding
handling.

Only send the body to the backend on pass, otherwise discard it.

This is controlled via the sp->sendbody flag which is reset in at
STP_RECV and set it at STP_PASS.

In STP_HIT, on deliver, call FetchReqBody() to dispose of any body
the request might contain.

Filter Content-Length: headers out (c->b) on fetches, but not for pass.

Rewrite default vcl_recv{} to be take advantage of our new capabilities.

This should make PUT, DELETE, OPTIONS, and TRACE work as well as POST.

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

16 years agoMissed an assignment in last commit.
phk [Wed, 16 Jan 2008 14:53:48 +0000 (14:53 +0000)]
Missed an assignment in last commit.

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

16 years agoMake the destination pointer optional to http_GetHdr(), we might just
phk [Wed, 16 Jan 2008 14:49:27 +0000 (14:49 +0000)]
Make the destination pointer optional to http_GetHdr(), we might just
want to know if the header is there at all.

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

16 years agoMark return value as intentionally unused.
phk [Wed, 16 Jan 2008 11:44:30 +0000 (11:44 +0000)]
Mark return value as intentionally unused.

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

16 years agoMake Flexelint happier about our private ctype.
phk [Wed, 16 Jan 2008 11:39:06 +0000 (11:39 +0000)]
Make Flexelint happier about our private ctype.

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

16 years agoIntroduce the TRUST_ME() macro for voilating the C compilers pointer
phk [Wed, 16 Jan 2008 11:34:28 +0000 (11:34 +0000)]
Introduce the TRUST_ME() macro for voilating the C compilers pointer
sensibilities.  If only they had done const right...

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

16 years agoMove the enum out of the struct to cater for marginal pedantism on
phk [Wed, 16 Jan 2008 11:27:34 +0000 (11:27 +0000)]
Move the enum out of the struct to cater for marginal pedantism on
the part of FlexeLint.

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

16 years agofix spelling mistake reported in #183
phk [Wed, 16 Jan 2008 10:15:27 +0000 (10:15 +0000)]
fix spelling mistake reported in #183

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

16 years agoFix ticket #179: non-ascii reason-phrase.
phk [Wed, 16 Jan 2008 10:08:34 +0000 (10:08 +0000)]
Fix ticket #179: non-ascii reason-phrase.

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

16 years agoPave more road for prefetch:
phk [Mon, 14 Jan 2008 10:42:56 +0000 (10:42 +0000)]
Pave more road for prefetch:

Sanity-check values assigned to obj.prefetch from VCL: if before present
time or after ttl, SHM a VCL_info message and set obj.prefetch to zero
disabling prefetch.

Change objects/timer interaction:  We only keep track of the first timer for
each object (->timer_when) and add a field to remember what we intend to
do at that time (->timer_what).

Rename heap_idx to timer_idx to group the relevant fields (XXX: it should be
accessed through function outside cache_expire.c which should be called
cache_timer.c now).

Abolish the 30 second advance move to death-row.

When the prefetch timer expires, SHM a debug message and don't do anything.

Minor polishing and cleanup.

Add vcl_prefetch{} to default VCL and set prefetch 30 seconds before ttl.

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

16 years agoAdd SHM tag VCL_info for informative messages from VCL execution.
phk [Mon, 14 Jan 2008 10:30:47 +0000 (10:30 +0000)]
Add SHM tag VCL_info for informative messages from VCL execution.

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

16 years agoAdd support for obj.prefetch variable
phk [Mon, 14 Jan 2008 09:19:06 +0000 (09:19 +0000)]
Add support for obj.prefetch variable

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

16 years agoAdd VCC support for:
phk [Mon, 14 Jan 2008 09:14:56 +0000 (09:14 +0000)]
Add VCC support for:

Variables that can take relative, currently limited to negative,
time intervals.

vcl_prefetch{} method

obj.prefetch variable.

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

16 years agoAdd missing ERRCHK() to suppress subsequent syntax errors.
phk [Mon, 14 Jan 2008 08:55:58 +0000 (08:55 +0000)]
Add missing ERRCHK() to suppress subsequent syntax errors.

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

16 years agoNot all curses have KEY_RESIZE
phk [Thu, 10 Jan 2008 23:16:01 +0000 (23:16 +0000)]
Not all curses have KEY_RESIZE

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

16 years agoUse IOV_MAX as limit if it is smaller on (HTTP_HDR_MAX * 2).
phk [Thu, 10 Jan 2008 23:15:39 +0000 (23:15 +0000)]
Use IOV_MAX as limit if it is smaller on (HTTP_HDR_MAX * 2).

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

16 years agoDon't even look for senfile, it doesn't work for what we need on
phk [Tue, 8 Jan 2008 14:35:09 +0000 (14:35 +0000)]
Don't even look for senfile, it doesn't work for what we need on
any of the platforms right now.

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

16 years agoMake inlining C with C{ ... }C legal at the toplevel (in addition to
phk [Tue, 8 Jan 2008 14:16:38 +0000 (14:16 +0000)]
Make inlining C with C{ ... }C legal at the toplevel (in addition to
in compounds).

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

16 years agoSimplify calculation of storage file by using str2bytes() function.
phk [Tue, 8 Jan 2008 10:58:04 +0000 (10:58 +0000)]
Simplify calculation of storage file by using str2bytes() function.

Move unsightly #ifdef STATVFS stuff into small helper function.

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

16 years agoRemove files which confuse users who mistake them for documentation (see #77).
des [Tue, 8 Jan 2008 10:37:07 +0000 (10:37 +0000)]
Remove files which confuse users who mistake them for documentation (see #77).
There may be a case for resurrecting syntax.txt, but only if it is fixed to
reflect what was actually implemented as opposed to what was proposed a year
ago.

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

16 years agoExtend the str2bytes() function to also cope with percentages of a
phk [Tue, 8 Jan 2008 10:35:29 +0000 (10:35 +0000)]
Extend the str2bytes() function to also cope with percentages of a
size given as parameter.

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

16 years agoAdd -l argument for specifying shared memory log size.
phk [Tue, 8 Jan 2008 09:56:50 +0000 (09:56 +0000)]
Add -l argument for specifying shared memory log size.

Increase default from 8M to 80M to reduce roll-over frequency on busy servers.

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

16 years agoAdd a str2bytes() function which converts byte size strings to
phk [Tue, 8 Jan 2008 09:42:29 +0000 (09:42 +0000)]
Add a str2bytes() function which converts byte size strings to
number of bytes.

In difference from for instance FreeBSD's relatively newly added
expand_number(), this function also takes floatingpoint specifications
like "1.5T".

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

16 years agoDebian packaging: Remove lintian overrides
ssm [Wed, 2 Jan 2008 06:26:23 +0000 (06:26 +0000)]
Debian packaging: Remove lintian overrides

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

16 years agoDebian packaging: Tag library and development package with correct section.
ssm [Wed, 2 Jan 2008 06:25:36 +0000 (06:25 +0000)]
Debian packaging: Tag library and development package with correct section.

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

16 years agoupdates from fedora build
ingvar [Sat, 29 Dec 2007 21:11:20 +0000 (21:11 +0000)]
updates from fedora build

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

16 years agoWhen writing to a file, fflush() after every line so tail -F will work.
des [Thu, 20 Dec 2007 13:57:31 +0000 (13:57 +0000)]
When writing to a file, fflush() after every line so tail -F will work.

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

16 years agoOnly look for sendfile() on platforms where we know how to use it.
des [Thu, 20 Dec 2007 13:35:33 +0000 (13:35 +0000)]
Only look for sendfile() on platforms where we know how to use it.

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

16 years agoChange spec file to work with fedora as well.
ssm [Thu, 20 Dec 2007 11:18:21 +0000 (11:18 +0000)]
Change spec file to work with fedora as well.

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

16 years agoAdd another uploader for the debian package
ssm [Thu, 20 Dec 2007 11:03:58 +0000 (11:03 +0000)]
Add another uploader for the debian package

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

16 years agocomment out autogen.sh invocation
ssm [Thu, 20 Dec 2007 10:38:06 +0000 (10:38 +0000)]
comment out autogen.sh invocation

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

16 years agoRed hat packaging, updated spec file
ssm [Thu, 20 Dec 2007 09:50:07 +0000 (09:50 +0000)]
Red hat packaging, updated spec file
* Bumped version and release numbers
* Added build dependency for libxslt, for xsltproc

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

16 years agoredhat packaging: add version number change perfomed in branches/1.1 to trunk as...
ssm [Thu, 20 Dec 2007 09:43:37 +0000 (09:43 +0000)]
redhat packaging: add version number change perfomed in branches/1.1 to trunk as well

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

16 years agoSmall changes to README.redhat
ingvar [Wed, 19 Dec 2007 20:29:36 +0000 (20:29 +0000)]
Small changes to README.redhat

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

16 years agor2285 and r2286 have been merged.
des [Tue, 18 Dec 2007 17:19:46 +0000 (17:19 +0000)]
r2285 and r2286 have been merged.

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

16 years agoTweak the panic string, and document how to extract it post-mortem.
des [Tue, 18 Dec 2007 17:02:39 +0000 (17:02 +0000)]
Tweak the panic string, and document how to extract it post-mortem.

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

16 years agoTweak a startup message.
des [Tue, 18 Dec 2007 17:02:05 +0000 (17:02 +0000)]
Tweak a startup message.

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

16 years agoBuild the 1.1.2 change log.
des [Tue, 18 Dec 2007 17:00:29 +0000 (17:00 +0000)]
Build the 1.1.2 change log.

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

16 years agoFull change log for 1.1.2 (corresponding to branches/1.1 as of today).
des [Tue, 18 Dec 2007 17:00:19 +0000 (17:00 +0000)]
Full change log for 1.1.2 (corresponding to branches/1.1 as of today).
References to tickets have been included where I have been able to track
down the ticket corresponding to a particular commit.

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

16 years agoOrder change logs in reverse chronological order to make it easier to add
des [Tue, 18 Dec 2007 16:50:26 +0000 (16:50 +0000)]
Order change logs in reverse chronological order to make it easier to add
new ones.

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

16 years agoAdd $NOTES as a hack to document the fact that we know 1.1.2 fails some of
des [Tue, 18 Dec 2007 16:47:44 +0000 (16:47 +0000)]
Add $NOTES as a hack to document the fact that we know 1.1.2 fails some of
the tests.  This should be revisited later; ideally, the framework should
know which tests are expected to pass and which are expected to fail, and
flag any deviation (if a test is expected to fail but passes, it is
probable that the test is broken)

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

16 years agoFixed a small typo in the varnishd man page
ssm [Tue, 18 Dec 2007 06:58:33 +0000 (06:58 +0000)]
Fixed a small typo in the varnishd man page

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

16 years agoWhen an object is being fetched from the backend, other requests for it
phk [Tue, 11 Dec 2007 12:04:58 +0000 (12:04 +0000)]
When an object is being fetched from the backend, other requests for it
are parked not holding a worker thread, until the fetching session lowers
the busy bit on the object.

At that point we would release all the parked requests into the thread
pool to be serviced, causing instant congestion and calls for road-pricing
if the backend were a bit slow on an oft-requested object.

Change the restart policy to be paced exponential:

When we clear the busy bits, we unpark "rush_exponent" requests into
the thread pool to start the show.

Whenever the object is dereferenced, in practice whenever a request
has been serviced, another "rush_exponent" worth of requests are
unparked into the tread pool.

Set the parameter to a conservative 3 until we know more about the
behaviour in practice.

If it is a big object and/or the clients are on slow lines, 3 may
be an order of magnitude to small.

Attempts to fix: #188

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

16 years agoAttempt to name threads if possible.
phk [Tue, 11 Dec 2007 09:03:51 +0000 (09:03 +0000)]
Attempt to name threads if possible.

On FreeBSD this means that for instance "top -H" will show the
varnish threads as "cache-foo" for various values of foo, hopefully
giving us another debugging hint.

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

16 years agoCheck if our pthreads sports a pthread_set_name_np() function.
phk [Tue, 11 Dec 2007 09:02:29 +0000 (09:02 +0000)]
Check if our pthreads sports a pthread_set_name_np() function.

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

16 years agoDebian packaging: Remove extra debhelper section in main postinst file, this
ssm [Tue, 11 Dec 2007 07:02:24 +0000 (07:02 +0000)]
Debian packaging: Remove extra debhelper section in main postinst file, this
was included by the debhelper tag as well, which resulted in a double startup
entry, and an error on package installation.

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

16 years agoChanges in the Debian packaging
ssm [Tue, 11 Dec 2007 06:14:49 +0000 (06:14 +0000)]
Changes in the Debian packaging

* Use native version for the debian package
* Add headers to indicate location of varnish source
* Add "xsltproc" to build dependencies

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

16 years agoDebian packaging: do not ignore all errors from make distclean
ssm [Tue, 11 Dec 2007 06:10:47 +0000 (06:10 +0000)]
Debian packaging: do not ignore all errors from make distclean

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

16 years agoIn the debian /etc/default/varnish, remove unused configuration variable, and
ssm [Tue, 11 Dec 2007 05:46:43 +0000 (05:46 +0000)]
In the debian /etc/default/varnish, remove unused configuration variable, and
an erroneous use of -n from the configuration examples.

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

16 years agoGo over the shmlog header processing.
phk [Mon, 10 Dec 2007 08:55:17 +0000 (08:55 +0000)]
Go over the shmlog header processing.

Add a byte to the length field, but retain the 255 bytes restriction
for now.

Add symbolic names for the header fields and macros for multi-byte
fields, and uses these throughout.   This will make it easier next time.

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

16 years agoTCP connections don't quite behave like other fds, and we need to handle
phk [Fri, 7 Dec 2007 12:03:58 +0000 (12:03 +0000)]
TCP connections don't quite behave like other fds, and we need to handle
that for the managers CLI event-engine:

React to POLLNVAL as we would to POLLHUP

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

17 years agoAlso accept the undocumented ENOTCONN error return from close(2).
phk [Fri, 23 Nov 2007 10:47:16 +0000 (10:47 +0000)]
Also accept the undocumented ENOTCONN error return from close(2).

See also http://www.version2.dk/artikel/5153 if you read danish.

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

17 years agoTell people what to do when running in debug mode
phk [Fri, 23 Nov 2007 10:18:46 +0000 (10:18 +0000)]
Tell people what to do when running in debug mode

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

17 years agoPlug these two test-scripts in for the night, until some day where
phk [Tue, 20 Nov 2007 22:28:04 +0000 (22:28 +0000)]
Plug these two test-scripts in for the night, until some day where
I find out where to put ad-hoc stuff like this in the tree.

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

17 years agoAdd esi:comment support. "Support" is defined as: Silently ignore,
phk [Tue, 20 Nov 2007 22:21:05 +0000 (22:21 +0000)]
Add esi:comment support.  "Support" is defined as: Silently ignore,
as opposed to unhandled esi: elments which we complain about in
varnishlog.

Thus, if you want to get a short comment into the shmlog, the
easiest way is to do something like <esi:say a="Hi Mom"> which will
result in a shmlog record:
   11 ESI_xmlerror c at 25: ESI 1.0 unimplemented element "<esi:say Hi Mom>"
But the length of the message is truncated to avoid dumping the entire
source document into the shmlog.

Snip out any unknown esi: element.

While the ESI 1.0 specification doesn't address this directly, my
impression from the document is that they should never leak through
to the client.

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

17 years agoMake <![CDATA[...]]> stateful and handle it correctly across
phk [Tue, 20 Nov 2007 21:47:37 +0000 (21:47 +0000)]
Make <![CDATA[...]]> stateful and handle it correctly across
storage boundaries.  Complain if it isn't closed at the end.

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

17 years agoHandle unreasonably long (ie: larger than the objects workspace) elements
phk [Tue, 20 Nov 2007 21:27:20 +0000 (21:27 +0000)]
Handle unreasonably long (ie: larger than the objects workspace) elements
gracefully.

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

17 years agoWarn about XML/ESI language elements that are not properly closed.
phk [Tue, 20 Nov 2007 21:01:00 +0000 (21:01 +0000)]
Warn about XML/ESI language elements that are not properly closed.

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

17 years agoStorage border bug fixes
phk [Tue, 20 Nov 2007 20:41:19 +0000 (20:41 +0000)]
Storage border bug fixes

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

17 years agoImplement almost complete ESI parsing for objects spanning multiple
phk [Tue, 20 Nov 2007 20:08:13 +0000 (20:08 +0000)]
Implement almost complete ESI parsing for objects spanning multiple
storage chunks.

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

17 years agoMake sure to add verbatim anything leading up to whatever we fail
phk [Tue, 20 Nov 2007 18:33:09 +0000 (18:33 +0000)]
Make sure to add verbatim anything leading up to whatever we fail
to parse due to lack of bytes.

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

17 years agoReset the objects length to zero after we zapped all its component
phk [Tue, 20 Nov 2007 17:20:47 +0000 (17:20 +0000)]
Reset the objects length to zero after we zapped all its component
parts, otherwise we will get trouble (#167 ?) later.

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

17 years agoPass a txt instead of the raw storage into the esi_parser
phk [Tue, 20 Nov 2007 16:43:09 +0000 (16:43 +0000)]
Pass a txt instead of the raw storage into the esi_parser

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

17 years agoMake the incmt and remflg persistent across the parse chunks
phk [Tue, 20 Nov 2007 16:30:23 +0000 (16:30 +0000)]
Make the incmt and remflg persistent across the parse chunks

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

17 years agoMany of our assertions have side effects, so the condition needs to be
des [Tue, 20 Nov 2007 14:58:51 +0000 (14:58 +0000)]
Many of our assertions have side effects, so the condition needs to be
evaluated even if we don't bother to check the result.  We should trust
the compiler to eliminate code that has no effect.

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

17 years agoFix some style issues, and harmonize with varnishncsa(1).
des [Tue, 20 Nov 2007 14:56:21 +0000 (14:56 +0000)]
Fix some style issues, and harmonize with varnishncsa(1).

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

17 years agoMake SIGHUP work: VSL_Dispatch() will not return as long as it has data
des [Tue, 20 Nov 2007 14:55:49 +0000 (14:55 +0000)]
Make SIGHUP work: VSL_Dispatch() will not return as long as it has data
to feed to h_ncsa(), so it is up to h_ncsa() to interrupt it if reopen
is non-zero.

Also remove a superfluous call to VSL_Arg() as was previously done in
varnishlog(1).

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

17 years agoAlso accept deferred EBADF errors.
phk [Tue, 20 Nov 2007 14:32:01 +0000 (14:32 +0000)]
Also accept deferred EBADF errors.

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

17 years agoHandle that the sessions may be killed the worker thread before
phk [Tue, 20 Nov 2007 14:20:36 +0000 (14:20 +0000)]
Handle that the sessions may be killed the worker thread before
we get around to delete the kevent.

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

17 years agoUse a bitmap to check if we own a given file handle, before we
phk [Tue, 20 Nov 2007 12:11:04 +0000 (12:11 +0000)]
Use a bitmap to check if we own a given file handle, before we
do anything about the associated session.

May be relevant relative to: #162

(Bitmap functions slightly general, for possible later reuse)

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

17 years agoSimplify the generation of error responses.
phk [Tue, 20 Nov 2007 12:01:40 +0000 (12:01 +0000)]
Simplify the generation of error responses.

Don't take a detour around cache_response.c, go directly to
cache_synthetic.c.

Don't wast time and energy mucking about with pseudo-objects,
just synthesize the error body directly in the workspace and
send it from there.

Close the session after sending error response, freeing up
resources sounds like a good strategy. (XXX: for futher study).

This might be related to #167

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

17 years agoWe should never have an object when we hit the error state.
phk [Tue, 20 Nov 2007 11:23:37 +0000 (11:23 +0000)]
We should never have an object when we hit the error state.

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

17 years agoWhen closing a backend connection, we can run into a ECONNRESET which
phk [Tue, 20 Nov 2007 11:11:17 +0000 (11:11 +0000)]
When closing a backend connection, we can run into a ECONNRESET which
given circumstances is fair game.

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

17 years agoAdd some asserts to the plumbing around the C-compiler invocation.
phk [Tue, 20 Nov 2007 11:07:47 +0000 (11:07 +0000)]
Add some asserts to the plumbing around the C-compiler invocation.

Collect any messages from the C-compiler and pass them on to the
user, but do not take them as evidence of a failed compilation,
check the returnvalue for that.

To avoid confusion, explicitly say when the VCL program was compiled.

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

17 years agoChange the assert() that triggers in #167 to spassert().
des [Thu, 15 Nov 2007 16:02:05 +0000 (16:02 +0000)]
Change the assert() that triggers in #167 to spassert().

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

17 years agoBigger hammer: panic() is similar to lbv_assert() but takes a struct sess *
des [Thu, 15 Nov 2007 16:01:21 +0000 (16:01 +0000)]
Bigger hammer: panic() is similar to lbv_assert() but takes a struct sess *
from which it tries to extract as much useful information as possible before
it croaks.  The corresponding macro is spassert(), which assumes you have
a struct sess *sp in scope.  This should help a lot with bugs like #167
where important information is not available post-mortem (because sp->obj
points into the cache, which is not included in the core dump)

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

17 years agoAdd a VALID_OBJ() predicate macro.
des [Thu, 15 Nov 2007 15:07:15 +0000 (15:07 +0000)]
Add a VALID_OBJ() predicate macro.

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

17 years agoWhitespace cleanup
des [Thu, 15 Nov 2007 14:18:39 +0000 (14:18 +0000)]
Whitespace cleanup

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

17 years agoForgot to commit this when vtmpfile.c was added.
des [Fri, 9 Nov 2007 22:59:44 +0000 (22:59 +0000)]
Forgot to commit this when vtmpfile.c was added.

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

17 years agoClean up the code a bit, and warn the user when changing a parameter that
des [Fri, 9 Nov 2007 14:44:27 +0000 (14:44 +0000)]
Clean up the code a bit, and warn the user when changing a parameter that
requires the child to be restarted or the VCL script to be reloaded.

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

17 years agoSignificant rewrite of the code used to invoke the C compiler. The most
des [Fri, 9 Nov 2007 14:10:15 +0000 (14:10 +0000)]
Significant rewrite of the code used to invoke the C compiler.  The most
important functional change is that the source is no longer piped to the
compiler; instead, the source file name (which now ends in .c) is passed
on the command line.  This makes it *much* easier to support non-GNU
compilers.

The cc_command parameter processed by a custom function instead of sprintf;
"%s" is replaced with the source file name, "%o" is replaced with the output
file name, and "%%" is replaced with a single "%".

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

17 years agoAdd our own mkstemp(3) clone which allows the template to contain non-
des [Fri, 9 Nov 2007 14:03:13 +0000 (14:03 +0000)]
Add our own mkstemp(3) clone which allows the template to contain non-
placeholder characters after the placeholders.

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

17 years agoWhitespace cleanup.
des [Fri, 9 Nov 2007 12:43:09 +0000 (12:43 +0000)]
Whitespace cleanup.

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

17 years agoWhen diagnostics are enabled, log every kevent that has a session associated
des [Fri, 9 Nov 2007 11:19:45 +0000 (11:19 +0000)]
When diagnostics are enabled, log every kevent that has a session associated
with it.

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

17 years agoIgnore config.cache.
des [Thu, 8 Nov 2007 21:33:53 +0000 (21:33 +0000)]
Ignore config.cache.

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

17 years agoNit
des [Thu, 8 Nov 2007 21:32:42 +0000 (21:32 +0000)]
Nit

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

17 years agoMinimal intervention fix for #162: we can delay arming a kevent, but we
des [Thu, 8 Nov 2007 20:30:06 +0000 (20:30 +0000)]
Minimal intervention fix for #162: we can delay arming a kevent, but we
can't delay disarming it, or we will have a race between the acceptor and
a worker thread.  This will need revisiting at some later date.

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

17 years agoPressing 0-9 will change the delay to the corresponding power of two (e.g.
des [Thu, 8 Nov 2007 16:52:40 +0000 (16:52 +0000)]
Pressing 0-9 will change the delay to the corresponding power of two (e.g.
press 3 for 2^3 = 8 seconds)

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

17 years agoCopy&paste -D (daemonize) from varnishlog.
des [Thu, 8 Nov 2007 16:28:26 +0000 (16:28 +0000)]
Copy&paste -D (daemonize) from varnishlog.

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

17 years agoPick some nits.
des [Thu, 8 Nov 2007 16:27:53 +0000 (16:27 +0000)]
Pick some nits.

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

17 years agoTypo in previous commit.
des [Sat, 3 Nov 2007 12:30:06 +0000 (12:30 +0000)]
Typo in previous commit.

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