Inspect Request bodies?

Tim Kientzle tim at metaweb.com
Sat Nov 22 01:13:42 CET 2008


On Nov 5, 2008, at 11:37 AM, Poul-Henning Kamp wrote:

> In message <55911D51-8964-4D13-9667-63CACCD1A9A4 at metaweb.com>, Tim  
> Kientzle wri
> tes:
>
>> * I'll need code to actually read and store the POST body in memory
>>   (including updates to the PASS handler and other places to
>>   use the in-memory data when it's available)
>
> We sort of have this as point 15 on our shoppinglist:
>
> 	(http://varnish.projects.linpro.no/wiki/PostTwoShoppingList)
>
>> The first part looks trickier.  Has anyone here tried anything
>> similar?  Any pointers (particular source files I should pay  
>> attention
>> to or memory-management issues I should keep in mind)?
>
> It's pretty straightforward really:  allocate an (non-hashed)
> object, add storage to it and store the contents there.
>
> You can see pretty much all the code you need in cache_fetch.c and
> for it to go into the tree as a patch, I would insist that the
> code gets generalized so we use the same code in both directions,
> rather than have two copies.

The attached patch is a first step in that direction.  It generalizes
the existing fetch_straight and fetch_chunked so that the same
code is used in both directions.  This is mostly just code
refactoring, although it does add support for chunked upload.

"make check" still succeeds after this change; I haven't tried
to add any new tests for this yet.

My biggest concern is that I might have changed some of the return
values here.  I'm not yet clear on what return conventions varnish
is using internally.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: varnish2.0.1-generalize-fetch.patch
Type: application/octet-stream
Size: 9628 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20081121/ef0b2c69/attachment-0003.obj>
-------------- next part --------------



More information about the varnish-misc mailing list