Sorry again for the lack of attachment. :(

There definitely is confusion here and it's definitely my
fault.  First, the lack of attachment.  Second, I have
made this both a fix *and* a feature both of which only
apply to the 2.0 line.

I'm including the patch again and can modify it to include
just the fix part if that will help get it included in the
2.0 line.

Ron

On Thu, 2008-02-07 at 09:06 +0100, jean-frederic clere wrote:
> Chris H. wrote:
> > Quoting Jim Jagielski <[EMAIL PROTECTED]>:
> > 
> >>
> >> On Feb 5, 2008, at 2:52 PM, Ronald Park wrote:
> >>>
> >>> Attached is my patch to 2.0.63 to the proxy_http.c file in
> >>> modules/proxy.
> >>>
> >>
> >> I didn't see any attached patch... :/
> 
> Without the patch the whole discussion is useless ;-(
> 
> >>
> >> In any case, the normal process is patch applied to
> >> trunk with then backport proposals to 2.2 and 2.0. A feature
> >> added to 2.0.x, without it being in 2.2 and trunk is likely
> >> not gonna happen.
> > 
> > If I understood the original posting correctly. This is a /fix/
> > not a /feature/. Isn't there any interest in correcting issues
> > in the 2.0.x branch? Or am I to understand that the term "feature"
> > also means "fix(es)". :)
> 
> What we normally do is to fix trunk and port back to 2.2.x and/or 2.0.x.
> 
> Cheers
> 
> Jean-Frederic
> 
> > 
> >>
> >>
> > 
> > 
> > 
> 
--- modules/proxy/proxy_http.c.orig	2007-09-04 15:33:45.000000000 -0400
+++ modules/proxy/proxy_http.c	2008-02-04 14:57:21.000000000 -0500
@@ -379,6 +379,36 @@
                          "proxy: HTTP: pre_connection setup failed (%d)",
                          rc);
             return rc;
+        } else {
+            // that pre_connection code sets the socket timeout as
+            // the value of Timeout which is the timeout of the
+            // original request; by the time that is hit, our client
+            // has already been given a timeout
+            //
+            // instead, we'll look to see if an env var, proxy-timeout,
+            // has been set: if so, we use it; otherwise, we use
+            // the setting for ProxyTimeout (if set); (otherwise, we
+            // will stick with the value of Timeout.)
+            const char* tbl_timeout;
+            apr_interval_time_t timeout = (conf->timeout_set) ?
+                                           conf->timeout : 0;
+
+            tbl_timeout = apr_table_get(r->subprocess_env, "proxy-timeout");
+            if (tbl_timeout == NULL) {
+                tbl_timeout = apr_table_get(r->notes, "proxy-timeout");
+            }
+            if (tbl_timeout != NULL) {
+                int int_timeout = atoi(tbl_timeout);
+                if (int_timeout > 0) {
+                  timeout = apr_time_from_sec(int_timeout);
+                }
+            }
+            if (timeout > 0) {
+                apr_socket_timeout_set(p_conn->sock, timeout);
+                ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
+                         "proxy:  setting request timeout (%d)", timeout);
+            }
+
         }
     }
     return OK;

Reply via email to