httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yla...@apache.org
Subject svn commit: r1733054 - in /httpd/httpd/trunk/modules: filters/mod_reqtimeout.c proxy/mod_proxy.h proxy/proxy_util.c
Date Tue, 01 Mar 2016 12:31:40 GMT
Author: ylavic
Date: Tue Mar  1 12:31:40 2016
New Revision: 1733054

URL: http://svn.apache.org/viewvc?rev=1733054&view=rev
Log:
mod_proxy: follow up to r1729826 + r1729847 + r1732986.
Don't use magic constants.

Modified:
    httpd/httpd/trunk/modules/filters/mod_reqtimeout.c
    httpd/httpd/trunk/modules/proxy/mod_proxy.h
    httpd/httpd/trunk/modules/proxy/proxy_util.c

Modified: httpd/httpd/trunk/modules/filters/mod_reqtimeout.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_reqtimeout.c?rev=1733054&r1=1733053&r2=1733054&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_reqtimeout.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_reqtimeout.c Tue Mar  1 12:31:40 2016
@@ -352,6 +352,15 @@ out:
     return rv;
 }
 
+static apr_status_t reqtimeout_pause(ap_filter_t *f, apr_bucket_brigade *bb)
+{
+    if (!APR_BRIGADE_EMPTY(bb) && AP_BUCKET_IS_EOR(APR_BRIGADE_LAST(bb))) {
+        reqtimeout_con_cfg *ccfg = f->ctx;
+        ccfg->timeout_at = 0;
+    }
+    return ap_pass_brigade(f->next, bb);
+}
+
 static int reqtimeout_init(conn_rec *c)
 {
     reqtimeout_con_cfg *ccfg;
@@ -369,6 +378,7 @@ static int reqtimeout_init(conn_rec *c)
     if (ccfg == NULL) {
         ccfg = apr_pcalloc(c->pool, sizeof(reqtimeout_con_cfg));
         ap_set_module_config(c->conn_config, &reqtimeout_module, ccfg);
+        ap_add_output_filter(reqtimeout_filter_name, ccfg, NULL, c);
         ap_add_input_filter(reqtimeout_filter_name, ccfg, NULL, c);
     }
 
@@ -607,6 +617,14 @@ static void reqtimeout_hooks(apr_pool_t
                              AP_FTYPE_CONNECTION + 8);
 
     /*
+     * We need to pause timeout detection in between requests, for
+     * speculative and non-blocking reads, so between each outgoing EOR
+     * and the next pre_read_request call.
+     */
+    ap_register_output_filter(reqtimeout_filter_name, reqtimeout_pause, NULL,
+                              AP_FTYPE_CONNECTION);
+
+    /*
      * mod_reqtimeout needs to be called before ap_process_http_request (which
      * is run at APR_HOOK_REALLY_LAST) but after all other protocol modules.
      * This ensures that it only influences normal http connections and not

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy.h?rev=1733054&r1=1733053&r2=1733054&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy.h (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy.h Tue Mar  1 12:31:40 2016
@@ -349,6 +349,11 @@ PROXY_WORKER_HC_FAIL )
 #define PROXY_BALANCER_MAX_HOSTNAME_SIZE 64
 #define PROXY_BALANCER_MAX_STICKY_SIZE   64
 
+/* RFC-1035 mentions limits of 255 for host-names and 253 for domain-names,
+ * dotted together(?) this would fit the below size (+ trailing NUL).
+ */
+#define PROXY_WORKER_RFC1035_NAME_SIZE   512
+
 #define PROXY_MAX_PROVIDER_NAME_SIZE     16
 
 #define PROXY_STRNCPY(dst, src) ap_proxy_strncpy((dst), (src), (sizeof(dst)))

Modified: httpd/httpd/trunk/modules/proxy/proxy_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/proxy_util.c?rev=1733054&r1=1733053&r2=1733054&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/proxy_util.c (original)
+++ httpd/httpd/trunk/modules/proxy/proxy_util.c Tue Mar  1 12:31:40 2016
@@ -2721,7 +2721,7 @@ PROXY_DECLARE(int) ap_proxy_connect_back
              * restore any ssl_hostname for this connection set earlier by
              * ap_proxy_determine_connection().
              */
-            char ssl_hostname[512]; /* host+domain names max (rfc1035-2.3.4) */
+            char ssl_hostname[PROXY_WORKER_RFC1035_NAME_SIZE];
             if (!conn->ssl_hostname || PROXY_STRNCPY(ssl_hostname,
                                                      conn->ssl_hostname)) {
                 ssl_hostname[0] = '\0';



Mime
View raw message