[BUG] queue management: wake oldest request in queues
When a server terminates a connection, the next session in its
own queue was immediately processed. Because of this, if all
server queues are always filled, then no new anonymous request
will be processed. Consider oldest request between global and
server queues to choose from which to pick the request.
An improvement over this will consist in adding a configurable
offset when comparing expiration dates, so that cookie-less
requests can get either less or more priority.
diff --git a/include/types/session.h b/include/types/session.h
index 45e38fd..08fdc86 100644
--- a/include/types/session.h
+++ b/include/types/session.h
@@ -103,7 +103,7 @@
struct {
int logwait; /* log fields waiting to be collected : LW_* */
struct timeval tv_accept; /* date of the accept() (beginning of the session) */
- long t_request; /* delay before the end of the request arrives, -1 if never occurs */
+ struct timeval tv_request; /* date the request arrives, {0,0} if never occurs */
long t_queue; /* delay before the session gets out of the connect queue, -1 if never occurs */
long t_connect; /* delay before the connect() to the server succeeds, -1 if never occurs */
long t_data; /* delay before the first data byte from the server ... */