| 94 | /* Translate the URL into a 'filename' */ |
| 95 | |
| 96 | static const char *set_worker_param(apr_pool_t *p, |
| 97 | server_rec *s, |
| 98 | proxy_worker *worker, |
| 99 | const char *key, |
| 100 | const char *val) |
| 101 | { |
| 102 | |
| 103 | int ival; |
| 104 | apr_interval_time_t timeout; |
| 105 | |
| 106 | if (!strcasecmp(key, "loadfactor")) { |
| 107 | /* Normalized load factor. Used with BalancerMember, |
| 108 | * it is a number between 1 and 100. |
| 109 | */ |
| 110 | double fval = atof(val); |
| 111 | ival = fval * 100.0; |
| 112 | if (ival < 100 || ival > 10000) |
| 113 | return "LoadFactor must be a number between 1..100"; |
| 114 | worker->s->lbfactor = ival; |
| 115 | } |
| 116 | else if (!strcasecmp(key, "retry")) { |
| 117 | /* If set it will give the retry timeout for the worker |
| 118 | * The default value is 60 seconds, meaning that if |
| 119 | * in error state, it will be retried after that timeout. |
| 120 | */ |
| 121 | ival = atoi(val); |
| 122 | if (ival < 0) |
| 123 | return "Retry must be a positive value"; |
| 124 | worker->s->retry = apr_time_from_sec(ival); |
| 125 | worker->s->retry_set = 1; |
| 126 | } |
| 127 | else if (!strcasecmp(key, "ttl")) { |
| 128 | /* Time in seconds that will destroy all the connections |
| 129 | * that exceed the smax |
| 130 | */ |
| 131 | ival = atoi(val); |
| 132 | if (ival < 1) |
| 133 | return "TTL must be at least one second"; |
| 134 | worker->s->ttl = apr_time_from_sec(ival); |
| 135 | } |
| 136 | else if (!strcasecmp(key, "min")) { |
| 137 | /* Initial number of connections to remote |
| 138 | */ |
| 139 | ival = atoi(val); |
| 140 | if (ival < 0) |
| 141 | return "Min must be a positive number"; |
| 142 | worker->s->min = ival; |
| 143 | } |
| 144 | else if (!strcasecmp(key, "max")) { |
| 145 | /* Maximum number of connections to remote |
| 146 | */ |
| 147 | ival = atoi(val); |
| 148 | if (ival < 0) |
| 149 | return "Max must be a positive number"; |
| 150 | worker->s->hmax = ival; |
| 151 | } |
| 152 | /* XXX: More intelligent naming needed */ |
| 153 | else if (!strcasecmp(key, "smax")) { |
no test coverage detected