clientHttpConnectionsOpen sets up the listening socket (including call to comm_listen which is little more than a wrapper around listen), and finally registers httpAccept as read handler for the listening filedescriptor by calling commSetSelect.
When comm_poll detects that the filedescriptor is ready for reading it calls the read handler (httpAccept), which accepts the new client connection and then reinstalls itself as a read handler on the listening file descriptor by calling commSetSelect. httpAccept also registers the clientReadRequest as read handler on the new client connection by calling commSetSelect in the new filedescriptor and a bunch of other activities related to accepting a new client connection. comm_poll is called from the main loop, and reacts to network activity on any of the currently open connections from clients or to origin servers or peers. The main loop also calls event_run which maintains timed events triggered by the clock. When you run "squid -k reconfigure" the main loop momentarily stops and rereads the configuration and then continues calling comm_poll and timed events as usual. On "squid -k rotate" the main loop momentarily stops and rotates the log files. A timed event is then for writing out a clean swap index file is registered with a very short time interval and the main loop continues with it's usual bussiness (comm_poll etc..). The timed event then writes a piece of the swap index each time called until complete. Regards Henrik On Wednesday 12 March 2003 06.19, puji widi wrote: > Let me make an assumption > My assumption is : > 1. When a client send request to a squid proxy server, the > comm_listen receive the clients request > 2. commSetSelect select wheter the request is write or read > 3. the httpAccept accept the request > > but these steps are used when the squid is reconfigured or > initialize. How about the main Rotate ? > > please give me a correction > > regards > puji w > > On 11 Mar 2003, Henrik Nordstrom wrote: > > ons 2003-03-12 klockan 03.36 skrev puji widi: > > > On Tue, 11 Mar 2003, Marc Elsen wrote: > > > can somebody tell me which program use this function ? > > > > Certainly. Squid is using this function, it is a internal > > function within Squid. > > > > The function is registered to the networking functions of Squid > > by clientHttpConnectionsOpen, and called each time the listening > > filedescriptor signals that there is connections waiting to get > > accepted. > > > > > > > > Regards > > Henrik
