You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2017/09/22 08:07:48 UTC

svn commit: r1809276 - in /httpd/httpd/trunk/server/mpm: event/event.c motorz/motorz.c simple/simple_io.c

Author: ylavic
Date: Fri Sep 22 08:07:47 2017
New Revision: 1809276

URL: http://svn.apache.org/viewvc?rev=1809276&view=rev
Log:
event, simple, motorz: better naming, error code checking and arrangement
around pending output data handing; no functional change.


Modified:
    httpd/httpd/trunk/server/mpm/event/event.c
    httpd/httpd/trunk/server/mpm/motorz/motorz.c
    httpd/httpd/trunk/server/mpm/simple/simple_io.c

Modified: httpd/httpd/trunk/server/mpm/event/event.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/event.c?rev=1809276&r1=1809275&r2=1809276&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/event/event.c (original)
+++ httpd/httpd/trunk/server/mpm/event/event.c Fri Sep 22 08:07:47 2017
@@ -1065,16 +1065,12 @@ read_request:
     }
 
     if (cs->pub.state == CONN_STATE_WRITE_COMPLETION) {
-        int not_complete_yet;
+        int pending;
 
         ap_update_child_status(cs->sbh, SERVER_BUSY_WRITE, NULL);
 
-        not_complete_yet = ap_run_output_pending(c);
-
-        if (not_complete_yet > OK) {
-            cs->pub.state = CONN_STATE_LINGER;
-        }
-        else if (not_complete_yet == OK) {
+        pending = ap_run_output_pending(c);
+        if (pending == OK) {
             /* Still in WRITE_COMPLETION_STATE:
              * Set a write timeout for this connection, and let the
              * event thread poll for writeability.
@@ -1102,8 +1098,10 @@ read_request:
             }
             return;
         }
-        else if (c->keepalive != AP_CONN_KEEPALIVE || c->aborted ||
-                 listener_may_exit) {
+        if (pending != DECLINED
+                || c->aborted
+                || c->keepalive != AP_CONN_KEEPALIVE
+                || listener_may_exit) {
             cs->pub.state = CONN_STATE_LINGER;
         }
         else if (c->data_in_input_filters || ap_run_input_pending(c) == OK) {

Modified: httpd/httpd/trunk/server/mpm/motorz/motorz.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/motorz/motorz.c?rev=1809276&r1=1809275&r2=1809276&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/motorz/motorz.c (original)
+++ httpd/httpd/trunk/server/mpm/motorz/motorz.c Fri Sep 22 08:07:47 2017
@@ -397,19 +397,15 @@ read_request:
         }
 
         if (scon->cs.state == CONN_STATE_WRITE_COMPLETION) {
-            int not_complete_yet;
+            int pending;
 
             ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, APLOGNO(03331)
                                   "motorz_io_process(): CONN_STATE_WRITE_COMPLETION");
 
             ap_update_child_status(scon->sbh, SERVER_BUSY_WRITE, NULL);
 
-            not_complete_yet = ap_run_output_pending(c);
-
-            if (not_complete_yet > OK) {
-                scon->cs.state = CONN_STATE_LINGER;
-            }
-            else if (not_complete_yet == OK) {
+            pending = ap_run_output_pending(c);
+            if (pending == OK) {
                 /* Still in WRITE_COMPLETION_STATE:
                  * Set a write timeout for this connection, and let the
                  * event thread poll for writeability.
@@ -432,7 +428,9 @@ read_request:
                 }
                 return APR_SUCCESS;
             }
-            else if (c->keepalive != AP_CONN_KEEPALIVE || c->aborted) {
+            if (pending != DECLINED
+                    || c->keepalive != AP_CONN_KEEPALIVE
+                    || c->aborted) {
                 scon->cs.state = CONN_STATE_LINGER;
             }
             else if (c->data_in_input_filters || ap_run_input_pending(c) == OK) {

Modified: httpd/httpd/trunk/server/mpm/simple/simple_io.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/simple/simple_io.c?rev=1809276&r1=1809275&r2=1809276&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/simple/simple_io.c (original)
+++ httpd/httpd/trunk/server/mpm/simple/simple_io.c Fri Sep 22 08:07:47 2017
@@ -93,15 +93,11 @@ static apr_status_t simple_io_process(si
         }
 
         if (scon->cs.state == CONN_STATE_WRITE_COMPLETION) {
-            int not_complete_yet;
+            int pending;
 
             ap_update_child_status(c->sbh, SERVER_BUSY_WRITE, NULL);
-            not_complete_yet = ap_run_output_pending(c);
-
-            if (not_complete_yet > OK) {
-                scon->cs.state = CONN_STATE_LINGER;
-            }
-            else if (not_complete_yet == OK) {
+            pending = ap_run_output_pending(c);
+            if (pending == OK) {
                 /* Still in WRITE_COMPLETION_STATE:
                  * Set a write timeout for this connection, and let the
                  * event thread poll for writeability.
@@ -130,7 +126,9 @@ static apr_status_t simple_io_process(si
                 }
                 return APR_SUCCESS;
             }
-            else if (c->keepalive != AP_CONN_KEEPALIVE || c->aborted) {
+            if (pending != DECLINED
+                    || c->keepalive != AP_CONN_KEEPALIVE
+                    || c->aborted) {
                 scon->cs.state = CONN_STATE_LINGER;
             }
             else if (c->data_in_input_filters || ap_run_input_pending(c) == OK) {