Created
January 22, 2014 18:07
-
-
Save jerrinot/8564004 to your computer and use it in GitHub Desktop.
mod_proxy_balancer.c snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ((*route) && ((*route = strchr(*route, '.')) != NULL )) | |
(*route)++; | |
if ((*route) && (**route)) { | |
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, | |
"proxy: BALANCER: Found route %s", *route); | |
/* We have a route in path or in cookie | |
* Find the worker that has this route defined. | |
*/ | |
worker = find_route_worker(balancer, *route, r); | |
if (worker && strcmp(*route, worker->s->route)) { | |
/* | |
* Notice that the route of the worker chosen is different from | |
* the route supplied by the client. | |
*/ | |
apr_table_setn(r->subprocess_env, "BALANCER_ROUTE_CHANGED", "1"); | |
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, | |
"proxy: BALANCER: Route changed from %s to %s", | |
*route, worker->s->route); | |
} | |
return worker; | |
} | |
else | |
return NULL; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment