httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1592037 - in /httpd/httpd/trunk: CHANGES modules/proxy/mod_proxy_fcgi.c
Date Fri, 02 May 2014 20:46:29 GMT
Author: trawick
Date: Fri May  2 20:46:28 2014
New Revision: 1592037

URL: http://svn.apache.org/r1592037
Log:
mod_proxy_fcgi: Fix occasional high CPU when handling request bodies.

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1592037&r1=1592036&r2=1592037&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Fri May  2 20:46:28 2014
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_proxy_fcgi: Fix occasional high CPU when handling request bodies.
+     [Jeff Trawick]
+
   *) mod_proxy_fcgi: Support iobuffersize parameter.  [Jeff Trawick]
 
   *) mod_cache: Preserve non-cacheable headers forwarded from an origin 304

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c?rev=1592037&r1=1592036&r2=1592037&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c Fri May  2 20:46:28 2014
@@ -90,26 +90,13 @@ static int proxy_fcgi_canon(request_rec 
 static apr_status_t send_data(proxy_conn_rec *conn,
                               struct iovec *vec,
                               int nvec,
-                              apr_size_t *len,
-                              int blocking)
+                              apr_size_t *len)
 {
-    apr_status_t rv = APR_SUCCESS, arv;
+    apr_status_t rv = APR_SUCCESS;
     apr_size_t written = 0, to_write = 0;
     int i, offset;
-    apr_interval_time_t old_timeout;
     apr_socket_t *s = conn->sock;
 
-    if (!blocking) {
-        arv = apr_socket_timeout_get(s, &old_timeout);
-        if (arv != APR_SUCCESS) {
-            return arv;
-        }
-        arv = apr_socket_timeout_set(s, 0);
-        if (arv != APR_SUCCESS) {
-            return arv;
-        }
-    }
-
     for (i = 0; i < nvec; i++) {
         to_write += vec[i].iov_len;
     }
@@ -118,7 +105,7 @@ static apr_status_t send_data(proxy_conn
     while (to_write) {
         apr_size_t n = 0;
         rv = apr_socket_sendv(s, vec + offset, nvec - offset, &n);
-        if ((rv != APR_SUCCESS) && !APR_STATUS_IS_EAGAIN(rv)) {
+        if (rv != APR_SUCCESS) {
             break;
         }
         if (n > 0) {
@@ -141,12 +128,6 @@ static apr_status_t send_data(proxy_conn
     conn->worker->s->transferred += written;
     *len = written;
 
-    if (!blocking) {
-        arv = apr_socket_timeout_set(s, old_timeout);
-        if ((arv != APR_SUCCESS) && (rv == APR_SUCCESS)) {
-            return arv;
-        }
-    }
     return rv;
 }
 
@@ -209,7 +190,7 @@ static apr_status_t send_begin_request(p
     vec[1].iov_base = (void *)abrb;
     vec[1].iov_len = sizeof(abrb);
 
-    return send_data(conn, vec, 2, &len, 1);
+    return send_data(conn, vec, 2, &len);
 }
 
 static apr_status_t send_environment(proxy_conn_rec *conn, request_rec *r,
@@ -296,7 +277,7 @@ static apr_status_t send_environment(pro
         vec[1].iov_base = body;
         vec[1].iov_len = required_len;
 
-        rv = send_data(conn, vec, 2, &len, 1);
+        rv = send_data(conn, vec, 2, &len);
         apr_pool_clear(temp_pool);
 
         if (rv) {
@@ -311,7 +292,7 @@ static apr_status_t send_environment(pro
     vec[0].iov_base = (void *)farray;
     vec[0].iov_len = sizeof(farray);
 
-    return send_data(conn, vec, 1, &len, 1);
+    return send_data(conn, vec, 1, &len);
 }
 
 enum {
@@ -484,7 +465,7 @@ static apr_status_t dispatch(proxy_conn_
                     ++nvec;
                 }
 
-                rv = send_data(conn, vec, nvec, &len, 0);
+                rv = send_data(conn, vec, nvec, &len);
                 if (rv != APR_SUCCESS) {
                     *err = "sending stdin";
                     break;
@@ -505,7 +486,7 @@ static apr_status_t dispatch(proxy_conn_
                     vec[0].iov_base = (void *)farray;
                     vec[0].iov_len = sizeof(farray);
 
-                    rv = send_data(conn, vec, 1, &len, 1);
+                    rv = send_data(conn, vec, 1, &len);
                     if (rv != APR_SUCCESS) {
                         *err = "sending empty stdin";
                         break;



Mime
View raw message