]> err.no Git - varnish/log
varnish
18 years agoSanitycheck that the length of an object adds up, right when we
phk [Thu, 3 Aug 2006 19:20:02 +0000 (19:20 +0000)]
Sanitycheck that the length of an object adds up, right when we
fetch it.

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

18 years agoImlement stopping and restarting of child process.
phk [Thu, 3 Aug 2006 11:46:52 +0000 (11:46 +0000)]
Imlement stopping and restarting of child process.

Not as useful as it will be yet, see ticket 22

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

18 years agoMake the pipe-stunt debug process smarter.
phk [Thu, 3 Aug 2006 11:45:23 +0000 (11:45 +0000)]
Make the pipe-stunt debug process smarter.

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

18 years agoTake varnishtester out of the loop until it can be de-libevented
phk [Thu, 3 Aug 2006 10:37:22 +0000 (10:37 +0000)]
Take varnishtester out of the loop until it can be de-libevented

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

18 years agoAdd stop command as well.
phk [Thu, 3 Aug 2006 10:37:01 +0000 (10:37 +0000)]
Add stop command as well.

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

18 years agoThink I have found a program structure that works. Filling in bits to build logline.
andersb [Thu, 3 Aug 2006 10:16:20 +0000 (10:16 +0000)]
Think I have found a program structure that works. Filling in bits to build logline.

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

18 years agoRemove libevent from the picture.
phk [Thu, 3 Aug 2006 09:45:36 +0000 (09:45 +0000)]
Remove libevent from the picture.

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

18 years agoRip out the old CLI handling and start over, more or less.
phk [Thu, 3 Aug 2006 09:45:14 +0000 (09:45 +0000)]
Rip out the old CLI handling and start over, more or less.

Still bits missing.

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

18 years agoRework the cache process CLI handling:
phk [Thu, 3 Aug 2006 06:45:58 +0000 (06:45 +0000)]
Rework the cache process CLI handling:

We are only accepting CLI from the pipes in heritage, so simply
run a loop reading those, dispatching lines as we see them.

Export CLI_cmds[] so that the management process can see it,
we might as well take advantage of the shared binary where we can.

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

18 years agoAdded SessionReuse so I now write a logline for SessionClose and SessionReuse.
andersb [Wed, 2 Aug 2006 22:53:56 +0000 (22:53 +0000)]
Added SessionReuse so I now write a logline for SessionClose and SessionReuse.

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

18 years agoStarting to get the structure right (I think). Thx for the NULL on each string Poul...
andersb [Wed, 2 Aug 2006 22:33:31 +0000 (22:33 +0000)]
Starting to get the structure right (I think). Thx for the NULL on each string Poul-Hennning :)

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

18 years agoAdd an assert, just in case.
phk [Wed, 2 Aug 2006 20:59:46 +0000 (20:59 +0000)]
Add an assert, just in case.

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

18 years agoFix a bug when deleting items in the binheap
phk [Wed, 2 Aug 2006 20:54:40 +0000 (20:54 +0000)]
Fix a bug when deleting items in the binheap

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

18 years agolog StatAddr with fd=0 to avoid out-of-order confusion
phk [Wed, 2 Aug 2006 19:12:01 +0000 (19:12 +0000)]
log StatAddr with fd=0 to avoid out-of-order confusion

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

18 years agoAllow ENOENT on removing kqueue events, a close will have drained
phk [Wed, 2 Aug 2006 18:17:49 +0000 (18:17 +0000)]
Allow ENOENT on removing kqueue events, a close will have drained
them already.

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

18 years agoTell daemon(3) to not chdir in debugging mode so we can find our core dumps.
phk [Wed, 2 Aug 2006 18:12:42 +0000 (18:12 +0000)]
Tell daemon(3) to not chdir in debugging mode so we can find our core dumps.

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

18 years agoEnter pass mode through the front door.
phk [Wed, 2 Aug 2006 17:45:02 +0000 (17:45 +0000)]
Enter pass mode through the front door.

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

18 years agoMore asserts, sp->vbc this time.
phk [Wed, 2 Aug 2006 17:27:33 +0000 (17:27 +0000)]
More asserts, sp->vbc this time.

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

18 years agoRemember to clear sp->vbc
phk [Wed, 2 Aug 2006 15:55:06 +0000 (15:55 +0000)]
Remember to clear sp->vbc

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

18 years agoDon my plumbers outfit and twist a lot of pipes into shape:
phk [Wed, 2 Aug 2006 13:28:14 +0000 (13:28 +0000)]
Don my plumbers outfit and twist a lot of pipes into shape:

When -d(ebug) is specified we fork before calling daemon.

The parent process becomes a miniature cat(1) program which connects
stdin/stdout with the management process stdin/stdout.

It also knows that SIGINT should be passed on to the management process
in order to make it DTRT.

Any other cause of death for this "debugger" process will (once I
teach the CLI about it) not affect the running varnish and therefore
it will be possible to start varnish in debugging mode, tweak things
a bit and CTRL-D and leave it running in the properly daemon(3)'ed
background.

The reason for this rather complicated bit of pipework is that we
can not call daemon(3) once we have started any threads (only the
calling thread survives) and we would loose our parent relationship
to the cache process also.

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

18 years agoTypo: Also monitor remote sockets with the poll based acceptor.
phk [Wed, 2 Aug 2006 12:05:19 +0000 (12:05 +0000)]
Typo: Also monitor remote sockets with the poll based acceptor.

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

18 years agoRemove the libevent from the backend pool manager.
phk [Wed, 2 Aug 2006 11:58:54 +0000 (11:58 +0000)]
Remove the libevent from the backend pool manager.

Simplify the logic here while we're at it.

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

18 years agoAdd <stdarg.h> include
phk [Wed, 2 Aug 2006 11:18:11 +0000 (11:18 +0000)]
Add <stdarg.h> include

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

18 years agoRemove unused struct.
phk [Wed, 2 Aug 2006 11:17:53 +0000 (11:17 +0000)]
Remove unused struct.

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

18 years agoSimplify backend connection memory management.
phk [Wed, 2 Aug 2006 10:53:49 +0000 (10:53 +0000)]
Simplify backend connection memory management.

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

18 years agoReplace libevent based acceptor with poll(2) based acceptor.
phk [Wed, 2 Aug 2006 10:40:22 +0000 (10:40 +0000)]
Replace libevent based acceptor with poll(2) based acceptor.

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

18 years agoBite the bullet and write an alternate acceptor which uses kqueue
phk [Wed, 2 Aug 2006 09:34:40 +0000 (09:34 +0000)]
Bite the bullet and write an alternate acceptor which uses kqueue
directly instead of libevent.

Degeneralize the header reading code in cache_http.c which seems to
be cleaner anyway.

An #ifdef at the top of cache_acceptor.c selects which implementation
you want: libevent or kqueue.

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

18 years agoConvert pipe to use poll(2) on the two filedescriptors it cares about
phk [Wed, 2 Aug 2006 07:23:45 +0000 (07:23 +0000)]
Convert pipe to use poll(2) on the two filedescriptors it cares about
and eliminate the per-workerthread event engine entirely.

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

18 years agoI have nothing but circumstantial evidence that libevent is involved
phk [Wed, 2 Aug 2006 07:07:56 +0000 (07:07 +0000)]
I have nothing but circumstantial evidence that libevent is involved
in the current stack corruption I see, but we might as well avoid
using it where we can:

Don't engage the eventengine when we talk to the backend, just call
read(2) directly.

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

18 years agoMore miniobj paranoia
phk [Wed, 2 Aug 2006 04:57:58 +0000 (04:57 +0000)]
More miniobj paranoia

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

18 years agoMore miniobj checks
phk [Tue, 1 Aug 2006 19:48:36 +0000 (19:48 +0000)]
More miniobj checks

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

18 years agoMore miniobj checks
phk [Tue, 1 Aug 2006 17:54:34 +0000 (17:54 +0000)]
More miniobj checks

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

18 years agoMore miniobj checks
phk [Tue, 1 Aug 2006 16:42:37 +0000 (16:42 +0000)]
More miniobj checks

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

18 years agomore miniobj checks
phk [Tue, 1 Aug 2006 16:26:10 +0000 (16:26 +0000)]
more miniobj checks

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

18 years agoFlinting.
phk [Tue, 1 Aug 2006 15:09:20 +0000 (15:09 +0000)]
Flinting.

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

18 years agoMake 32bit limitation work better.
phk [Tue, 1 Aug 2006 15:08:54 +0000 (15:08 +0000)]
Make 32bit limitation work better.

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

18 years agoFixx off by one error.
phk [Tue, 1 Aug 2006 15:08:36 +0000 (15:08 +0000)]
Fixx off by one error.

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

18 years agoAdd miniobj checks om SMF and STORAGE
phk [Tue, 1 Aug 2006 14:53:29 +0000 (14:53 +0000)]
Add miniobj checks om SMF and STORAGE

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

18 years agoThis is getting too longhaired: Give backend connections another
phk [Tue, 1 Aug 2006 12:38:26 +0000 (12:38 +0000)]
This is getting too longhaired:  Give backend connections another
http header which we can use to build the object headers in.

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

18 years agoExperiment: don't use req's workspace to build object http header.
phk [Tue, 1 Aug 2006 12:04:56 +0000 (12:04 +0000)]
Experiment:  don't use req's workspace to build object http header.

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

18 years agoRecord timestamp when we have received completed HTTP request header,
phk [Tue, 1 Aug 2006 09:39:52 +0000 (09:39 +0000)]
Record timestamp when we have received completed HTTP request header,
and define this as the "start of request timestamp".

Define "end of request timestamp" as when we are ready to transmit
HTTP header back.

SHMlog the start and difference between start and stop with ReqServTime
tag.

Keep track of idle sessions using CLOCK_MONOTONIC to avoid trouble
here should our clock get stepped.

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

18 years agoAdded some more toying with the data. All is still a mess, and I am not sure of struc...
andersb [Mon, 31 Jul 2006 22:21:02 +0000 (22:21 +0000)]
Added some more toying with the data. All is still a mess, and I am not sure of structure yet. PHK is also doing changes in areas that will be needed.

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

18 years agoAlways NUL terminate shmlog entries.
phk [Mon, 31 Jul 2006 22:09:42 +0000 (22:09 +0000)]
Always NUL terminate shmlog entries.

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

18 years agoCreate three groups of seven SHMlog tags:
phk [Mon, 31 Jul 2006 21:49:29 +0000 (21:49 +0000)]
Create three groups of seven SHMlog tags:

{Rx,Tx,Obj}{Request,Response,Status,URL,Protocol,Header,LostHeader}

And log http header munching accordingly.

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

18 years agoRemove unused variable
phk [Mon, 31 Jul 2006 21:46:32 +0000 (21:46 +0000)]
Remove unused variable

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

18 years agoaddr might be NULL if we are called from the prefetcher.
phk [Mon, 31 Jul 2006 21:37:10 +0000 (21:37 +0000)]
addr might be NULL if we are called from the prefetcher.

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

18 years agoAdd http_ClrHeader() and cure an unintended bug-oid its use exposes:
phk [Mon, 31 Jul 2006 21:04:43 +0000 (21:04 +0000)]
Add http_ClrHeader() and cure an unintended bug-oid its use exposes:
we checked if the request is a GET long after we should have.

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

18 years agoAdd a http_SetResp() function for constructing HTTP responses (like 304).
phk [Mon, 31 Jul 2006 20:38:46 +0000 (20:38 +0000)]
Add a http_SetResp() function for constructing HTTP responses (like 304).

Eliminate the header index from http_SetHeader() which is no unused.

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

18 years agoLog the headers we store in the object under ObjHeader so that
phk [Mon, 31 Jul 2006 20:27:02 +0000 (20:27 +0000)]
Log the headers we store in the object under ObjHeader so that
we don't get two confusing batches of TxHeader in the sessions logentries.

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

18 years agoFix the dot-graph
phk [Mon, 31 Jul 2006 19:18:26 +0000 (19:18 +0000)]
Fix the dot-graph

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

18 years agoInitial commit of real structure. This code will print the User-Agent.
andersb [Mon, 31 Jul 2006 14:50:36 +0000 (14:50 +0000)]
Initial commit of real structure. This code will print the User-Agent.

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

18 years agoIntroduce http_SetHeader() for setting a http header to a const string,
phk [Mon, 31 Jul 2006 07:26:25 +0000 (07:26 +0000)]
Introduce http_SetHeader() for setting a http header to a const string,
no need to waste time printf'ing in this case, and no need to waste workspace.

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

18 years agoDon't fill more than half the workspace with received data, we need to
phk [Mon, 31 Jul 2006 07:13:45 +0000 (07:13 +0000)]
Don't fill more than half the workspace with received data, we need to
have space for composing the reply as well.

Without this fix, the entire workspace could be filled with pipelined
requests and we would have no space to compose the reply.

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

18 years agoClone varnishncsa off of varnishlog. Anders will hack on it to produce
des [Mon, 31 Jul 2006 06:36:56 +0000 (06:36 +0000)]
Clone varnishncsa off of varnishlog.  Anders will hack on it to produce
NCSA-style (common / combined) logs.

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

18 years agoUnbreak build.
des [Mon, 31 Jul 2006 06:24:51 +0000 (06:24 +0000)]
Unbreak build.

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

18 years ago"HEAD" has 4 characters.
phk [Fri, 28 Jul 2006 13:41:20 +0000 (13:41 +0000)]
"HEAD" has 4 characters.

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

18 years agoremove this file (again)
phk [Mon, 24 Jul 2006 10:13:29 +0000 (10:13 +0000)]
remove this file (again)

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

18 years agoreorg a little bit.
phk [Sat, 22 Jul 2006 22:01:04 +0000 (22:01 +0000)]
reorg a little bit.

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

18 years agoEliminate redundant args from stevedore->send()
phk [Sat, 22 Jul 2006 21:20:08 +0000 (21:20 +0000)]
Eliminate redundant args from stevedore->send()

Have WRK_Write() and friends return number of bytes (we can't use
WRK_Flush() as that may act on both header and body).

Collect more stats.

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

18 years agoAdd per address, per session and total statistics.
phk [Sat, 22 Jul 2006 20:57:02 +0000 (20:57 +0000)]
Add per address, per session and total statistics.

We (will) collect data in unlocked per workerthread accumulators
and whenever the workerthread leaves the session, we charge the
bill to the srcaddr (issuing a StatAddr shmrecord), to the session
and to the global counters in the stats struct.

When sessions die we issue a StatSess shmrecord.

StatAddr and StatSess has the same format:
address
port (always zero for StatAddr)
duration (seconds)
#sessions
#requests
#pipe
#pass
#fetch
#hdrbytes
#bodybytes

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

18 years agoMake sure there always is a Host: header in fetch requests.
phk [Sat, 22 Jul 2006 16:55:17 +0000 (16:55 +0000)]
Make sure there always is a Host: header in fetch requests.

We fill it in with backend.hostname, but this may not be optimal
(direct IP# etc etc) so VCL should be able to override it.

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

18 years agoAction pass from vcl_hit() needs to go to STP_PASS
phk [Sat, 22 Jul 2006 16:26:45 +0000 (16:26 +0000)]
Action pass from vcl_hit() needs to go to STP_PASS

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

18 years agoAlways use GET and HTTP/1.1 against the backend for fetch
phk [Sat, 22 Jul 2006 16:15:17 +0000 (16:15 +0000)]
Always use GET and HTTP/1.1 against the backend for fetch

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

18 years agoexit after error
phk [Sat, 22 Jul 2006 13:58:31 +0000 (13:58 +0000)]
exit after error

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

18 years agoImplement regexp matching of strings in VCL.
phk [Sat, 22 Jul 2006 12:00:18 +0000 (12:00 +0000)]
Implement regexp matching of strings in VCL.

For now we default to REG_EXTENDED, but it might make sense
to let the user control this flag and the case sensitivity.

Another concern is the stringification of regexps, it may lead
to backslash madness.  Maybe we should define '...' string types
also and do no backslash substitution in those at all.

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

18 years agoChange the acl syntax slightly: the ( ... ) should enclose all of
phk [Sat, 22 Jul 2006 10:41:00 +0000 (10:41 +0000)]
Change the acl syntax slightly:  the ( ... ) should enclose all of
the rule (ie: also !  and /mask if present).

Implement matching for IPv4.

Acl tests are shmlogged as follows (doc candidate):

shmlog tag: VCL_actl

"NO_MATCH $acl"
client did not match access list $acl
"FAIL $acl $rule"
getaddrinfo(3) failed on $rule which had a '!'
"MATCH $acl $rule"
client matched $rule
"NEG_MATCH $acl $rule"
client matched negated (!) $rule

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

18 years agoStore the socket address in the session
phk [Sat, 22 Jul 2006 10:35:39 +0000 (10:35 +0000)]
Store the socket address in the session

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

18 years agoVCL compiler:
phk [Sat, 22 Jul 2006 09:38:09 +0000 (09:38 +0000)]
VCL compiler:
add two sbufs for "init" and "fini" actions.

VCL ACLs:  Change syntax and implementation as follows.

ACL Syntax now works the following way:

acl $name {
! ( "myhost.com" ) ;
"10.0.0.1" /8 ;
}

The '!' means not.  If the address matches the rest of the rule
the address does NOT match the acl and the search terminates here.

Enclosing the string in paranthesis means that the rule will be ignored
if the string cannot be converted to an address (with getaddrinfo).

When a string can not be looked up, and is not enclosed in a
paranthesis, a positive rule (ie: without !) will not match and a
negative rule (with !) will match.

A mask can always be supplied, no matter the style of the string
given, so it is possible to do things like:

{ "fw.ourcompany.dom" / 24 }

Which means "any host on the same /24 subnet as fw.ourcompany.dom".

Unfortunately getaddrinfo() does not return a TTL for the results,
in the future we may want to use some kind of timeout to refresh
the lookups.

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

18 years agoSplit IP/ACL compilation into vcc_acl.c
phk [Sat, 22 Jul 2006 08:02:47 +0000 (08:02 +0000)]
Split IP/ACL compilation into vcc_acl.c

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

18 years agoUnless the user specifies an explicit size, don't use more than 2GB
phk [Fri, 21 Jul 2006 22:12:38 +0000 (22:12 +0000)]
Unless the user specifies an explicit size, don't use more than 2GB
on 32 bit architectures to avoid running out of address room

Make FlexeLint happy.

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

18 years agoMake FlexeLint happier
phk [Fri, 21 Jul 2006 21:57:43 +0000 (21:57 +0000)]
Make FlexeLint happier

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

18 years agoDrop this one now.
phk [Fri, 21 Jul 2006 21:42:00 +0000 (21:42 +0000)]
Drop this one now.

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

18 years agoImplement TTL adjustment from VCL
phk [Fri, 21 Jul 2006 21:28:51 +0000 (21:28 +0000)]
Implement TTL adjustment from VCL

Log in shmem where the TTL came from (doc-candidate):

696613561 RFC 900 1153517009 1153517014 1153517914 900 0
        |         |   |   |          |          |          |   |
        |         |   |   |          |          |          |   age
        |         |   |   |          |          |          max-age
        |         |   |   |          |          Expires: header
        |         |   |   |          Date: header
        |         |   |   "now"
        |         |   TTL relative to "now"
        |         who set the TTL
        xid of object

or

696613561 VCL 20 1153517009
|         |   |  |
|         |   |  "now"
|         |   TTL relative to "now"
|         who set the TTL
        xid of object

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

18 years agoMore VRT work.
phk [Fri, 21 Jul 2006 21:13:43 +0000 (21:13 +0000)]
More VRT work.

Use macros for trivial objects which are just a field in a struct.

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

18 years agoUpdate VRT to minimal functional level again
phk [Fri, 21 Jul 2006 21:01:45 +0000 (21:01 +0000)]
Update VRT to minimal functional level again

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

18 years agoUse const char* for safety
phk [Fri, 21 Jul 2006 20:51:24 +0000 (20:51 +0000)]
Use const char* for safety

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

18 years agoUpdate
phk [Fri, 21 Jul 2006 20:45:13 +0000 (20:45 +0000)]
Update

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

18 years agoThis file is generated.
phk [Fri, 21 Jul 2006 20:44:58 +0000 (20:44 +0000)]
This file is generated.

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

18 years agoAutomate generation of tables and prototypes for the objects which
phk [Fri, 21 Jul 2006 20:43:56 +0000 (20:43 +0000)]
Automate generation of tables and prototypes for the objects which
VCL programs can manipulate.

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

18 years agoMove things over to the correct "VCC" prefix.
phk [Fri, 21 Jul 2006 18:12:56 +0000 (18:12 +0000)]
Move things over to the correct "VCC" prefix.

Split some stuff into separate files while we're at it.

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

18 years agoupdate comment
phk [Fri, 21 Jul 2006 16:25:24 +0000 (16:25 +0000)]
update comment

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

18 years agoProperly log TTL calculation to shmem
phk [Fri, 21 Jul 2006 16:15:58 +0000 (16:15 +0000)]
Properly log TTL calculation to shmem

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

18 years agoFix formatting of responses.
phk [Fri, 21 Jul 2006 16:06:07 +0000 (16:06 +0000)]
Fix formatting of responses.

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

18 years agoLog TTL calculation on the right fd
phk [Fri, 21 Jul 2006 16:05:53 +0000 (16:05 +0000)]
Log TTL calculation on the right fd

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

18 years agoWork on logtailer api a bit:
phk [Fri, 21 Jul 2006 15:25:09 +0000 (15:25 +0000)]
Work on logtailer api a bit:

By default, start at the last entry in shared memory.  To dump the
entire segment from the start, specify '-d' option.

Terminate programs when '-r $file' reaches EOF

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

18 years agoCleanup
phk [Fri, 21 Jul 2006 12:18:01 +0000 (12:18 +0000)]
Cleanup

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

18 years agoMagic check on struct vbe
phk [Fri, 21 Jul 2006 12:08:57 +0000 (12:08 +0000)]
Magic check on struct vbe

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

18 years agoBetter name
phk [Fri, 21 Jul 2006 12:06:36 +0000 (12:06 +0000)]
Better name

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

18 years agoConvert fetch, insert and deliver to use new HTTP header munging code.
phk [Fri, 21 Jul 2006 11:55:17 +0000 (11:55 +0000)]
Convert fetch, insert and deliver to use new HTTP header munging code.

Remove sbuf from workerthread, it is only used in the Error handling
now and it will probably not even survive that in the long run.

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

18 years agoMake pipe use the new http manipulation.
phk [Fri, 21 Jul 2006 10:44:12 +0000 (10:44 +0000)]
Make pipe use the new http manipulation.

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

18 years agoHTTP header munging part (N of M)
phk [Fri, 21 Jul 2006 09:32:09 +0000 (09:32 +0000)]
HTTP header munging part (N of M)

NB: Only pass mode (lightly) tested right now.

Give up on the three element array per header and use a two element struct
instead, it reduces obfuscation and removes risk of pointer fandango.

Introduce #defined filtercontrol in http_headers.h, use them in a new
field.  Only Pass is there for now.

Use the http-workspace for building headers instead of sbuf.

Move uiovec handling to cache_pool.c where it more naturally belongs
and so we can use it on both backends and sessions.

Add http header munging functiosn for copying, printf'ing, filtering and
writing headers.

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

18 years agoRename shmlog tags for headers to RxHeader and TxHeader that's more
phk [Fri, 21 Jul 2006 07:18:40 +0000 (07:18 +0000)]
Rename shmlog tags for headers to RxHeader and TxHeader that's more
logical.

Rename http_Init() to http_Setup() to avoid clash with HTTP_Init().

Remove unused variable

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

18 years agoYet another refinement to the way we store and deal with HTTP headers.
phk [Thu, 20 Jul 2006 22:08:43 +0000 (22:08 +0000)]
Yet another refinement to the way we store and deal with HTTP headers.

Record a triplet of {start, data, end} for all HTTP data items.

This represents a regrettable uglification of the sourcecode, but
most of it compiles out to constants and the runtime benefits will
be worth it.

Generate H_FOO magic strings for all the headers we know about.
These strings have a length as first char and always ends in ':'.

Also genereate H_FOO format strings in VCL compiler.

Mandate (with assert) that header references happen using H_FOO strings.

Make number of allowed HTTP headers a compile time constant (32)
but make the workspace a run-time variable (4096).

Introduce new SHM tag for dumping aborted HTTP protocol requests.

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

18 years agoAdd XXX comment
phk [Thu, 20 Jul 2006 15:10:36 +0000 (15:10 +0000)]
Add XXX comment

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

18 years agoKeep an eye on deathrow
phk [Thu, 20 Jul 2006 14:46:49 +0000 (14:46 +0000)]
Keep an eye on deathrow

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

18 years agoMore asserts
phk [Thu, 20 Jul 2006 14:40:54 +0000 (14:40 +0000)]
More asserts

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

18 years agoWe need to check the TTL here also, if a (sequence of) slow client(s)
phk [Thu, 20 Jul 2006 14:23:59 +0000 (14:23 +0000)]
We need to check the TTL here also, if a (sequence of) slow client(s)
manages to hold the document referenced, the prefetcher may never
get lucky with it and it will linger here much past last sell date.

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

18 years agoOnly reference srcaddr on first request on session
phk [Thu, 20 Jul 2006 13:42:56 +0000 (13:42 +0000)]
Only reference srcaddr on first request on session

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

18 years agoBe more paranoid about srcaddr
phk [Thu, 20 Jul 2006 13:39:47 +0000 (13:39 +0000)]
Be more paranoid about srcaddr

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

18 years agoupd
phk [Thu, 20 Jul 2006 13:33:22 +0000 (13:33 +0000)]
upd

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