]> err.no Git - varnish/log
varnish
17 years agoWe may in fact not have any headers.
phk [Mon, 8 Oct 2007 11:32:30 +0000 (11:32 +0000)]
We may in fact not have any headers.

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

17 years agoOnly attempt to decode status integer if we have a good separation.
phk [Mon, 8 Oct 2007 11:28:39 +0000 (11:28 +0000)]
Only attempt to decode status integer if we have a good separation.

Possibly ticket #164

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

17 years agoAdd an assert for spotting ticket #162
phk [Mon, 8 Oct 2007 11:28:11 +0000 (11:28 +0000)]
Add an assert for spotting ticket #162

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

17 years agoCatch EOF on reads instead of looping.
phk [Mon, 8 Oct 2007 10:33:46 +0000 (10:33 +0000)]
Catch EOF on reads instead of looping.

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

17 years agoDrop the asserts around shutdown(2), there are a number of
phk [Mon, 8 Oct 2007 10:25:47 +0000 (10:25 +0000)]
Drop the asserts around shutdown(2), there are a number of
legitimate error conditions.

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

17 years agoupd
phk [Mon, 8 Oct 2007 09:34:36 +0000 (09:34 +0000)]
upd

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

17 years agoMore acceptor work:
phk [Mon, 8 Oct 2007 08:14:09 +0000 (08:14 +0000)]
More acceptor work:

Make HTC_Rx() return a distinct value for overflow/blast.
Teach vca_handover() to handle HTC_Rx() return status
Use HTC_Rx/vca_handover this way in all three acceptors.
Eliminate vca_pollsession()
Teach CNT_First() about HTC_Rx states.
Log which acceptor we use in shmlog

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

17 years agoBail normally instead of asserting on buffer full.
phk [Mon, 8 Oct 2007 07:51:31 +0000 (07:51 +0000)]
Bail normally instead of asserting on buffer full.
Drop leading whitespace if so informed.

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

17 years agoUse HTC_Rx() directly instead of vca_pollsession() wrapper
phk [Mon, 8 Oct 2007 07:50:31 +0000 (07:50 +0000)]
Use HTC_Rx() directly instead of vca_pollsession() wrapper

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

17 years agocomments/style
phk [Mon, 8 Oct 2007 07:49:26 +0000 (07:49 +0000)]
comments/style

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

17 years agoTry to make the pipe code even more robust
phk [Mon, 8 Oct 2007 07:19:52 +0000 (07:19 +0000)]
Try to make the pipe code even more robust

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

17 years agoFlush the threads shmlog before we try to make up a reponse, so that
phk [Mon, 8 Oct 2007 07:18:48 +0000 (07:18 +0000)]
Flush the threads shmlog before we try to make up a reponse, so that
we know what transactions trigger problems in that code.

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

17 years agoFix ticket #166, debian package issues
ssm [Fri, 5 Oct 2007 09:15:09 +0000 (09:15 +0000)]
Fix ticket #166, debian package issues

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

17 years agoGo over pipe's polling code and try to do it right in one go by
phk [Mon, 1 Oct 2007 12:44:19 +0000 (12:44 +0000)]
Go over pipe's polling code and try to do it right in one go by
actually paying attention to what goes on.

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

17 years agoOops, last commit included some debugging
phk [Mon, 1 Oct 2007 12:27:49 +0000 (12:27 +0000)]
Oops, last commit included some debugging

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

17 years agoRemember to move numeric status when we filter one http to another.
phk [Mon, 1 Oct 2007 12:25:37 +0000 (12:25 +0000)]
Remember to move numeric status when we filter one http to another.

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

17 years agoInitialize the obj->ws before we use it.
phk [Mon, 1 Oct 2007 09:04:15 +0000 (09:04 +0000)]
Initialize the obj->ws before we use it.

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

17 years agoMove the objects and their http header into storage instead of
phk [Mon, 1 Oct 2007 08:54:26 +0000 (08:54 +0000)]
Move the objects and their http header into storage instead of
malloc'ing them.

This should reduce the N(nobj) swap-loading considerably.

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

17 years agoMove the workerthreads log from malloc to stack.
phk [Mon, 1 Oct 2007 07:45:58 +0000 (07:45 +0000)]
Move the workerthreads log from malloc to stack.

Dump sizes of various structures on startup.

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

17 years agoEliminate a & which I tend to forget every single time.
phk [Mon, 1 Oct 2007 07:27:37 +0000 (07:27 +0000)]
Eliminate a & which I tend to forget every single time.

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

17 years agoWe always want to go through vcl_fetch(), even on error 503
phk [Mon, 1 Oct 2007 07:21:26 +0000 (07:21 +0000)]
We always want to go through vcl_fetch(), even on error 503

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

17 years agoAdd VCL action "esi" and a vrt file to contain it.
phk [Sun, 30 Sep 2007 21:27:16 +0000 (21:27 +0000)]
Add VCL action "esi" and a vrt file to contain it.

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

17 years agoMake the number of restarts a parameter.
phk [Sun, 30 Sep 2007 21:11:21 +0000 (21:11 +0000)]
Make the number of restarts a parameter.

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

17 years agoAdd the first stab at a "restart" mechanism.
phk [Sun, 30 Sep 2007 20:57:30 +0000 (20:57 +0000)]
Add the first stab at a "restart" mechanism.

The intent is to be able to do things like:

backend b1 {
set backend.host = "fs.freebsd.dk";
set backend.port = "82";
}
backend b2 {
set backend.host = "fs.freebsd.dk";
set backend.port = "81";
}
backend b3 {
set backend.host = "fs.freebsd.dk";
set backend.port = "80";
}

sub vcl_recv {
remove req.http.cookie;
if (req.restarts == 0) {
set req.backend = b1;
} else if (req.restarts == 1) {
set req.backend = b2;
} else {
set req.backend = b3;
}
}

sub vcl_fetch {
if (obj.status != 200) {
restart;
}
}

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

17 years agoAdd req.restarts variable.
phk [Sun, 30 Sep 2007 20:38:15 +0000 (20:38 +0000)]
Add req.restarts variable.

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

17 years agoAdd "restart" action for most VCL methods.
phk [Sun, 30 Sep 2007 20:36:16 +0000 (20:36 +0000)]
Add "restart" action for most VCL methods.

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

17 years agoEvict backend-health code which had strayed fra from it's proper place.
phk [Sun, 30 Sep 2007 20:19:50 +0000 (20:19 +0000)]
Evict backend-health code which had strayed fra from it's proper place.

cache_fetch.c now reports the response code or a indicative negative
status for failed requests to the backend code.

Any timeouts, keepalives or other overhead processing of health codes
should happen in a thread in the backend handling.

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

17 years agoMore caching of HTTP status
phk [Sun, 30 Sep 2007 20:16:28 +0000 (20:16 +0000)]
More caching of HTTP status

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

17 years agoCache the numeric status code.
phk [Sun, 30 Sep 2007 20:08:26 +0000 (20:08 +0000)]
Cache the numeric status code.

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

17 years agoSignificantly reduce level of paranoia.
phk [Sun, 30 Sep 2007 19:54:28 +0000 (19:54 +0000)]
Significantly reduce level of paranoia.

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

17 years agoWe may not have a worker thread here, we could be called from the
phk [Sun, 30 Sep 2007 19:54:06 +0000 (19:54 +0000)]
We may not have a worker thread here, we could be called from the
acceptor code on a timeout.

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

17 years agoRemove unused #includes
phk [Sun, 30 Sep 2007 19:44:06 +0000 (19:44 +0000)]
Remove unused #includes

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

17 years agonitpicking
phk [Sun, 30 Sep 2007 19:42:16 +0000 (19:42 +0000)]
nitpicking

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

17 years agoSet the poll'ed fd to -1 when we halfclose the fd to avoid
phk [Sun, 30 Sep 2007 19:42:08 +0000 (19:42 +0000)]
Set the poll'ed fd to -1 when we halfclose the fd to avoid
an infinite loop on certain OS's.

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

17 years agoAnother cleanup commit:
phk [Sat, 29 Sep 2007 20:53:53 +0000 (20:53 +0000)]
Another cleanup commit:

Get rid of the httptag enum, we can use the HTTP_T values instead.

Introduce WSP macro to wrap log entries which has a session.

Add our own vctyp() character classifier to simplify HTTP protocol
message parsing.

Unify http_DissectRequest() and http_DissectResponse() processing.

Unify writing of the 5 byte SHMLOG header and other minor cleanups
to shmlog code.

Silence some signed/unsigned/int width warnings in FlexeLint

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

17 years agoComplete the split of HTTP-editing and HTTP-transmission functions.
phk [Fri, 28 Sep 2007 20:13:48 +0000 (20:13 +0000)]
Complete the split of HTTP-editing and HTTP-transmission functions.

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

17 years agoInitial split of code which transfer HTTP protocol messages
phk [Fri, 28 Sep 2007 13:13:11 +0000 (13:13 +0000)]
Initial split of code which transfer HTTP protocol messages
over sockets and things which manipulate them in memory.

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

17 years agoMove the WS_ prototypes down where they belong.
phk [Fri, 28 Sep 2007 13:04:53 +0000 (13:04 +0000)]
Move the WS_ prototypes down where they belong.

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

17 years agoPush the http structure out of the early bits of the reception code.
phk [Fri, 28 Sep 2007 11:07:14 +0000 (11:07 +0000)]
Push the http structure out of the early bits of the reception code.

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

17 years agoPreparation for implementation of restarts: Move the ws from http to
phk [Fri, 28 Sep 2007 10:29:12 +0000 (10:29 +0000)]
Preparation for implementation of restarts: Move the ws from http to
the containing object (session or obj).

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

17 years agoUse CHECK_OBJ_ORNULL().
des [Thu, 27 Sep 2007 10:08:30 +0000 (10:08 +0000)]
Use CHECK_OBJ_ORNULL().

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

17 years agodon't make acl's const, they are not.
phk [Wed, 26 Sep 2007 19:43:56 +0000 (19:43 +0000)]
don't make acl's const, they are not.

Reported by: Martin Aspeli <optilude@gmx.net>

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

17 years agoMore txt'ing
phk [Wed, 26 Sep 2007 19:38:04 +0000 (19:38 +0000)]
More txt'ing

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

17 years agoanother place we can use Tlen
phk [Wed, 26 Sep 2007 19:20:17 +0000 (19:20 +0000)]
another place we can use Tlen

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

17 years agoUse the new txt type more extensively, it does improve readability a bit.
phk [Wed, 26 Sep 2007 19:15:25 +0000 (19:15 +0000)]
Use the new txt type more extensively, it does improve readability a bit.

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

17 years agoConvert the received request and pipelined bytes into txt's.
phk [Wed, 26 Sep 2007 18:59:28 +0000 (18:59 +0000)]
Convert the received request and pipelined bytes into txt's.

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

17 years agostruct http_hdr is more than that, it is a general text handle, so
phk [Wed, 26 Sep 2007 18:56:18 +0000 (18:56 +0000)]
struct http_hdr is more than that, it is a general text handle, so
typedef it as "txt" instead.

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

17 years agoMore flexelint nit-picking of various sorts
phk [Tue, 25 Sep 2007 13:19:07 +0000 (13:19 +0000)]
More flexelint nit-picking of various sorts

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

17 years agoConstify a lot of the VRT API
phk [Tue, 25 Sep 2007 11:51:49 +0000 (11:51 +0000)]
Constify a lot of the VRT API

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

17 years agoMega-Const'ification
phk [Tue, 25 Sep 2007 11:11:15 +0000 (11:11 +0000)]
Mega-Const'ification

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

17 years agoIf the C-compiler fails, we don't know if it created the output file or not.
phk [Tue, 25 Sep 2007 11:05:25 +0000 (11:05 +0000)]
If the C-compiler fails, we don't know if it created the output file or not.

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

17 years agoConstification
phk [Tue, 25 Sep 2007 10:36:59 +0000 (10:36 +0000)]
Constification

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

17 years agoConstification of certain storage functions
phk [Tue, 25 Sep 2007 10:35:44 +0000 (10:35 +0000)]
Constification of certain storage functions

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

17 years agoMake Tim_format() take a double time argument
phk [Tue, 25 Sep 2007 10:32:24 +0000 (10:32 +0000)]
Make Tim_format() take a double time argument

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

17 years agoMake the arguments to CLI functions const-const.
phk [Tue, 25 Sep 2007 10:25:51 +0000 (10:25 +0000)]
Make the arguments to CLI functions const-const.

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

17 years agoCatch up with sys/queue.h changes
phk [Tue, 25 Sep 2007 10:24:34 +0000 (10:24 +0000)]
Catch up with sys/queue.h changes

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

17 years agoThe previous commit made things worse rather than better, as some systems
des [Tue, 25 Sep 2007 08:48:14 +0000 (08:48 +0000)]
The previous commit made things worse rather than better, as some systems
have a <sys/queue.h> that differs in small but important details from what
we expect.  Replace our "queue.h" (which was taken from NetBSD) with a new
"vqueue.h" which is based on FreeBSD's <sys/queue.h> with the debugging
taken out and a "V" prefix added to everything.

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

17 years agoPortability: use -lsocket / -lns on systems that need it (read Solaris),
des [Tue, 25 Sep 2007 08:21:28 +0000 (08:21 +0000)]
Portability: use -lsocket / -lns on systems that need it (read Solaris),
use <sys/queue.h> instead of our own if present.

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

17 years agoUse a config cache.
des [Tue, 25 Sep 2007 08:19:50 +0000 (08:19 +0000)]
Use a config cache.

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

17 years agoNew more paranoid settings for FlexeLint
phk [Tue, 25 Sep 2007 07:57:21 +0000 (07:57 +0000)]
New more paranoid settings for FlexeLint

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

17 years agoMake the logic visible for FlexeLint
phk [Tue, 25 Sep 2007 07:57:06 +0000 (07:57 +0000)]
Make the logic visible for FlexeLint

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

17 years agoMisc changes:
phk [Tue, 25 Sep 2007 07:40:01 +0000 (07:40 +0000)]
Misc changes:

A couple of XXX comments
Some returnvalue asserts
Some pdiff() uses
Change WRK_Flush() to return unsigned

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

17 years agoUnnecessary check
phk [Tue, 25 Sep 2007 07:33:07 +0000 (07:33 +0000)]
Unnecessary check

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

17 years agoBail if we get unknown address families
phk [Tue, 25 Sep 2007 07:32:15 +0000 (07:32 +0000)]
Bail if we get unknown address families

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

17 years agoAssert return values of system{calls,functions}
phk [Tue, 25 Sep 2007 07:30:38 +0000 (07:30 +0000)]
Assert return values of system{calls,functions}

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

17 years agotypo
phk [Tue, 25 Sep 2007 07:22:58 +0000 (07:22 +0000)]
typo

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

17 years agoPolish
phk [Tue, 25 Sep 2007 07:21:40 +0000 (07:21 +0000)]
Polish

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

17 years agoUse pdiff() to guard against negative point differences
phk [Tue, 25 Sep 2007 07:19:54 +0000 (07:19 +0000)]
Use pdiff() to guard against negative point differences

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

17 years agoTwo consts is one const too many.
phk [Tue, 25 Sep 2007 07:12:18 +0000 (07:12 +0000)]
Two consts is one const too many.

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

17 years agoMore const polishing
phk [Tue, 25 Sep 2007 07:11:33 +0000 (07:11 +0000)]
More const polishing

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

17 years agoMake id type "int"
phk [Tue, 25 Sep 2007 07:08:07 +0000 (07:08 +0000)]
Make id type "int"

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

17 years agoConst'ifcation
phk [Tue, 25 Sep 2007 07:06:18 +0000 (07:06 +0000)]
Const'ifcation

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

17 years agoPolish shmlog:
phk [Tue, 25 Sep 2007 06:56:23 +0000 (06:56 +0000)]
Polish shmlog:

The id argument is a file descriptor, so it should be typed "int".
We must have a fmt argument.
Use pdiff.

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

17 years agoWhen we take the difference between two pointers, the result is technically
phk [Tue, 25 Sep 2007 06:51:04 +0000 (06:51 +0000)]
When we take the difference between two pointers, the result is technically
signed.  pdiff() makes sure we never get a negative value.

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

17 years agoUse the correct shmlog function.
phk [Tue, 25 Sep 2007 06:46:57 +0000 (06:46 +0000)]
Use the correct shmlog function.

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

17 years agoThe first of a long sequence of committs, inspired by cranking up FlexeLints
phk [Tue, 25 Sep 2007 06:44:27 +0000 (06:44 +0000)]
The first of a long sequence of committs, inspired by cranking up FlexeLints
nitpicking to new heights:

Make sure VRT_int_string() has enough room and assert that this was the case.

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

17 years agoRe-enable the code causing bug #161 (which is now fixed)
cecilihf [Mon, 24 Sep 2007 13:21:27 +0000 (13:21 +0000)]
Re-enable the code causing bug #161 (which is now fixed)

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

17 years agoFixes bug #161.
cecilihf [Mon, 24 Sep 2007 13:18:04 +0000 (13:18 +0000)]
Fixes bug #161.

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

17 years agoActually, we cannot touch objects on deathrow, so just ignore
phk [Mon, 24 Sep 2007 13:00:33 +0000 (13:00 +0000)]
Actually, we cannot touch objects on deathrow, so just ignore
any object with heap_idx == 0.

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

17 years agoRemove an assert which isn't valid: we could try to LRU_Touch an
phk [Mon, 24 Sep 2007 12:58:14 +0000 (12:58 +0000)]
Remove an assert which isn't valid:  we could try to LRU_Touch an
object on deathrow.

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

17 years agoMake the cli_timeout a parameter. The master will wait this long
phk [Mon, 24 Sep 2007 12:27:54 +0000 (12:27 +0000)]
Make the cli_timeout a parameter.  The master will wait this long
for the client to reply on the internal CLI pipe.

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

17 years agoUpdate random and round-robin backends to use the new convenience functions.
cecilihf [Mon, 24 Sep 2007 12:06:20 +0000 (12:06 +0000)]
Update random and round-robin backends to use the new convenience functions.

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

17 years agoAdd code to VCC to output an identifier for each simple backend which
phk [Mon, 24 Sep 2007 11:25:15 +0000 (11:25 +0000)]
Add code to VCC to output an identifier for each simple backend which
varnishd can use to decide if a backend state can be shared between
multiple VCL programs.

Originally the idea was to calculate a strong hash over the tokens
which define the backend.

Considering the relatively short lengths of backend declarations
and the infrequency of comparisons, we have opted for an extremely
weak hash instead:  We simply output the space separted tokens as
a string.

The net change in code for simple backends is marginal, but for
complex backends this will be a lot simpler to implement.

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

17 years agoOur first cut at a LRU processing contained a three way race and can
phk [Mon, 24 Sep 2007 08:23:34 +0000 (08:23 +0000)]
Our first cut at a LRU processing contained a three way race and can
cause Really Weird Problems if you really provoke it.

+++ Redo from start +++

LRU processing is only relevant for objects which are in the cache and
on the EXP binary heap so we merge the LRU functionality with the EXP
code in order to share locks and object reference counts.

Another thing we overlooked in the first implementation is that the VCL
callout for LRU should be able to examine the client information for
the session which tries to push stuff out, so that QoS/DoS issues can be
considered:

sub vcl_dicard {
if (client.bandwidth > 10 mb/s) {
keep;
}
}

(which sort of indicates that "error" should be a legal action as well)

To enable this, pass the session into the stevedore when we try to
allocate space and temporarily substitute the target object for its
own object while we call vcl_discard().

The outcome of an attempt to make space can take three values, did,
didn't and couldn't.  In the latter case there is no point in trying
again and again, in particular if the cause is incurable, such as
the requested size being larger than the storage.   We still need to
handle failure to allocate storage for that case rather than core dump.

When looking for targets to nuke, we only consider objects on the
binheap which has reference count of 1, objects with higher reference
counts would not free space.

We take prospective targets off the binheap, but retain their
refcount, and tag them with a magic marker while we ponder their
destiny.

It is quite possible that another session could pick the object up
via the cache while we do so, and therefore attempts to update the
ttl or shift them in the lru chain must ignore objects which has
the magic marker.  If the object is kept, the updated ttl will
automatically take effect when we reinsert it in the binheap.

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

17 years agoAdd a couple of statistics counters for LRU
phk [Mon, 24 Sep 2007 08:01:07 +0000 (08:01 +0000)]
Add a couple of statistics counters for LRU

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

17 years agoFix a NULL pointer dereference which cannot currently happen.
phk [Mon, 24 Sep 2007 07:37:40 +0000 (07:37 +0000)]
Fix a NULL pointer dereference which cannot currently happen.

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

17 years agoReverse the logic in r1997 from !is_get to is_head.
des [Sun, 23 Sep 2007 14:19:42 +0000 (14:19 +0000)]
Reverse the logic in r1997 from !is_get to is_head.

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

17 years agoFix another cornercase that fell out as part of the pass->fetch rewrite:
phk [Sun, 23 Sep 2007 13:46:43 +0000 (13:46 +0000)]
Fix another cornercase that fell out as part of the pass->fetch rewrite:

If we pass a HEAD request, we should not rewrite it to GET and not expect
a body either.

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

17 years agoUnbreak header ordering.
des [Sun, 23 Sep 2007 13:18:50 +0000 (13:18 +0000)]
Unbreak header ordering.

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

17 years agoWhen a workerthread dies of old age, make sure to nuke the mutex it may
phk [Sun, 23 Sep 2007 13:11:51 +0000 (13:11 +0000)]
When a workerthread dies of old age, make sure to nuke the mutex it may
have in its cached nobjhead.

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

17 years agoPart of this commit sneaked into the previous #1985:
phk [Sun, 23 Sep 2007 13:09:56 +0000 (13:09 +0000)]
Part of this commit sneaked into the previous #1985:

Close a supposedly rare memory leak: when we loose the race to create
an objhead, we need to free the hash-string we created before our
second attempt.

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

17 years agoPartially revert previous optimization: it wasn't.
phk [Sun, 23 Sep 2007 13:04:20 +0000 (13:04 +0000)]
Partially revert previous optimization: it wasn't.

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

17 years agoPolish, including use of CHECK_OBJ_ORNULL()
phk [Sun, 23 Sep 2007 12:46:52 +0000 (12:46 +0000)]
Polish, including use of CHECK_OBJ_ORNULL()

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

17 years agoUse CHECK_OBJ_ORNULL() macro
phk [Sun, 23 Sep 2007 12:46:19 +0000 (12:46 +0000)]
Use CHECK_OBJ_ORNULL() macro

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

17 years agoAdd CHECK_OBJ_ORNULL() macro
phk [Sun, 23 Sep 2007 12:44:12 +0000 (12:44 +0000)]
Add CHECK_OBJ_ORNULL() macro

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

17 years agoPolish while reading review.
phk [Sun, 23 Sep 2007 12:39:27 +0000 (12:39 +0000)]
Polish while reading review.

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

17 years agoAdd an experimental runtime parameter for the lru_timeout.
phk [Fri, 21 Sep 2007 13:18:10 +0000 (13:18 +0000)]
Add an experimental runtime parameter for the lru_timeout.

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

17 years agoA temporary work-around for #161
phk [Fri, 21 Sep 2007 10:38:01 +0000 (10:38 +0000)]
A temporary work-around for #161

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

17 years agoDon't leak 50 bytes when creating the new Date: header.
phk [Fri, 21 Sep 2007 09:49:44 +0000 (09:49 +0000)]
Don't leak 50 bytes when creating the new Date: header.

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

17 years agoDon't copy the Date: header from the object to the reply
phk [Fri, 21 Sep 2007 09:49:05 +0000 (09:49 +0000)]
Don't copy the Date: header from the object to the reply

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