On Sun, May 8, 2016 at 8:53 AM, <rj...@apache.org> wrote:

> Author: rjung
> Date: Sun May  8 13:53:37 2016
> New Revision: 1742822
>
> URL: http://svn.apache.org/viewvc?rev=1742822&view=rev
> Log:
> Fix yet another case where we clobber the
> server-status request info when a timeout happens.
>
> Modified:
>     httpd/httpd/trunk/modules/http/http_core.c
>
> Modified: httpd/httpd/trunk/modules/http/http_core.c
> URL:
> http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_core.c?rev=1742822&r1=1742821&r2=1742822&view=diff
>
> ==============================================================================
> --- httpd/httpd/trunk/modules/http/http_core.c (original)
> +++ httpd/httpd/trunk/modules/http/http_core.c Sun May  8 13:53:37 2016
> @@ -148,7 +148,8 @@ static int ap_process_http_async_connect
>              c->keepalive = AP_CONN_UNKNOWN;
>              /* process the request if it was read without error */
>
> -            ap_update_child_status(c->sbh, SERVER_BUSY_WRITE, r);
> +            ap_update_child_status(c->sbh, SERVER_BUSY_WRITE,
> +                                   r->the_request ? r : NULL);
>              if (r->status == HTTP_OK) {
>                  cs->state = CONN_STATE_HANDLER;
>                  ap_process_async_request(r);
> @@ -203,7 +204,8 @@ static int ap_process_http_sync_connecti
>          c->keepalive = AP_CONN_UNKNOWN;
>          /* process the request if it was read without error */
>
> -        ap_update_child_status(c->sbh, SERVER_BUSY_WRITE, r);
> +        ap_update_child_status(c->sbh, SERVER_BUSY_WRITE,
> +                               r->the_request ? r : NULL);
>          if (r->status == HTTP_OK) {
>              if (cs)
>                  cs->state = CONN_STATE_HANDLER;
>

I'd explained in another thread this week why this patch is invalid,
and I've gone ahead and reverted.

We agreed there is a defect here, what about the attached fix?
Index: modules/http/http_core.c
===================================================================
--- modules/http/http_core.c	(revision 1743511)
+++ modules/http/http_core.c	(working copy)
@@ -148,9 +148,9 @@
             c->keepalive = AP_CONN_UNKNOWN;
             /* process the request if it was read without error */
 
-            ap_update_child_status(c->sbh, SERVER_BUSY_WRITE, r);
             if (r->status == HTTP_OK) {
                 cs->state = CONN_STATE_HANDLER;
+                ap_update_child_status(c->sbh, SERVER_BUSY_WRITE, r);
                 ap_process_async_request(r);
                 /* After the call to ap_process_request, the
                  * request pool may have been deleted.  We set
@@ -203,10 +203,10 @@
         c->keepalive = AP_CONN_UNKNOWN;
         /* process the request if it was read without error */
 
-        ap_update_child_status(c->sbh, SERVER_BUSY_WRITE, r);
         if (r->status == HTTP_OK) {
             if (cs)
                 cs->state = CONN_STATE_HANDLER;
+            ap_update_child_status(c->sbh, SERVER_BUSY_WRITE, r);
             ap_process_request(r);
             /* After the call to ap_process_request, the
              * request pool will have been deleted.  We set

Reply via email to