}
/* catch the "failed" case */
- if (i == 4 && !ap_casecmpstr(buf, "NULL")) {
+ if (i == 4 && !strcasecmp(buf, "NULL")) {
return NULL;
}
/* fast tests for variable length variables (sic) first */
if (var[3] == ':') {
- if (var[4] && !ap_casecmpstrn(var, "ENV", 3)) {
+ if (var[4] && !strncasecmp(var, "ENV", 3)) {
var += 4;
result = apr_table_get(r->notes, var);
result = getenv(var);
}
}
- else if (var[4] && !ap_casecmpstrn(var, "SSL", 3) && rewrite_ssl_lookup) {
+ else if (var[4] && !strncasecmp(var, "SSL", 3) && rewrite_ssl_lookup) {
result = rewrite_ssl_lookup(r->pool, r->server, r->connection, r,
var + 4);
}
request_rec *rr;
const char *path;
- if (!ap_casecmpstrn(var, "HTTP", 4)) {
+ if (!strncasecmp(var, "HTTP", 4)) {
result = lookup_header(var+5, ctx);
}
- else if (!ap_casecmpstrn(var, "LA-U", 4)) {
+ else if (!strncasecmp(var, "LA-U", 4)) {
if (ctx->uri && subreq_ok(r)) {
path = ctx->perdir ? la_u(ctx) : ctx->uri;
rr = ap_sub_req_lookup_uri(path, r, NULL);
return (char *)result;
}
}
- else if (!ap_casecmpstrn(var, "LA-F", 4)) {
+ else if (!strncasecmp(var, "LA-F", 4)) {
if (ctx->uri && subreq_ok(r)) {
path = ctx->uri;
if (ctx->perdir && *path == '/') {
switch (*key++) {
case 'b':
case 'B':
- if (!*key || !ap_casecmpstr(key, "ackrefescaping")) {
+ if (!*key || !strcasecmp(key, "ackrefescaping")) {
cfg->flags |= RULEFLAG_ESCAPEBACKREF;
if (val && *val) {
cfg->escapes = val;
}
}
- else if (!ap_casecmpstr(key, "NP") || !ap_casecmpstr(key, "ackrefernoplus")) {
+ else if (!strcasecmp(key, "NP") || !strcasecmp(key, "ackrefernoplus")) {
cfg->flags |= RULEFLAG_ESCAPENOPLUS;
}
else {
break;
case 'c':
case 'C':
- if (!*key || !ap_casecmpstr(key, "hain")) { /* chain */
+ if (!*key || !strcasecmp(key, "hain")) { /* chain */
cfg->flags |= RULEFLAG_CHAIN;
}
else if (((*key == 'O' || *key == 'o') && !key[1])
- || !ap_casecmpstr(key, "ookie")) { /* cookie */
+ || !strcasecmp(key, "ookie")) { /* cookie */
data_item *cp = cfg->cookie;
if (!cp) {
break;
case 'd':
case 'D':
- if (!*key || !ap_casecmpstr(key, "PI") || !ap_casecmpstr(key,"iscardpath")) {
+ if (!*key || !strcasecmp(key, "PI") || !strcasecmp(key,"iscardpath")) {
cfg->flags |= (RULEFLAG_DISCARDPATHINFO);
}
break;
case 'e':
case 'E':
- if (!*key || !ap_casecmpstr(key, "nv")) { /* env */
+ if (!*key || !strcasecmp(key, "nv")) { /* env */
data_item *cp = cfg->env;
if (!cp) {
cp->next = NULL;
cp->data = val;
}
- else if (!ap_casecmpstr(key, "nd")) { /* end */
+ else if (!strcasecmp(key, "nd")) { /* end */
cfg->flags |= RULEFLAG_END;
}
else {
case 'f':
case 'F':
- if (!*key || !ap_casecmpstr(key, "orbidden")) { /* forbidden */
+ if (!*key || !strcasecmp(key, "orbidden")) { /* forbidden */
cfg->flags |= (RULEFLAG_STATUS | RULEFLAG_NOSUB);
cfg->forced_responsecode = HTTP_FORBIDDEN;
}
case 'g':
case 'G':
- if (!*key || !ap_casecmpstr(key, "one")) { /* gone */
+ if (!*key || !strcasecmp(key, "one")) { /* gone */
cfg->flags |= (RULEFLAG_STATUS | RULEFLAG_NOSUB);
cfg->forced_responsecode = HTTP_GONE;
}
case 'h':
case 'H':
- if (!*key || !ap_casecmpstr(key, "andler")) { /* handler */
+ if (!*key || !strcasecmp(key, "andler")) { /* handler */
cfg->forced_handler = val;
}
else {
break;
case 'l':
case 'L':
- if (!*key || !ap_casecmpstr(key, "ast")) { /* last */
+ if (!*key || !strcasecmp(key, "ast")) { /* last */
cfg->flags |= RULEFLAG_LASTRULE;
}
else {
case 'n':
case 'N':
if (((*key == 'E' || *key == 'e') && !key[1])
- || !ap_casecmpstr(key, "oescape")) { /* noescape */
+ || !strcasecmp(key, "oescape")) { /* noescape */
cfg->flags |= RULEFLAG_NOESCAPE;
}
- else if (!*key || !ap_casecmpstr(key, "ext")) { /* next */
+ else if (!*key || !strcasecmp(key, "ext")) { /* next */
cfg->flags |= RULEFLAG_NEWROUND;
if (val && *val) {
cfg->maxrounds = atoi(val);
}
else if (((*key == 'S' || *key == 's') && !key[1])
- || !ap_casecmpstr(key, "osubreq")) { /* nosubreq */
+ || !strcasecmp(key, "osubreq")) { /* nosubreq */
cfg->flags |= RULEFLAG_IGNOREONSUBREQ;
}
else if (((*key == 'C' || *key == 'c') && !key[1])
- || !ap_casecmpstr(key, "ocase")) { /* nocase */
+ || !strcasecmp(key, "ocase")) { /* nocase */
cfg->flags |= RULEFLAG_NOCASE;
}
else {
case 'p':
case 'P':
- if (!*key || !ap_casecmpstr(key, "roxy")) { /* proxy */
+ if (!*key || !strcasecmp(key, "roxy")) { /* proxy */
cfg->flags |= RULEFLAG_PROXY;
}
else if (((*key == 'T' || *key == 't') && !key[1])
- || !ap_casecmpstr(key, "assthrough")) { /* passthrough */
+ || !strcasecmp(key, "assthrough")) { /* passthrough */
cfg->flags |= RULEFLAG_PASSTHROUGH;
}
else {
case 'q':
case 'Q':
- if ( !ap_casecmpstr(key, "SA")
- || !ap_casecmpstr(key, "sappend")) { /* qsappend */
+ if ( !strcasecmp(key, "SA")
+ || !strcasecmp(key, "sappend")) { /* qsappend */
cfg->flags |= RULEFLAG_QSAPPEND;
- } else if ( !ap_casecmpstr(key, "SD")
- || !ap_casecmpstr(key, "sdiscard") ) { /* qsdiscard */
+ } else if ( !strcasecmp(key, "SD")
+ || !strcasecmp(key, "sdiscard") ) { /* qsdiscard */
cfg->flags |= RULEFLAG_QSDISCARD;
}
else {
case 'r':
case 'R':
- if (!*key || !ap_casecmpstr(key, "edirect")) { /* redirect */
+ if (!*key || !strcasecmp(key, "edirect")) { /* redirect */
int status = 0;
cfg->flags |= RULEFLAG_FORCEREDIRECT;
if (*val) {
- if (ap_casecmpstr(val, "permanent") == 0) {
+ if (strcasecmp(val, "permanent") == 0) {
status = HTTP_MOVED_PERMANENTLY;
}
- else if (ap_casecmpstr(val, "temp") == 0) {
+ else if (strcasecmp(val, "temp") == 0) {
status = HTTP_MOVED_TEMPORARILY;
}
- else if (ap_casecmpstr(val, "seeother") == 0) {
+ else if (strcasecmp(val, "seeother") == 0) {
status = HTTP_SEE_OTHER;
}
else if (apr_isdigit(*val)) {
case 's':
case 'S':
- if (!*key || !ap_casecmpstr(key, "kip")) { /* skip */
+ if (!*key || !strcasecmp(key, "kip")) { /* skip */
cfg->skip = atoi(val);
}
else {
case 't':
case 'T':
- if (!*key || !ap_casecmpstr(key, "ype")) { /* type */
+ if (!*key || !strcasecmp(key, "ype")) { /* type */
cfg->forced_mimetype = val;
}
else {
int ival;
apr_interval_time_t timeout;
- if (!ap_casecmpstr(key, "loadfactor")) {
+ if (!strcasecmp(key, "loadfactor")) {
/* Normalized load factor. Used with BalancerMember,
* it is a number between 1 and 100.
*/
return "LoadFactor must be a number between 1..100";
worker->s->lbfactor = ival;
}
- else if (!ap_casecmpstr(key, "retry")) {
+ else if (!strcasecmp(key, "retry")) {
/* If set it will give the retry timeout for the worker
* The default value is 60 seconds, meaning that if
* in error state, it will be retried after that timeout.
worker->s->retry = apr_time_from_sec(ival);
worker->s->retry_set = 1;
}
- else if (!ap_casecmpstr(key, "ttl")) {
+ else if (!strcasecmp(key, "ttl")) {
/* Time in seconds that will destroy all the connections
* that exceed the smax
*/
return "TTL must be at least one second";
worker->s->ttl = apr_time_from_sec(ival);
}
- else if (!ap_casecmpstr(key, "min")) {
+ else if (!strcasecmp(key, "min")) {
/* Initial number of connections to remote
*/
ival = atoi(val);
return "Min must be a positive number";
worker->s->min = ival;
}
- else if (!ap_casecmpstr(key, "max")) {
+ else if (!strcasecmp(key, "max")) {
/* Maximum number of connections to remote
*/
ival = atoi(val);
worker->s->hmax = ival;
}
/* XXX: More inteligent naming needed */
- else if (!ap_casecmpstr(key, "smax")) {
+ else if (!strcasecmp(key, "smax")) {
/* Maximum number of connections to remote that
* will not be destroyed
*/
return "Smax must be a positive number";
worker->s->smax = ival;
}
- else if (!ap_casecmpstr(key, "acquire")) {
+ else if (!strcasecmp(key, "acquire")) {
/* Acquire timeout in given unit (default is milliseconds).
* If set this will be the maximum time to
* wait for a free connection.
worker->s->acquire = timeout;
worker->s->acquire_set = 1;
}
- else if (!ap_casecmpstr(key, "timeout")) {
+ else if (!strcasecmp(key, "timeout")) {
/* Connection timeout in seconds.
* Defaults to server timeout.
*/
worker->s->timeout = apr_time_from_sec(ival);
worker->s->timeout_set = 1;
}
- else if (!ap_casecmpstr(key, "iobuffersize")) {
+ else if (!strcasecmp(key, "iobuffersize")) {
long s = atol(val);
if (s < 512 && s) {
return "IOBufferSize must be >= 512 bytes, or 0 for system default.";
worker->s->io_buffer_size = (s ? s : AP_IOBUFSIZE);
worker->s->io_buffer_size_set = 1;
}
- else if (!ap_casecmpstr(key, "receivebuffersize")) {
+ else if (!strcasecmp(key, "receivebuffersize")) {
ival = atoi(val);
if (ival < 512 && ival != 0) {
return "ReceiveBufferSize must be >= 512 bytes, or 0 for system default.";
worker->s->recv_buffer_size = ival;
worker->s->recv_buffer_size_set = 1;
}
- else if (!ap_casecmpstr(key, "keepalive")) {
- if (!ap_casecmpstr(val, "on"))
+ else if (!strcasecmp(key, "keepalive")) {
+ if (!strcasecmp(val, "on"))
worker->s->keepalive = 1;
- else if (!ap_casecmpstr(val, "off"))
+ else if (!strcasecmp(val, "off"))
worker->s->keepalive = 0;
else
return "KeepAlive must be On|Off";
worker->s->keepalive_set = 1;
}
- else if (!ap_casecmpstr(key, "disablereuse")) {
- if (!ap_casecmpstr(val, "on"))
+ else if (!strcasecmp(key, "disablereuse")) {
+ if (!strcasecmp(val, "on"))
worker->s->disablereuse = 1;
- else if (!ap_casecmpstr(val, "off"))
+ else if (!strcasecmp(val, "off"))
worker->s->disablereuse = 0;
else
return "DisableReuse must be On|Off";
worker->s->disablereuse_set = 1;
}
- else if (!ap_casecmpstr(key, "enablereuse")) {
- if (!ap_casecmpstr(val, "on"))
+ else if (!strcasecmp(key, "enablereuse")) {
+ if (!strcasecmp(val, "on"))
worker->s->disablereuse = 0;
- else if (!ap_casecmpstr(val, "off"))
+ else if (!strcasecmp(val, "off"))
worker->s->disablereuse = 1;
else
return "EnableReuse must be On|Off";
worker->s->disablereuse_set = 1;
}
- else if (!ap_casecmpstr(key, "route")) {
+ else if (!strcasecmp(key, "route")) {
/* Worker route.
*/
if (strlen(val) >= sizeof(worker->s->route))
(int)sizeof(worker->s->route));
PROXY_STRNCPY(worker->s->route, val);
}
- else if (!ap_casecmpstr(key, "redirect")) {
+ else if (!strcasecmp(key, "redirect")) {
/* Worker redirection route.
*/
if (strlen(val) >= sizeof(worker->s->redirect))
(int)sizeof(worker->s->redirect));
PROXY_STRNCPY(worker->s->redirect, val);
}
- else if (!ap_casecmpstr(key, "status")) {
+ else if (!strcasecmp(key, "status")) {
const char *v;
int mode = 1;
apr_status_t rv;
return "Unknown status parameter option";
}
}
- else if (!ap_casecmpstr(key, "flushpackets")) {
- if (!ap_casecmpstr(val, "on"))
+ else if (!strcasecmp(key, "flushpackets")) {
+ if (!strcasecmp(val, "on"))
worker->s->flush_packets = flush_on;
- else if (!ap_casecmpstr(val, "off"))
+ else if (!strcasecmp(val, "off"))
worker->s->flush_packets = flush_off;
- else if (!ap_casecmpstr(val, "auto"))
+ else if (!strcasecmp(val, "auto"))
worker->s->flush_packets = flush_auto;
else
return "flushpackets must be on|off|auto";
}
- else if (!ap_casecmpstr(key, "flushwait")) {
+ else if (!strcasecmp(key, "flushwait")) {
ival = atoi(val);
if (ival > 1000 || ival < 0) {
return "flushwait must be <= 1000, or 0 for system default of 10 millseconds.";
else
worker->s->flush_wait = ival * 1000; /* change to microseconds */
}
- else if (!ap_casecmpstr(key, "ping")) {
+ else if (!strcasecmp(key, "ping")) {
/* Ping/Pong timeout in given unit (default is second).
*/
if (ap_timeout_parameter_parse(val, &timeout, "s") != APR_SUCCESS)
worker->s->ping_timeout = timeout;
worker->s->ping_timeout_set = 1;
}
- else if (!ap_casecmpstr(key, "lbset")) {
+ else if (!strcasecmp(key, "lbset")) {
ival = atoi(val);
if (ival < 0 || ival > 99)
return "lbset must be between 0 and 99";
worker->s->lbset = ival;
}
- else if (!ap_casecmpstr(key, "connectiontimeout")) {
+ else if (!strcasecmp(key, "connectiontimeout")) {
/* Request timeout in given unit (default is second).
* Defaults to connection timeout
*/
worker->s->conn_timeout = timeout;
worker->s->conn_timeout_set = 1;
}
- else if (!ap_casecmpstr(key, "flusher")) {
+ else if (!strcasecmp(key, "flusher")) {
if (strlen(val) >= sizeof(worker->s->flusher))
apr_psprintf(p, "flusher name length must be < %d characters",
(int)sizeof(worker->s->flusher));
{
int ival;
- if (!ap_casecmpstr(key, "stickysession")) {
+ if (!strcasecmp(key, "stickysession")) {
char *path;
/* Balancer sticky session name.
* Set to something like JSESSIONID or
PROXY_STRNCPY(balancer->s->sticky_path, path);
}
}
- else if (!ap_casecmpstr(key, "stickysessionsep")) {
+ else if (!strcasecmp(key, "stickysessionsep")) {
/* separator/delimiter for sessionid and route,
* normally '.'
*/
if (strlen(val) != 1) {
- if (!ap_casecmpstr(val, "off"))
+ if (!strcasecmp(val, "off"))
balancer->s->sticky_separator = 0;
else
return "stickysessionsep must be a single character or Off";
balancer->s->sticky_separator = *val;
balancer->s->sticky_separator_set = 1;
}
- else if (!ap_casecmpstr(key, "nofailover")) {
+ else if (!strcasecmp(key, "nofailover")) {
/* If set to 'on' the session will break
* if the worker is in error state or
* disabled.
*/
- if (!ap_casecmpstr(val, "on"))
+ if (!strcasecmp(val, "on"))
balancer->s->sticky_force = 1;
- else if (!ap_casecmpstr(val, "off"))
+ else if (!strcasecmp(val, "off"))
balancer->s->sticky_force = 0;
else
return "failover must be On|Off";
balancer->s->sticky_force_set = 1;
}
- else if (!ap_casecmpstr(key, "timeout")) {
+ else if (!strcasecmp(key, "timeout")) {
/* Balancer timeout in seconds.
* If set this will be the maximum time to
* wait for a free worker.
return "timeout must be at least one second";
balancer->s->timeout = apr_time_from_sec(ival);
}
- else if (!ap_casecmpstr(key, "maxattempts")) {
+ else if (!strcasecmp(key, "maxattempts")) {
/* Maximum number of failover attempts before
* giving up.
*/
balancer->s->max_attempts = ival;
balancer->s->max_attempts_set = 1;
}
- else if (!ap_casecmpstr(key, "lbmethod")) {
+ else if (!strcasecmp(key, "lbmethod")) {
proxy_balancer_method *provider;
if (strlen(val) > (sizeof(balancer->s->lbpname)-1))
return "unknown lbmethod";
}
return "unknown lbmethod";
}
- else if (!ap_casecmpstr(key, "scolonpathdelim")) {
+ else if (!strcasecmp(key, "scolonpathdelim")) {
/* If set to 'on' then ';' will also be
* used as a session path separator/delim (ala
* mod_jk)
*/
- if (!ap_casecmpstr(val, "on"))
+ if (!strcasecmp(val, "on"))
balancer->s->scolonsep = 1;
- else if (!ap_casecmpstr(val, "off"))
+ else if (!strcasecmp(val, "off"))
balancer->s->scolonsep = 0;
else
return "scolonpathdelim must be On|Off";
balancer->s->scolonsep_set = 1;
}
- else if (!ap_casecmpstr(key, "failonstatus")) {
+ else if (!strcasecmp(key, "failonstatus")) {
char *val_split;
char *status;
char *tok_state;
}
}
- else if (!ap_casecmpstr(key, "failontimeout")) {
- if (!ap_casecmpstr(val, "on"))
+ else if (!strcasecmp(key, "failontimeout")) {
+ if (!strcasecmp(val, "on"))
balancer->failontimeout = 1;
- else if (!ap_casecmpstr(val, "off"))
+ else if (!strcasecmp(val, "off"))
balancer->failontimeout = 0;
else
return "failontimeout must be On|Off";
balancer->failontimeout_set = 1;
}
- else if (!ap_casecmpstr(key, "nonce")) {
- if (!ap_casecmpstr(val, "None")) {
+ else if (!strcasecmp(key, "nonce")) {
+ if (!strcasecmp(val, "None")) {
*balancer->s->nonce = '\0';
}
else {
}
balancer->s->nonce_set = 1;
}
- else if (!ap_casecmpstr(key, "growth")) {
+ else if (!strcasecmp(key, "growth")) {
ival = atoi(val);
if (ival < 1 || ival > 100) /* arbitrary limit here */
return "growth must be between 1 and 100";
balancer->growth = ival;
balancer->growth_set = 1;
}
- else if (!ap_casecmpstr(key, "forcerecovery")) {
- if (!ap_casecmpstr(val, "on"))
+ else if (!strcasecmp(key, "forcerecovery")) {
+ if (!strcasecmp(val, "on"))
balancer->s->forcerecovery = 1;
- else if (!ap_casecmpstr(val, "off"))
+ else if (!strcasecmp(val, "off"))
balancer->s->forcerecovery = 0;
else
return "forcerecovery must be On|Off";