Re: Puzzled at "clientHTTPRequest"

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Tue, 9 Apr 2002 17:12:07 +0200

maer727@sohu.com wrote:
> Hi, pals.
>
> I meet a trouble when reading client_side.c, function
> "clientCreateStoreEntry". In this function, exists a variable named h. It
> is an variable of structure "clientCreateStoreEntry".

h is a clientHttpRequest. It contains the details of the client connection
and the HTTP request received on this connection.

> I think the structure "StoreEntry" is to do with cached object.
> "Storeclient" is to do with client. But I do not know the purpose of the
> structure "clientHTTPRequest". What is the relationship between the three
> structures?

The client connection gets accepted and assigned a ConnStateData.

Client sends a request. The request gets parsed into a request_t, and the
information about the request and client is collected into a
clientHttpRequest, linked to the ConnStateData.

At a given time only one clientHttpRequest is active for a ConnStateData. If
there is more than one request sent by the client then the others just sit
there waiting for their turn (deferred).

A StoreEntry is the central structure describing an URL object within Squid.

Data is read from a StoreEntry using a store_client.

When client_side.c processes the current clientHttpRequest for a
ConnStateData it uses a store_client to read data from the StoreEntry.

when client_side starts processing a clientHttpRequest, it checks if there
exists a StoreEntry for the requested object in the cace. If not it creates a
new StoreEntry and initiates the retreival of a copy from the Internet into
this StoreEntry. The retreival "process" is sent the request_t.

Regards
Henrik
Received on Tue Apr 09 2002 - 09:12:14 MDT

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