Lines Matching defs:worker
59 proxy_worker *worker,
71 worker->s->lbfactor = atoi(val);
72 if (worker->s->lbfactor < 1 || worker->s->lbfactor > 100)
76 /* If set it will give the retry timeout for the worker
83 worker->s->retry = apr_time_from_sec(ival);
84 worker->s->retry_set = 1;
93 worker->s->ttl = apr_time_from_sec(ival);
101 worker->s->min = ival;
109 worker->s->hmax = ival;
119 worker->s->smax = ival;
130 worker->s->acquire = timeout;
131 worker->s->acquire_set = 1;
140 worker->s->timeout = apr_time_from_sec(ival);
141 worker->s->timeout_set = 1;
148 worker->s->io_buffer_size = (s ? s : AP_IOBUFSIZE);
149 worker->s->io_buffer_size_set = 1;
156 worker->s->recv_buffer_size = ival;
157 worker->s->recv_buffer_size_set = 1;
161 worker->s->keepalive = 1;
163 worker->s->keepalive = 0;
166 worker->s->keepalive_set = 1;
170 worker->s->disablereuse = 1;
172 worker->s->disablereuse = 0;
175 worker->s->disablereuse_set = 1;
179 worker->s->disablereuse = 0;
181 worker->s->disablereuse = 1;
184 worker->s->disablereuse_set = 1;
189 if (strlen(val) >= sizeof(worker->s->route))
191 (int)sizeof(worker->s->route));
192 PROXY_STRNCPY(worker->s->route, val);
197 if (strlen(val) >= sizeof(worker->s->redirect))
199 (int)sizeof(worker->s->redirect));
200 PROXY_STRNCPY(worker->s->redirect, val);
217 rv = ap_proxy_set_wstatus(*v, mode, worker);
224 worker->s->flush_packets = flush_on;
226 worker->s->flush_packets = flush_off;
228 worker->s->flush_packets = flush_auto;
238 worker->s->flush_wait = PROXY_FLUSH_WAIT;
240 worker->s->flush_wait = ival * 1000; /* change to microseconds */
249 worker->s->ping_timeout = timeout;
250 worker->s->ping_timeout_set = 1;
256 worker->s->lbset = ival;
266 worker->s->conn_timeout = timeout;
267 worker->s->conn_timeout_set = 1;
270 if (strlen(val) >= sizeof(worker->s->flusher))
272 (int)sizeof(worker->s->flusher));
273 PROXY_STRNCPY(worker->s->flusher, val);
322 * if the worker is in error state or
336 * wait for a free worker.
942 proxy_worker *worker = NULL;
1075 /* Try to obtain the most suitable worker */
1076 access_status = ap_proxy_pre_request(&worker, &balancer, r, conf, &url);
1086 * Ensure that balancer is NULL if worker is NULL to prevent
1089 if (!worker)
1094 /* Initialise worker if needed, note the shared area must be initialized by the balancer logic */
1096 ap_proxy_initialize_worker(worker, r->server, conf->pool);
1116 access_status = proxy_run_scheme_handler(r, worker,
1169 AP_PROXY_RUN(r, worker, conf, url, attempts);
1170 access_status = proxy_run_scheme_handler(r, worker, conf,
1176 * We can not failover to another worker.
1177 * Mark the worker as unusable if member of load balancer
1180 && !(worker->s->status & PROXY_WORKER_IGNORE_ERRORS)) {
1181 worker->s->status |= PROXY_WORKER_IN_ERROR;
1182 worker->s->error_time = apr_time_now();
1188 * We can failover to another worker
1189 * Mark the worker as unusable if member of load balancer
1192 && !(worker->s->status & PROXY_WORKER_IGNORE_ERRORS)) {
1193 worker->s->status |= PROXY_WORKER_IN_ERROR;
1194 worker->s->error_time = apr_time_now();
1203 /* Try again if the worker is unusable and the service is
1206 } while (!PROXY_WORKER_IS_USABLE(worker) &&
1228 ap_proxy_post_request(worker, balancer, r, conf);
1725 /* Distinguish the balancer from worker */
1758 proxy_worker *worker = ap_proxy_get_worker(cmd->temp_pool, NULL, conf, new->real);
1760 if (!worker) {
1763 err = ap_proxy_define_match_worker(cmd->pool, &worker, NULL,
1767 err = ap_proxy_define_worker(cmd->pool, &worker, NULL,
1773 PROXY_COPY_CONF_PARAMS(worker, conf);
1775 else if ((use_regex != 0) ^ (worker->s->is_name_matchable != 0)) {
1778 "together with the same worker name ",
1779 "(", worker->s->name, ")", NULL);
1784 "Sharing worker '%s' instead of creating new worker '%s'",
1785 ap_proxy_worker_name(cmd->pool, worker), new->real);
1791 "Ignoring parameter '%s=%s' for worker '%s' because of worker sharing",
1792 elts[i].key, elts[i].val, ap_proxy_worker_name(cmd->pool, worker));
1794 const char *err = set_worker_param(cmd->pool, worker, elts[i].key,
2197 proxy_worker *worker;
2251 /* Try to find existing worker */
2252 worker = ap_proxy_get_worker(cmd->temp_pool, balancer, conf, ap_proxy_de_socketfy(cmd->temp_pool, name));
2253 if (!worker) {
2255 "Defining worker '%s' for balancer '%s'",
2257 if ((err = ap_proxy_define_worker(cmd->pool, &worker, balancer, conf, name, 0)) != NULL)
2260 "Defined worker '%s' for balancer '%s'",
2261 ap_proxy_worker_name(cmd->pool, worker), balancer->s->name);
2262 PROXY_COPY_CONF_PARAMS(worker, conf);
2266 "Sharing worker '%s' instead of creating new worker '%s'",
2267 ap_proxy_worker_name(cmd->pool, worker), name);
2275 "Ignoring parameter '%s=%s' for worker '%s' because of worker sharing",
2276 elts[i].key, elts[i].val, ap_proxy_worker_name(cmd->pool, worker));
2278 err = set_worker_param(cmd->pool, worker, elts[i].key,
2297 proxy_worker *worker = NULL;
2309 * Parent directive arg is the worker/balancer name.
2317 /* Standard set directive with worker/balancer
2338 worker = ap_proxy_get_worker(cmd->temp_pool, NULL, conf, ap_proxy_de_socketfy(cmd->temp_pool, name));
2339 if (!worker) {
2341 err = ap_proxy_define_worker(cmd->pool, &worker, NULL,
2362 if (worker)
2363 err = set_worker_param(cmd->pool, worker, word, val);
2395 proxy_worker *worker = NULL;
2479 worker = ap_proxy_get_worker(cmd->temp_pool, NULL, sconf,
2481 if (!worker) {
2483 err = ap_proxy_define_match_worker(cmd->pool, &worker, NULL,
2487 err = ap_proxy_define_worker(cmd->pool, &worker, NULL,
2494 else if ((use_regex != 0) ^ (worker->s->is_name_matchable != 0)) {
2497 "altogether with the same worker name ",
2498 "(", worker->s->name, ")", NULL);
2501 if (worker == NULL && balancer == NULL) {
2515 if (worker)
2516 err = set_worker_param(cmd->pool, worker, word, val);
2597 "A balancer or worker name with list of params"),
2684 proxy_worker **worker = NULL;
2725 worker = (proxy_worker **)balancer->workers->elts;
2729 ap_rvputs(r, "<tr>\n<td>", (*worker)->s->scheme, "</td>", NULL);
2730 ap_rvputs(r, "<td>", (*worker)->s->hostname, "</td><td>", NULL);
2731 ap_rvputs(r, ap_proxy_parse_wstatus(r->pool, *worker), NULL);
2732 ap_rvputs(r, "</td><td>", (*worker)->s->route, NULL);
2733 ap_rvputs(r, "</td><td>", (*worker)->s->redirect, NULL);
2734 ap_rprintf(r, "</td><td>%d</td>", (*worker)->s->lbfactor);
2735 ap_rprintf(r, "<td>%d</td>", (*worker)->s->lbset);
2737 (*worker)->s->elected);
2738 ap_rputs(apr_strfsize((*worker)->s->transferred, fbuf), r);
2740 ap_rputs(apr_strfsize((*worker)->s->read, fbuf), r);
2743 /* TODO: Add the rest of dynamic worker data */
2748 i, n, (*worker)->s->name);
2750 i, n, ap_proxy_parse_wstatus(r->pool, *worker));
2753 i, n, (*worker)->s->elected);
2755 i, n, apr_strfsize((*worker)->s->transferred, fbuf));
2757 i, n, apr_strfsize((*worker)->s->read, fbuf));
2758 /* TODO: Add the rest of dynamic worker data */
2761 ++worker;
2804 proxy_worker *worker;
2812 worker = (proxy_worker *)conf->workers->elts;
2813 for (i = 0; i < conf->workers->nelts; i++, worker++) {
2814 ap_proxy_initialize_worker(worker, s, conf->pool);
2816 /* Create and initialize forward worker if defined */
2828 /* Do not disable worker in case of errors */
2830 /* Mark as the "generic" worker */
2833 /* Disable address cache for generic forward worker */
2845 /* Do not disable worker in case of errors */
2847 /* Mark as the "generic" worker */
2851 /* Disable address cache for generic reverse worker */
2933 (request_rec *r, proxy_worker *worker,
2936 apr_port_t proxyport),(r,worker,conf,
2942 proxy_worker **worker,
2946 char **url),(worker,balancer,
2949 (proxy_worker *worker,
2952 proxy_server_conf *conf),(worker,