]> granicus.if.org Git - apache/commitdiff
Added timeout_set for worker. Each worker can have a different timeout
authorWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 11 Aug 2004 22:31:46 +0000 (22:31 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 11 Aug 2004 22:31:46 +0000 (22:31 +0000)
the ProxyTimout sets. Also changed proxy_conf's timeout_set to int.

Use timeout_set for worker inherited from ProxyTimeout but overridable
using timout=xxx

Submitted by: mturk

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104592 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy.c
modules/proxy/mod_proxy.h

index 5d863b2e38c824231437e0a3f6a7b0a677507e91..c09aebc55948c9ab1e0457772c31f8c67eda6946 100644 (file)
@@ -121,6 +121,13 @@ static const char *set_worker_param(proxy_worker *worker,
         worker->acquire = apr_time_make(0, ival * 1000);
         worker->acquire_set = 1;
      }
+    else if (!strcasecmp(key, "timeout")) {
+        ival = atoi(val);
+        if (ival < 1)
+            return "timeout must be at least one second";
+        worker->timeout = apr_time_from_sec(ival);
+        worker->timeout_set = 1;
+     }
     else {
         return "unknown parameter";
     }
@@ -1231,9 +1238,9 @@ static const char *add_member(cmd_parms *cmd, void *dummy, const char *arg)
         if ((err = ap_proxy_add_worker(&worker, cmd->pool, conf, name)) != NULL)
             return apr_pstrcat(cmd->temp_pool, "BalancerMember: ", err, NULL); 
     }
-    if (conf->timeout_set)
+    if ((worker->timeout_set = conf->timeout_set))
         worker->timeout = conf->timeout;
-
+    
     arr = apr_table_elts(params);
     elts = (const apr_table_entry_t *)arr->elts;
     for (i = 0; i < arr->nelts; i++) {
index 06eb00a2ebd637191381f3f259307b680719d705..c2f661938d22a01f981d0499f7e97ee57623718b 100644 (file)
@@ -155,7 +155,7 @@ typedef struct {
     int preserve_host;
     int preserve_host_set;
     apr_interval_time_t timeout;
-    apr_interval_time_t timeout_set;
+    int timeout_set;
     enum {
       bad_error,
       bad_ignore,
@@ -228,6 +228,7 @@ struct proxy_worker {
     apr_interval_time_t ttl;    /* maximum amount of time in seconds a connection
                                  * may be available while exceeding the soft limit */
     apr_interval_time_t timeout; /* connection timeout */
+    int timeout_set;
     apr_interval_time_t acquire; /* acquire timeout when the maximum number of connections is exceeded */
     char                acquire_set;
     proxy_conn_pool *cp;        /* Connection pool to use */
@@ -352,6 +353,9 @@ PROXY_DECLARE(int) ap_proxy_pre_request(proxy_worker **worker, proxy_balancer **
 PROXY_DECLARE(apr_status_t) ap_proxy_determine_connection(apr_pool_t *p, request_rec *r, proxy_server_conf *conf, proxy_worker *worker, proxy_conn_rec *conn,
                                                           apr_pool_t *ppool, apr_uri_t *uri, char **url, const char *proxyname, apr_port_t proxyport,
                                                           char *server_portstr, int server_portstr_size);
+PROXY_DECLARE(apr_status_t) ap_proxy_destroy_connection(proxy_conn_rec *conn);
+PROXY_DECLARE(apr_status_t) ap_proxy_close_connection(proxy_conn_rec *conn);
+
 
 /* For proxy_util */
 extern module PROXY_DECLARE_DATA proxy_module;