Re: Memory usage fix (patch)

From: Adrian Chadd <adrian@dont-contact.us>
Date: Thu, 17 Mar 2005 05:26:10 +0000

On Thu, Mar 17, 2005, Steven Wilton wrote:

> Actually.. How is the fwdCheckDefer function meant to slow this down? The
> way I read the code is that it follows this logic:

Each time through the select IO loop, the code will call commDeferRead() for
each FD marked for read /before/ its added to the FD set passed to select()
or poll(). This function pointer, which for http server FDs, points to
fwdCheckDeferRead(). This returns "ok" if:

* there's no mem object
* some delay pools checking (where the return meaning is overloaded (-1) -
  check the code)
* if its waiting for headers
* if the gap between the highest offset read in the response and the lowest
  store client reader is smaller than READ_AHEAD_GAP

Otherwise it will return 1 (defer). If defer is returned then the fd is
NOT added to the fd set passwd to poll()/select().

> httpReadReply
> - check aborted && return
> - read data from socket
> - if length > 0 and we have processed headers
> - storeAppend
> - switch httpPconnTransferDone (check whether the transfer is comlete)
> - if transfer not complete, queue fd for read with callback to
> httpReadReply
>

See, it happens /before/ this! :) The defer handler is set when the FD is created
and stays for the lifetime of the socket.

Adrian

-- 
Adrian Chadd			"To believe with certainty we must first
<adrian@creative.net.au>	    begin by doubting."
			
Received on Wed Mar 16 2005 - 22:26:17 MST

This archive was generated by hypermail pre-2.1.9 : Fri Apr 01 2005 - 12:00:04 MST