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 2015/04/16 14:08:26 UTC

svn commit: r1674056 - /httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c

Author: ylavic
Date: Thu Apr 16 12:08:25 2015
New Revision: 1674056

URL: http://svn.apache.org/r1674056
Log:
mod_proxy_ajp: Rename output_failed to client_failed in ap_proxy_ajp_request().
Since any read/write error is caught by this flag, it really means "dialog with
client <ip:port> failed" (as per the associated log message), whereas write to
client (output) errors need not be handled differently than any error occuring
after some bytes have already been sent to the client, which is the purpose of
the data_sent flag.

Modified:
    httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c?rev=1674056&r1=1674055&r2=1674056&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c Thu Apr 16 12:08:25 2015
@@ -177,7 +177,7 @@ static int ap_proxy_ajp_request(apr_pool
     apr_byte_t conn_reuse = 0;
     const char *tenc;
     int havebody = 1;
-    int output_failed = 0;
+    int client_failed = 0;
     int backend_failed = 0;
     apr_off_t bb_len;
     int data_sent = 0;
@@ -397,7 +397,7 @@ static int ap_proxy_ajp_request(apr_pool
                             else if (status == AP_FILTER_ERROR) {
                                 rv = AP_FILTER_ERROR;
                             }
-                            output_failed = 1;
+                            client_failed = 1;
                             break;
                         }
                         bufsiz = maxsize;
@@ -408,7 +408,7 @@ static int ap_proxy_ajp_request(apr_pool
                             ap_log_rerror(APLOG_MARK, APLOG_DEBUG, status, r, APLOGNO(00881)
                                          "apr_brigade_flatten failed");
                             rv = HTTP_INTERNAL_SERVER_ERROR;
-                            output_failed = 1;
+                            client_failed = 1;
                             break;
                         }
                     }
@@ -522,7 +522,7 @@ static int ap_proxy_ajp_request(apr_pool
                                               "error processing body.%s",
                                               r->connection->aborted ?
                                               " Client aborted connection." : "");
-                                output_failed = 1;
+                                client_failed = 1;
                             }
                             data_sent = 1;
                             apr_brigade_cleanup(output_brigade);
@@ -549,7 +549,7 @@ static int ap_proxy_ajp_request(apr_pool
                                         output_brigade) != APR_SUCCESS) {
                         ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(00888)
                                       "error processing end");
-                        output_failed = 1;
+                        client_failed = 1;
                     }
                     /* XXX: what about flush here? See mod_jk */
                     data_sent = 1;
@@ -572,8 +572,8 @@ static int ap_proxy_ajp_request(apr_pool
             if (!headers_sent) {
                 r->status = HTTP_BAD_REQUEST;
             }
+            client_failed = 1;
             /* return DONE */
-            output_failed = 1;
             data_sent = 1;
             break;
         }
@@ -582,8 +582,8 @@ static int ap_proxy_ajp_request(apr_pool
          * We either have finished successfully or we failed.
          * So bail out
          */
-        if ((result == CMD_AJP13_END_RESPONSE) || backend_failed
-            || output_failed)
+        if ((result == CMD_AJP13_END_RESPONSE)
+                || backend_failed || client_failed)
             break;
 
         /* read the response */
@@ -605,10 +605,10 @@ static int ap_proxy_ajp_request(apr_pool
      */
     apr_brigade_cleanup(output_brigade);
 
-    if (backend_failed || output_failed) {
+    if (backend_failed || client_failed) {
         ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(00890)
-                      "Processing of request failed backend: %i, "
-                      "output: %i", backend_failed, output_failed);
+                      "Processing of request failed backend: %i, client: %i",
+                      backend_failed, client_failed);
         /* We had a failure: Close connection to backend */
         conn->close = 1;
         if (data_sent) {
@@ -685,7 +685,7 @@ static int ap_proxy_ajp_request(apr_pool
             }
         }
     }
-    else if (output_failed) {
+    else if (client_failed) {
         int level = (r->connection->aborted) ? APLOG_DEBUG : APLOG_ERR;
         ap_log_rerror(APLOG_MARK, level, status, r, APLOGNO(02822)
                       "dialog with client %pI failed",