httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject svn commit: r349190 - /httpd/httpd/trunk/server/mpm/experimental/event/event.c
Date Sun, 27 Nov 2005 07:34:17 GMT
Author: brianp
Date: Sat Nov 26 23:34:15 2005
New Revision: 349190

URL: http://svn.apache.org/viewcvs?rev=349190&view=rev
Log:
When computing the timeouts for keepalives and write completion,
get the current time _after_ processing the event that led to the
timeout, rather than before.
[forward-port of commit 349189 from the async-read-dev branch]

Modified:
    httpd/httpd/trunk/server/mpm/experimental/event/event.c

Modified: httpd/httpd/trunk/server/mpm/experimental/event/event.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/server/mpm/experimental/event/event.c?rev=349190&r1=349189&r2=349190&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/experimental/event/event.c (original)
+++ httpd/httpd/trunk/server/mpm/experimental/event/event.c Sat Nov 26 23:34:15 2005
@@ -565,14 +565,11 @@
     long conn_id = ID_FROM_CHILD_THREAD(my_child_num, my_thread_num);
     int csd;
     int rc;
-    apr_time_t time_now = 0;
     ap_sb_handle_t *sbh;
 
     ap_create_sb_handle(&sbh, p, my_child_num, my_thread_num);
     apr_os_sock_get(&csd, sock);
 
-    time_now = apr_time_now();
-
     if (cs == NULL) {           /* This is a new connection */
 
         cs = apr_pcalloc(p, sizeof(conn_state_t));
@@ -657,7 +654,7 @@
              * Set a write timeout for this connection, and let the
              * event thread poll for writeability.
              */
-            cs->expiration_time = ap_server_conf->timeout + time_now;
+            cs->expiration_time = ap_server_conf->timeout + apr_time_now();
             apr_thread_mutex_lock(timeout_mutex);
             APR_RING_INSERT_TAIL(&timeout_head, cs, conn_state_t, timeout_list);
             apr_thread_mutex_unlock(timeout_mutex);
@@ -698,7 +695,8 @@
          * timeout today.  With a normal client, the socket will be readable in
          * a few milliseconds anyway.
          */
-        cs->expiration_time = ap_server_conf->keep_alive_timeout + time_now;
+        cs->expiration_time = ap_server_conf->keep_alive_timeout +
+                              apr_time_now();
         apr_thread_mutex_lock(timeout_mutex);
         APR_RING_INSERT_TAIL(&keepalive_timeout_head, cs, conn_state_t, timeout_list);
         apr_thread_mutex_unlock(timeout_mutex);



Mime
View raw message