From: Yann Ylavic Date: Tue, 29 Dec 2015 15:32:27 +0000 (+0000) Subject: Follow up to r1715880: revert more abusive ap_casecmpstr[n]() usages. X-Git-Tag: 2.5.0-alpha~2489 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4bfe0a6bba57b8f44aaea3d0ea32d12fd3da761a;p=apache Follow up to r1715880: revert more abusive ap_casecmpstr[n]() usages. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1722150 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/filters/mod_include.c b/modules/filters/mod_include.c index df5231c3b0..9c84806f0e 100644 --- a/modules/filters/mod_include.c +++ b/modules/filters/mod_include.c @@ -620,16 +620,16 @@ static void add_include_vars(request_rec *r) static const char *add_include_vars_lazy(request_rec *r, const char *var, const char *timefmt) { char *val; - if (!ap_casecmpstr(var, "DATE_LOCAL")) { + if (!strcasecmp(var, "DATE_LOCAL")) { val = ap_ht_time(r->pool, r->request_time, timefmt, 0); } - else if (!ap_casecmpstr(var, "DATE_GMT")) { + else if (!strcasecmp(var, "DATE_GMT")) { val = ap_ht_time(r->pool, r->request_time, timefmt, 1); } - else if (!ap_casecmpstr(var, "LAST_MODIFIED")) { + else if (!strcasecmp(var, "LAST_MODIFIED")) { val = ap_ht_time(r->pool, r->finfo.mtime, timefmt, 0); } - else if (!ap_casecmpstr(var, "USER_NAME")) { + else if (!strcasecmp(var, "USER_NAME")) { if (apr_uid_name_get(&val, r->finfo.user, r->pool) != APR_SUCCESS) { val = ""; } @@ -714,9 +714,9 @@ static int include_expr_lookup(ap_expr_lookup_parms *parms) { switch (parms->type) { case AP_EXPR_FUNC_STRING: - if (ap_casecmpstr(parms->name, "v") == 0 || - ap_casecmpstr(parms->name, "reqenv") == 0 || - ap_casecmpstr(parms->name, "env") == 0) { + if (strcasecmp(parms->name, "v") == 0 || + strcasecmp(parms->name, "reqenv") == 0 || + strcasecmp(parms->name, "env") == 0) { *parms->func = include_expr_var_fn; *parms->data = parms->name; return OK; diff --git a/modules/generators/mod_cgi.c b/modules/generators/mod_cgi.c index 1e398aad6f..7c70119c94 100644 --- a/modules/generators/mod_cgi.c +++ b/modules/generators/mod_cgi.c @@ -78,7 +78,7 @@ static void discard_script_output(apr_bucket_brigade *bb); static int is_scriptaliased(request_rec *r) { const char *t = apr_table_get(r->notes, "alias-forced-type"); - return t && (!ap_casecmpstr(t, "cgi-script")); + return t && (!strcasecmp(t, "cgi-script")); } /* Configuration stuff */ diff --git a/modules/generators/mod_cgid.c b/modules/generators/mod_cgid.c index 7b29b2e0da..4cebd04571 100644 --- a/modules/generators/mod_cgid.c +++ b/modules/generators/mod_cgid.c @@ -131,7 +131,7 @@ static ap_unix_identity_t *cgid_suexec_id_doer(const request_rec *r) static int is_scriptaliased(request_rec *r) { const char *t = apr_table_get(r->notes, "alias-forced-type"); - return t && (!ap_casecmpstr(t, "cgi-script")); + return t && (!strcasecmp(t, "cgi-script")); } /* Configuration stuff */ diff --git a/modules/loggers/mod_log_config.c b/modules/loggers/mod_log_config.c index f518a2b5dc..e961c93005 100644 --- a/modules/loggers/mod_log_config.c +++ b/modules/loggers/mod_log_config.c @@ -808,13 +808,13 @@ static const char *log_request_duration_microseconds(request_rec *r, char *a) static const char *log_request_duration_scaled(request_rec *r, char *a) { apr_time_t duration = get_request_end_time(r) - r->request_time; - if (*a == '\0' || !ap_casecmpstr(a, "s")) { + if (*a == '\0' || !strcasecmp(a, "s")) { duration = apr_time_sec(duration); } - else if (!ap_casecmpstr(a, "ms")) { + else if (!strcasecmp(a, "ms")) { duration = apr_time_as_msec(duration); } - else if (!ap_casecmpstr(a, "us")) { + else if (!strcasecmp(a, "us")) { } else { /* bogus format */ @@ -835,13 +835,13 @@ static const char *log_server_port(request_rec *r, char *a) { apr_port_t port; - if (*a == '\0' || !ap_casecmpstr(a, "canonical")) { + if (*a == '\0' || !strcasecmp(a, "canonical")) { port = r->server->port ? r->server->port : ap_default_port(r); } - else if (!ap_casecmpstr(a, "remote")) { + else if (!strcasecmp(a, "remote")) { port = r->useragent_addr->port; } - else if (!ap_casecmpstr(a, "local")) { + else if (!strcasecmp(a, "local")) { port = r->connection->local_addr->port; } else { @@ -861,10 +861,10 @@ static const char *log_server_name(request_rec *r, char *a) static const char *log_pid_tid(request_rec *r, char *a) { - if (*a == '\0' || !ap_casecmpstr(a, "pid")) { + if (*a == '\0' || !strcasecmp(a, "pid")) { return ap_append_pid(r->pool, "", ""); } - else if (!ap_casecmpstr(a, "tid") || !ap_casecmpstr(a, "hextid")) { + else if (!strcasecmp(a, "tid") || !strcasecmp(a, "hextid")) { #if APR_HAS_THREADS apr_os_thread_t tid = apr_os_thread_current(); #else @@ -1335,14 +1335,14 @@ static const char *add_custom_log(cmd_parms *cmd, void *dummy, const char *fn, cls->condition_var = NULL; cls->condition_expr = NULL; if (envclause != NULL) { - if (ap_casecmpstrn(envclause, "env=", 4) == 0) { + if (strncasecmp(envclause, "env=", 4) == 0) { if ((envclause[4] == '\0') || ((envclause[4] == '!') && (envclause[5] == '\0'))) { return "missing environment variable name"; } cls->condition_var = apr_pstrdup(cmd->pool, &envclause[4]); } - else if (ap_casecmpstrn(envclause, "expr=", 5) == 0) { + else if (strncasecmp(envclause, "expr=", 5) == 0) { const char *err; if ((envclause[5] == '\0')) return "missing condition"; diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index 4841ccca19..d795c19a06 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -1576,7 +1576,7 @@ static char *lookup_map_program(request_rec *r, apr_file_t *fpin, } /* catch the "failed" case */ - if (i == 4 && !ap_casecmpstr(buf, "NULL")) { + if (i == 4 && !strcasecmp(buf, "NULL")) { return NULL; } @@ -1829,7 +1829,7 @@ static char *lookup_variable(char *var, rewrite_ctx *ctx) /* 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); @@ -1840,7 +1840,7 @@ static char *lookup_variable(char *var, rewrite_ctx *ctx) 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); } @@ -1850,10 +1850,10 @@ static char *lookup_variable(char *var, rewrite_ctx *ctx) 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); @@ -1868,7 +1868,7 @@ static char *lookup_variable(char *var, rewrite_ctx *ctx) 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 == '/') { @@ -3477,13 +3477,13 @@ static const char *cmd_rewriterule_setflag(apr_pool_t *p, void *_cfg, 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 { @@ -3492,11 +3492,11 @@ static const char *cmd_rewriterule_setflag(apr_pool_t *p, void *_cfg, 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) { @@ -3519,13 +3519,13 @@ static const char *cmd_rewriterule_setflag(apr_pool_t *p, void *_cfg, 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) { @@ -3542,7 +3542,7 @@ static const char *cmd_rewriterule_setflag(apr_pool_t *p, void *_cfg, cp->next = NULL; cp->data = val; } - else if (!ap_casecmpstr(key, "nd")) { /* end */ + else if (!strcasecmp(key, "nd")) { /* end */ cfg->flags |= RULEFLAG_END; } else { @@ -3552,7 +3552,7 @@ static const char *cmd_rewriterule_setflag(apr_pool_t *p, void *_cfg, 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; } @@ -3563,7 +3563,7 @@ static const char *cmd_rewriterule_setflag(apr_pool_t *p, void *_cfg, 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; } @@ -3574,7 +3574,7 @@ static const char *cmd_rewriterule_setflag(apr_pool_t *p, void *_cfg, case 'h': case 'H': - if (!*key || !ap_casecmpstr(key, "andler")) { /* handler */ + if (!*key || !strcasecmp(key, "andler")) { /* handler */ cfg->forced_handler = val; } else { @@ -3583,7 +3583,7 @@ static const char *cmd_rewriterule_setflag(apr_pool_t *p, void *_cfg, break; case 'l': case 'L': - if (!*key || !ap_casecmpstr(key, "ast")) { /* last */ + if (!*key || !strcasecmp(key, "ast")) { /* last */ cfg->flags |= RULEFLAG_LASTRULE; } else { @@ -3594,10 +3594,10 @@ static const char *cmd_rewriterule_setflag(apr_pool_t *p, void *_cfg, 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); @@ -3605,11 +3605,11 @@ static const char *cmd_rewriterule_setflag(apr_pool_t *p, void *_cfg, } 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 { @@ -3619,11 +3619,11 @@ static const char *cmd_rewriterule_setflag(apr_pool_t *p, void *_cfg, 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 { @@ -3633,11 +3633,11 @@ static const char *cmd_rewriterule_setflag(apr_pool_t *p, void *_cfg, 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 { @@ -3647,18 +3647,18 @@ static const char *cmd_rewriterule_setflag(apr_pool_t *p, void *_cfg, 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)) { @@ -3688,7 +3688,7 @@ static const char *cmd_rewriterule_setflag(apr_pool_t *p, void *_cfg, case 's': case 'S': - if (!*key || !ap_casecmpstr(key, "kip")) { /* skip */ + if (!*key || !strcasecmp(key, "kip")) { /* skip */ cfg->skip = atoi(val); } else { @@ -3698,7 +3698,7 @@ static const char *cmd_rewriterule_setflag(apr_pool_t *p, void *_cfg, case 't': case 'T': - if (!*key || !ap_casecmpstr(key, "ype")) { /* type */ + if (!*key || !strcasecmp(key, "ype")) { /* type */ cfg->forced_mimetype = val; } else { diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index 41ebd4dc99..3509cbdf7a 100644 --- a/modules/proxy/mod_proxy.c +++ b/modules/proxy/mod_proxy.c @@ -64,7 +64,7 @@ static const char *set_worker_param(apr_pool_t *p, 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. */ @@ -73,7 +73,7 @@ static const char *set_worker_param(apr_pool_t *p, 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. @@ -84,7 +84,7 @@ static const char *set_worker_param(apr_pool_t *p, 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 */ @@ -93,7 +93,7 @@ static const char *set_worker_param(apr_pool_t *p, 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); @@ -101,7 +101,7 @@ static const char *set_worker_param(apr_pool_t *p, 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); @@ -110,7 +110,7 @@ static const char *set_worker_param(apr_pool_t *p, 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 */ @@ -119,7 +119,7 @@ static const char *set_worker_param(apr_pool_t *p, 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. @@ -131,7 +131,7 @@ static const char *set_worker_param(apr_pool_t *p, 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. */ @@ -141,7 +141,7 @@ static const char *set_worker_param(apr_pool_t *p, 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."; @@ -149,7 +149,7 @@ static const char *set_worker_param(apr_pool_t *p, 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."; @@ -157,34 +157,34 @@ static const char *set_worker_param(apr_pool_t *p, 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)) @@ -192,7 +192,7 @@ static const char *set_worker_param(apr_pool_t *p, (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)) @@ -200,7 +200,7 @@ static const char *set_worker_param(apr_pool_t *p, (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; @@ -220,17 +220,17 @@ static const char *set_worker_param(apr_pool_t *p, 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."; @@ -240,7 +240,7 @@ static const char *set_worker_param(apr_pool_t *p, 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) @@ -250,13 +250,13 @@ static const char *set_worker_param(apr_pool_t *p, 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 */ @@ -267,7 +267,7 @@ static const char *set_worker_param(apr_pool_t *p, 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)); @@ -287,7 +287,7 @@ static const char *set_balancer_param(proxy_server_conf *conf, { int ival; - if (!ap_casecmpstr(key, "stickysession")) { + if (!strcasecmp(key, "stickysession")) { char *path; /* Balancer sticky session name. * Set to something like JSESSIONID or @@ -304,12 +304,12 @@ static const char *set_balancer_param(proxy_server_conf *conf, 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"; @@ -318,20 +318,20 @@ static const char *set_balancer_param(proxy_server_conf *conf, 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. @@ -342,7 +342,7 @@ static const char *set_balancer_param(proxy_server_conf *conf, 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. */ @@ -352,7 +352,7 @@ static const char *set_balancer_param(proxy_server_conf *conf, 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"; @@ -369,20 +369,20 @@ static const char *set_balancer_param(proxy_server_conf *conf, } 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; @@ -404,17 +404,17 @@ static const char *set_balancer_param(proxy_server_conf *conf, } } - 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 { @@ -424,17 +424,17 @@ static const char *set_balancer_param(proxy_server_conf *conf, } 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"; diff --git a/modules/slotmem/mod_slotmem_shm.c b/modules/slotmem/mod_slotmem_shm.c index 27a0732f5e..4f0eeeaeb9 100644 --- a/modules/slotmem/mod_slotmem_shm.c +++ b/modules/slotmem/mod_slotmem_shm.c @@ -111,7 +111,7 @@ static int slotmem_filenames(apr_pool_t *pool, { const char *fname = NULL, *pname = NULL; - if (slotname && *slotname && ap_casecmpstr(slotname, "none") != 0) { + if (slotname && *slotname && strcasecmp(slotname, "none") != 0) { if (slotname[0] != '/') { #if !SLOTMEM_UNLINK_SEMANTIC /* Each generation needs its own file name. */ diff --git a/server/util_expr_eval.c b/server/util_expr_eval.c index ee38ddf2cf..3479c9a57d 100644 --- a/server/util_expr_eval.c +++ b/server/util_expr_eval.c @@ -1710,13 +1710,13 @@ static int op_T(ap_expr_eval_ctx_t *ctx, const void *data, const char *arg) return FALSE; case 'o': case 'O': - return ap_casecmpstr(arg, "off") == 0 ? FALSE : TRUE; + return strcasecmp(arg, "off") == 0 ? FALSE : TRUE; case 'n': case 'N': - return ap_casecmpstr(arg, "no") == 0 ? FALSE : TRUE; + return strcasecmp(arg, "no") == 0 ? FALSE : TRUE; case 'f': case 'F': - return ap_casecmpstr(arg, "false") == 0 ? FALSE : TRUE; + return strcasecmp(arg, "false") == 0 ? FALSE : TRUE; case '0': return arg[1] == '\0' ? FALSE : TRUE; default: