MCPcopy Create free account
hub / github.com/apache/httpd / set_balancer_param

Function set_balancer_param

modules/proxy/mod_proxy.c:365–530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

363}
364
365static const char *set_balancer_param(proxy_server_conf *conf,
366 apr_pool_t *p,
367 proxy_balancer *balancer,
368 const char *key,
369 const char *val)
370{
371
372 int ival;
373 if (!strcasecmp(key, "stickysession")) {
374 char *path;
375 /* Balancer sticky session name.
376 * Set to something like JSESSIONID or
377 * PHPSESSIONID, etc..,
378 */
379 if (strlen(val) >= sizeof(balancer->s->sticky_path))
380 apr_psprintf(p, "stickysession length must be < %d characters",
381 (int)sizeof(balancer->s->sticky_path));
382 PROXY_STRNCPY(balancer->s->sticky_path, val);
383 PROXY_STRNCPY(balancer->s->sticky, val);
384
385 if ((path = strchr((char *)balancer->s->sticky, '|'))) {
386 *path++ = '\0';
387 PROXY_STRNCPY(balancer->s->sticky_path, path);
388 }
389 }
390 else if (!strcasecmp(key, "stickysessionsep")) {
391 /* separator/delimiter for sessionid and route,
392 * normally '.'
393 */
394 if (strlen(val) != 1) {
395 if (!strcasecmp(val, "off"))
396 balancer->s->sticky_separator = 0;
397 else
398 return "stickysessionsep must be a single character or Off";
399 }
400 else
401 balancer->s->sticky_separator = *val;
402 balancer->s->sticky_separator_set = 1;
403 }
404 else if (!strcasecmp(key, "nofailover")) {
405 /* If set to 'on' the session will break
406 * if the worker is in error state or
407 * disabled.
408 */
409 if (!strcasecmp(val, "on"))
410 balancer->s->sticky_force = 1;
411 else if (!strcasecmp(val, "off"))
412 balancer->s->sticky_force = 0;
413 else
414 return "failover must be On|Off";
415 balancer->s->sticky_force_set = 1;
416 }
417 else if (!strcasecmp(key, "timeout")) {
418 /* Balancer timeout in seconds.
419 * If set this will be the maximum time to
420 * wait for a free worker.
421 * Default is not to wait.
422 */

Callers 3

add_passFunction · 0.85
set_proxy_paramFunction · 0.85
proxysectionFunction · 0.85

Calls 1

ap_lookup_providerFunction · 0.85

Tested by

no test coverage detected