From: wessels <> Date: Thu, 20 May 1999 02:30:41 +0000 (+0000) Subject: update X-Git-Tag: SQUID_3_0_PRE1~2200 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc9a3954a946e5d57babce527b4fe352077a8564;p=thirdparty%2Fsquid.git update --- diff --git a/doc/Programming-Guide/prog-guide.sgml b/doc/Programming-Guide/prog-guide.sgml index bd14b39b64..705c5710cf 100644 --- a/doc/Programming-Guide/prog-guide.sgml +++ b/doc/Programming-Guide/prog-guide.sgml @@ -1,6 +1,6 @@
-Squid v1.2 Programmers Guide +Squid Programmers Guide Duane Wessels, Squid Developers @@ -59,15 +59,12 @@ Function names and file names will be written in a courier font, such as The Big Picture +Source Code Overview

Squid consists of the following major components -Client Side - -

-Client Side

Here new client connections are accepted, parsed, and processed. @@ -77,17 +74,7 @@ Squid consists of the following major components is held in a data structure called Server Side - -

-Server Side

These routines are responsible for forwarding cache misses @@ -100,29 +87,7 @@ Squid consists of the following major components receive much attention because they comprise a relatively insignificant portion of Internet traffic. -

- Storage Manager - -

-Storage Manager

The Storage Manager is the glue between client and server sides. @@ -156,22 +121,16 @@ Squid consists of the following major components PUT request, this process works in reverse. Server-side functions are notified when additional data is read from the client. -Peer Selection +Request Forwarding -

-Peer Selection

These functions are responsible for selecting one (or none) of the neighbor caches as the appropriate forwarding location. -Access Control - -

-Access Control

These functions are responsible for allowing @@ -184,11 +143,7 @@ Squid consists of the following major components continues the access control checks when the information is available. -Network Communication - -

-Network Communication

These are the routines for communicating over @@ -200,11 +155,7 @@ Squid consists of the following major components blocks of data for writing. Consequently, a callback occurs for every write request. -File/Disk I/O - -

-File/Disk I/O

Routines for reading and writing disk files (and FIFOs). @@ -217,22 +168,14 @@ Squid consists of the following major components a single write request. The write callback does not necessarily occur for every write request. -Neighbors - -

-Neighbors

Maintains the list of neighbor caches. Sends and receives ICP messages to neighbors. Decides which neighbors to query for a given request. File: IP/FQDN Cache - -

-IP/FQDN Cache

A cache of name-to-address and address-to-name lookups. These are @@ -241,11 +184,7 @@ Squid consists of the following major components implement the non-blocking lookups. Files: Cache Manager - -

-Cache Manager

This provides access to certain information needed by the @@ -260,11 +199,7 @@ Squid consists of the following major components to information. It does not provide a method for configuring Squid while it is running. -Network Measurement Database - -

-Network Measurement Database

In a number of situation, Squid finds it useful to know the @@ -283,11 +218,7 @@ Squid consists of the following major components aggregation is used to reduce the overall database size. File: Redirectors - -

-Redirectors

Squid has the ability to rewrite requests from clients. After @@ -298,11 +229,7 @@ Squid consists of the following major components Common applications for this feature are extended access controls and local mirroring. File: Autonomous System Numbers - -

-Autonomous System Numbers

Squid supports Autonomous System (AS) numbers as another @@ -310,26 +237,8 @@ Squid consists of the following major components query databases which map AS numbers into lists of CIDR prefixes. These results are stored in a radix tree which allows fast searching of the AS number for a given IP address. - -Asynchronous I/O Operations - -

- - These routines in Configuration File Parsing - -

-Configuration File Parsing

The primary configuration file specification is in the file @@ -338,11 +247,7 @@ Squid consists of the following major components and Callback Data Database - -

-Callback Data Database

Squid's extensive use of callback functions makes it very @@ -352,11 +257,7 @@ Squid consists of the following major components provide a uniform method for managing callback data memory, canceling callbacks, and preventing erroneous memory accesses. -Debugging - -

-Debugging

Squid includes extensive debugging statements to assist in @@ -373,22 +274,14 @@ Squid consists of the following major components probably sounds more complicated than it really is. File: Error Generation - -

-Error Generation

The routines in Event Queue - -

-Event Queue

The routines in Filedescriptor Management -

-Filedescriptor Management

Here we track the number of filedescriptors in use, and the @@ -408,20 +298,14 @@ Squid consists of the following major components file descriptor. -Hashtable Support -

-Hashtable Support

These routines implement generic hash tables. A hash table is created with a function for hashing the key values, and a function for comparing the key values. -HTTP Anonymization -

-HTTP Anonymization

These routines support anonymizing of HTTP requests leaving @@ -430,11 +314,7 @@ Squid consists of the following major components will be allowed (the ``paranoid'' mode). -Internet Cache Protocol -

-Internet Cache Protocol

Here we implement the Internet Cache Protocol. This @@ -445,10 +325,7 @@ Squid consists of the following major components a different version number and a slightly different message format. -Ident Lookups -

-Ident Lookups

These routines support RFC 931 ``Ident'' lookups. An ident @@ -456,10 +333,7 @@ Squid consists of the following major components with a connected TCP socket. Some sites use this facility for access control and logging purposes. -Memory Management -

-Memory Management

These routines allocate and manage pools of memory for @@ -469,10 +343,7 @@ Squid consists of the following major components in more efficient use of memory at the expense of a larger process size. -Multicast Support -

-Multicast Support

Currently, multicast is only used for ICP queries. The @@ -480,10 +351,7 @@ Squid consists of the following major components socket to a multicast group (or groups), and setting the multicast TTL value on outgoing packets. -Persistent Server Connections -

-Persistent Server Connections

These routines manage idle, persistent HTTP connections @@ -494,11 +362,7 @@ Squid consists of the following major components 15 seconds. After 15 seconds, idle socket connections are closed. -Refresh Rules - -

-Refresh Rules

These routines decide wether a cached object is stale or fresh, @@ -507,23 +371,14 @@ Squid consists of the following major components If it is stale, then it must be revalidated with an If-Modified-Since request. -SNMP Support -

-SNMP Support

These routines implement SNMP for Squid. At the present time, we have made almost all of the cachemgr information available via SNMP. -URN Support -

-URN Support

We are experimenting with URN support in Squid version 1.2. Note, @@ -534,12 +389,9 @@ mirror sites. For more details, please see name="URN support in Squid">. -External Programs +External Programs -dnsserver -

-dnsserver

Because the standard pinger -

-pinger

Although it would be possible for Squid to send and receive @@ -569,10 +418,7 @@ mirror sites. For more details, please see program installed with setuid permissions. -unlinkd -

-unlinkd

The redirector - -

-redirector

A redirector process reads URLs on stdin and writes (possibly changed) URLs on stdout. It is implemented as an external process to maximize flexibility. -Sequence of a Typical Request +Flow of a Typical Request

@@ -664,7 +506,8 @@ another request from the client, or closes the client connection. - +Callback Functions + The Main Loop: @@ -1019,61 +862,72 @@ according to the

- Prior to use, an - Once initialized, the - Note that there are no methods for "creating" or "destroying" a - "dynamic" Header Manipulation.

- The mostly common operations on HTTP headers are testing for a particular - header-field ( - - - Special care must be taken when several header-fields with the same id are - preset in the header. If HTTP protocol allows only one copy of the specified - field per header (e.g. "Content-Length"), - It is prohibited to ask for a List of values when only one value is permitted, - and visa-versa. This restriction prevents a programmer from processing one - value of an header-field while ignoring other valid values. + It is prohibited to ask for a List of values when only one + value is permitted, and visa-versa. This restriction prevents + a programmer from processing one value of an header-field + while ignoring other valid values.

- - The value being put using one of the Example: @@ -1086,20 +940,20 @@ according to the

- There are two ways to delete a field from a header. To delete a "known" field - (a field with "id" other than - - The /* delete all fields with a given name */ @@ -1111,79 +965,89 @@ according to the - Note that I/O and Headers.

- To store a header in a file or socket, pack it using Adding new header-field ids.

- Adding new ids is simple. First add new HDR_ entry to the http_hdr_type - enumeration in enums.h. Then describe a new header-field attributes in - the HeadersAttrs array located in Finally, add new id to one of the following arrays: - Also, if the new field is a "list" header, add it to the - - In most cases, if you forget to include a new field id in one of the required - arrays, you will get a run-time assertion. For rarely used fields, however, it - may take a long time for an assertion to be triggered. + In most cases, if you forget to include a new field id in + one of the required arrays, you will get a run-time assertion. + For rarely used fields, however, it may take a long time + for an assertion to be triggered.

- There is virtually no limit on the number of fields supported by Squid. If - current mask sizes cannot fit all the ids (you will get an assertion if that - happens), simply enlarge HttpHeaderMask type in A Word on Efficiency.

- - Adding new fields is somewhat expensive if they require complex conversions to - a string. + Adding new fields is somewhat expensive if they require + complex conversions to a string.

- Deleting existing fields requires scan of all the entries and comparing their - "id"s (faster) or "names" (slower) with the one specified for deletion. + Deleting existing fields requires scan of all the entries + and comparing their "id"s (faster) or "names" (slower) with + the one specified for deletion.

- Most of the operations are faster than their "ascii string" equivalents. + Most of the operations are faster than their "ascii string" + equivalents.