Re: fetch in squid

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Wed, 17 Oct 2001 10:39:42 +0200

fatemeh bishomar wrote:
>
> Henrik Nordstrom wrote:
>
> > 1. See http.c. When data arrives it is stuffed into the MemObject
> > (attached to the StoreEntry) from where the store client then reads
> > the
> > data.
> >
> > 2. When a store client (see store_client.c) knows it needs to fetch
> > data
> > from the store it does so using the "Store Interface" API to a store
> > implementation.
>
> I can't understand the second part.what is API? and in which function it
> fetch data from cache?

The store client uses what is described in
http://www.squid-cache.org/Doc/Prog-Guide/prog-guide-9.html to fetch the
data, specifically storeOpen(), storeRead() and storeClose().

See also http://www.squid-cache.org/Doc/Prog-Guide/prog-guide-4.html

There is no description of how to make/use/access a store client. This
is best understood by following the code in client_side.c (refrain
yourself to read client_side.c, don't follow the calls to other parts
but jump directly to the callback until you have a picture of how
client_side.c works)

To find an object in the cache, the storeGetPublic family of functions
is used. Mainly storeGetPublicByRequest. Then a store client is
regitered on the returned StoreEntry, and data is fetched from there.

Regards
Henrik Nordström
Squid Hacker
Received on Wed Oct 17 2001 - 02:40:30 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:33 MST