[adri@users.sourceforge.net: [Squid-cvs] commloops squid/src http.c protos.h store.c store_client.c structs.h]

From: Adrian Chadd <adrian@dont-contact.us>
Date: Mon, 9 Oct 2000 09:26:16 +0800

I'd appreciate some feedback about this please. :-)

Adrian

----- Forwarded message from adri <adri@users.sourceforge.net> -----

Date: Sun, 8 Oct 2000 18:12:51 -0700
To: squid-cvs@lists.sourceforge.net
From: adri <adri@users.sourceforge.net>
Subject: [Squid-cvs] commloops squid/src http.c protos.h store.c store_client.c structs.h

Update of /cvsroot/squid/squid/src

Modified Files:
      Tag: commloops
        http.c protos.h store.c store_client.c structs.h
Log Message:

Store copying. This is the first change to bring squid into event-driven bliss.
Basically, the deferred reads are anti-event-driven-IO, and squid relies on
them to make sure the server data doesn't come too quickly. This change turns
the reading into a callback, which is called by storeClientCopy() if set in
order to get some data.

So, the flow was:

 .. commSetSelect(fd, READ, httpReadReply)
..

httpReadReply()
  read data
  InvokeHandlers()
    storeClientCopy2() <-- make sure each store client can get data it wants
  commSetSelect(fd, READ, httpReadReply)

storeClientCopy()
  if (Data exists)
    return it
  otherwise
    wait / schedule a swapin

The server data flow was kept by fwdCheckDeferRead(), which stopped it going
too far.

Now, the data flow is:

httpReadReply()
  read data
  InvokeHandlers()
  if (not end of object)
    storeServerDataCallback()

..

storeClientCopy()
  if (store server callback set)
    call it <-- this will now call httpReadReply() in this example
  if (Data exists)
   ..

Since storeClientCopy() is always called to keep getting data, IO from the
server happens when this is the case. WHilst reading reading headers the
IO is done without the storeServerDataCallback(). This has the advantage that
server IO is driven by what the fastest client wants (which isn't the most
optimal thing in some people's eyes, but we can modify this later).

So now, squid (at least for HTTP IO) is event driven friendly. I'll work on
the other protocols at a later date.

_______________________________________________
Squid-cvs mailing list
Squid-cvs@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/squid-cvs

----- End forwarded message -----

-- 
Adrian Chadd			"If a butterfly flaps its wings in China,
<adrian@creative.net.au>	    will a woman get naked in Amsterdam?"
				      -- Ashley Penney on Chaos Theory
Received on Sun Oct 08 2000 - 19:26:26 MDT

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