Ah, exam avoidance: here's the last of the deferred reads removed.
I'm going to go through the patch that I have and remove the bits that
weren't used during my work.
I'll continue testing this stuff out during my exam avoidance at work.
TODO:
* trim the crap out
* trim out the deferred read checking stuff from comm_select.c
(but not reimplement building/maintaining the poll/select sets, thats
not the aim of this branch)
* use my delayed read stuff to implement delay pools in the
server side code
Once I've done this I'd like to commit it to the 2.6 branch, test it
thoroughly, then break out comm_select.c into poll/select/kqueue/epoll
and merge in Steven's epoll comm code.
Thoughts?
Adrian
----- Forwarded message from Adrian Chadd <adri@users.sourceforge.net> -----
To: squid-cvs@lists.sourceforge.net
From: Adrian Chadd <adri@users.sourceforge.net>
Subject: [Squid-cvs] tidyup_deferred_reads squid/src client_side.c,1.47.2.59.4.8,1.47.2.59.4.9
Reply-To: squid-dev@squid-cache.org
Date: Tue, 25 Oct 2005 20:46:28 -0700
Update of /cvsroot/squid/squid/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22483
Modified Files:
Tag: tidyup_deferred_reads
client_side.c
Log Message:
Hah, this was easier than I thought. Just check in clientReadRequest()
if we need to do the defer and, if we do, reschedule the read for a second
from now.
This basically mimics the behaviour in the epoll dev branch for situations
like this where there's no way to 'kick' the defer - as he's checking
defer handlers once a second to see whether they still need to be deferred.
Yay, this is the last defer handler.
Index: client_side.c
===================================================================
RCS file: /cvsroot/squid/squid/src/client_side.c,v
retrieving revision 1.47.2.59.4.8
retrieving revision 1.47.2.59.4.9
diff -w -u -r1.47.2.59.4.8 -r1.47.2.59.4.9
--- client_side.c 26 Oct 2005 03:00:13 -0000 1.47.2.59.4.8
+++ client_side.c 26 Oct 2005 03:46:26 -0000 1.47.2.59.4.9
@@ -2991,6 +2991,11 @@
fde *F = &fd_table[fd];
int len = conn->in.size - conn->in.offset - 1;
debug(33, 4) ("clientReadRequest: FD %d: reading request...\n", fd);
+ if (clientReadDefer(conn->fd, conn)) {
+ /* We're reading too fast - back off for a second */
+ commDeferReadUntil(conn->fd, 1, clientReadRequest, conn);
+ return;
+ }
clientReadSchedule(conn);
if (len == 0) {
/* Grow the request memory area to accomodate for a large request */
@@ -3061,6 +3066,11 @@
cbdataUnlock(conn);
return;
}
+ if (clientReadDefer(conn->fd, conn)) {
+ /* We're reading too fast - back off for a second */
+ commDeferReadUntil(conn->fd, 1, clientReadRequest, conn);
+ return;
+ }
}
/* Process next request */
while (conn->in.offset > 0 && conn->body.size_left == 0) {
@@ -3559,7 +3569,6 @@
identStart(&me, &peer, clientIdentDone, connState);
#endif
clientReadSchedule(connState);
- commSetDefer(fd, clientReadDefer, connState);
clientdbEstablished(peer.sin_addr, 1);
assert(N);
(*N)++;
@@ -3680,7 +3689,6 @@
identStart(&me, &peer, clientIdentDone, connState);
#endif
commSetSelect(fd, COMM_SELECT_READ, clientNegotiateSSL, connState, 0);
- commSetDefer(fd, clientReadDefer, connState);
clientdbEstablished(peer.sin_addr, 1);
(*N)++;
}
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Squid-cvs mailing list
http://devel.squid-cache.org/
----- End forwarded message -----
Received on Tue Oct 25 2005 - 21:56:26 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Nov 01 2005 - 12:00:07 MST