static int hook_note_basic_auth_failure(request_rec *r, const char *auth_type)
{
- if (strcasecmp(auth_type, "Basic"))
+ if (ap_casecmpstr(auth_type, "Basic"))
return DECLINED;
note_basic_auth_failure(r);
return HTTP_UNAUTHORIZED;
}
- if (strcasecmp(ap_getword(r->pool, &auth_line, ' '), "Basic")) {
+ if (ap_casecmpstr(ap_getword(r->pool, &auth_line, ' '), "Basic")) {
/* Client tried to authenticate using wrong auth scheme */
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01614)
"client used wrong authentication scheme: %s", r->uri);
/* Are we configured to be Basic auth? */
current_auth = ap_auth_type(r);
- if (!current_auth || strcasecmp(current_auth, "Basic")) {
+ if (!current_auth || ap_casecmpstr(current_auth, "Basic")) {
return DECLINED;
}
}
if (conf->use_digest_algorithm
- && !strcasecmp(conf->use_digest_algorithm, "MD5")) {
+ && !ap_casecmpstr(conf->use_digest_algorithm, "MD5")) {
realm = ap_auth_name(r);
digest = ap_md5(r->pool,
(unsigned char *)apr_pstrcat(r->pool, sent_user, ":",
if (!strcasecmp(op, "auth-int")) {
return "AuthDigestQop auth-int is not implemented";
}
- else if (strcasecmp(op, "auth")) {
+ else if (ap_casecmpstr(op, "auth")) {
return apr_pstrcat(cmd->pool, "Unrecognized qop: ", op, NULL);
}
return "AuthDigestAlgorithm: ERROR: algorithm `MD5-sess' "
"is not implemented";
}
- else if (strcasecmp(alg, "MD5")) {
+ else if (ap_casecmpstr(alg, "MD5")) {
return apr_pstrcat(cmd->pool, "Invalid algorithm in AuthDigestAlgorithm: ", alg, NULL);
}
}
resp->scheme = ap_getword_white(r->pool, &auth_line);
- if (strcasecmp(resp->scheme, "Digest")) {
+ if (ap_casecmpstr(resp->scheme, "Digest")) {
resp->auth_hdr_sts = NOT_DIGEST;
return !OK;
}
auth_line++;
}
- if (!strcasecmp(key, "username"))
+ if (!ap_casecmpstr(key, "username"))
resp->username = apr_pstrdup(r->pool, value);
- else if (!strcasecmp(key, "realm"))
+ else if (!ap_casecmpstr(key, "realm"))
resp->realm = apr_pstrdup(r->pool, value);
- else if (!strcasecmp(key, "nonce"))
+ else if (!ap_casecmpstr(key, "nonce"))
resp->nonce = apr_pstrdup(r->pool, value);
- else if (!strcasecmp(key, "uri"))
+ else if (!ap_casecmpstr(key, "uri"))
resp->uri = apr_pstrdup(r->pool, value);
- else if (!strcasecmp(key, "response"))
+ else if (!ap_casecmpstr(key, "response"))
resp->digest = apr_pstrdup(r->pool, value);
- else if (!strcasecmp(key, "algorithm"))
+ else if (!ap_casecmpstr(key, "algorithm"))
resp->algorithm = apr_pstrdup(r->pool, value);
- else if (!strcasecmp(key, "cnonce"))
+ else if (!ap_casecmpstr(key, "cnonce"))
resp->cnonce = apr_pstrdup(r->pool, value);
- else if (!strcasecmp(key, "opaque"))
+ else if (!ap_casecmpstr(key, "opaque"))
resp->opaque = apr_pstrdup(r->pool, value);
- else if (!strcasecmp(key, "qop"))
+ else if (!ap_casecmpstr(key, "qop"))
resp->message_qop = apr_pstrdup(r->pool, value);
- else if (!strcasecmp(key, "nc"))
+ else if (!ap_casecmpstr(key, "nc"))
resp->nonce_count = apr_pstrdup(r->pool, value);
}
if (apr_is_empty_array(conf->qop_list)) {
qop = ", qop=\"auth\"";
}
- else if (!strcasecmp(*(const char **)(conf->qop_list->elts), "none")) {
+ else if (!ap_casecmpstr(*(const char **)(conf->qop_list->elts), "none")) {
qop = "";
}
else {
digest_header_rec *resp;
digest_config_rec *conf;
- if (strcasecmp(auth_type, "Digest"))
+ if (ap_casecmpstr(auth_type, "Digest"))
return DECLINED;
/* get the client response and mark */
}
if (!apr_is_empty_array(conf->qop_list) &&
- !strcasecmp(*(const char **)(conf->qop_list->elts), "none")) {
+ !ap_casecmpstr(*(const char **)(conf->qop_list->elts), "none")) {
/* qop is none, client must not send a nonce count */
if (snc != NULL) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01772)
/* do we require Digest auth for this URI? */
- if (!(t = ap_auth_type(r)) || strcasecmp(t, "Digest")) {
+ if (!(t = ap_auth_type(r)) || ap_casecmpstr(t, "Digest")) {
return DECLINED;
}
}
if (resp->algorithm != NULL
- && strcasecmp(resp->algorithm, "MD5")) {
+ && ap_casecmpstr(resp->algorithm, "MD5")) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01789)
"unknown algorithm `%s' received: %s",
resp->algorithm, r->uri);
int match = 0, idx;
const char **tmp = (const char **)(conf->qop_list->elts);
for (idx = 0; idx < conf->qop_list->nelts; idx++) {
- if (!strcasecmp(*tmp, resp->message_qop)) {
+ if (!ap_casecmpstr(*tmp, resp->message_qop)) {
match = 1;
break;
}
if (!match
&& !(apr_is_empty_array(conf->qop_list)
- && !strcasecmp(resp->message_qop, "auth"))) {
+ && !ap_casecmpstr(resp->message_qop, "auth"))) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01793)
"invalid qop `%s' received: %s",
resp->message_qop, r->uri);
/* do rfc-2069 digest
*/
if (!apr_is_empty_array(conf->qop_list) &&
- !strcasecmp(*(const char **)(conf->qop_list->elts), "none")
+ !ap_casecmpstr(*(const char **)(conf->qop_list->elts), "none")
&& resp->message_qop == NULL) {
/* use only RFC-2069 format */
ai = nextnonce;
static int hook_note_cookie_auth_failure(request_rec * r,
const char *auth_type)
{
- if (strcasecmp(auth_type, "form"))
+ if (ap_casecmpstr(auth_type, "form"))
return DECLINED;
note_cookie_auth_failure(r);
/* Are we configured to be Form auth? */
current_auth = ap_auth_type(r);
- if (!current_auth || strcasecmp(current_auth, "form")) {
+ if (!current_auth || ap_casecmpstr(current_auth, "form")) {
return DECLINED;
}
return NULL;
}
- return strcasecmp(type, "None") ? type : NULL;
+ return ap_casecmpstr(type, "None") ? type : NULL;
}
return NULL;
/* When the application gives a 200 response, the server ignores response
headers whose names aren't prefixed with Variable- prefix, and ignores
any response content */
- if (strncasecmp(key, "Variable-", 9) == 0)
+ if (ap_casecmpstrn(key, "Variable-", 9) == 0)
apr_table_setn(vars, key, val);
return 1;
}
prov = dconf && dconf->name ? dconf->name : NULL;
- if (!prov || !strcasecmp(prov, "None")) {
+ if (!prov || !ap_casecmpstr(prov, "None")) {
return DECLINED;
}
dconf->user_expr ? "yes" : "no",
auth_type);
- if (auth_type && !strcasecmp(auth_type, "Basic")) {
+ if (auth_type && !ap_casecmpstr(auth_type, "Basic")) {
if ((res = ap_get_basic_auth_pw(r, &password))) {
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
APLOGNO(02517) "%s: couldn't retrieve basic auth "
static int expr_lookup_fn(ap_expr_lookup_parms *parms)
{
if (parms->type == AP_EXPR_FUNC_VAR
- && strcasecmp(parms->name, "REMOTE_USER") == 0) {
+ && ap_casecmpstr(parms->name, "REMOTE_USER") == 0) {
struct require_expr_info *info;
apr_pool_userdata_get((void**)&info, REQUIRE_EXPR_NOTE, parms->ptemp);
AP_DEBUG_ASSERT(info != NULL);
static int filter_header_do(void *v, const char *key, const char *val)
{
- if ((*key == 'W' || *key == 'w') && !strcasecmp(key, "Warning")
+ if ((*key == 'W' || *key == 'w') && !ap_casecmpstr(key, "Warning")
&& *val == '1') {
/* any stored Warning headers with warn-code 1xx (see section
* 14.46) MUST be deleted from the cache entry and the forwarded
}
static int remove_header_do(void *v, const char *key, const char *val)
{
- if ((*key == 'W' || *key == 'w') && !strcasecmp(key, "Warning")) {
+ if ((*key == 'W' || *key == 'w') && !ap_casecmpstr(key, "Warning")) {
/* any stored Warning headers with warn-code 2xx MUST be retained
* in the cache entry and the forwarded response.
*/
}
else {
/* The URI scheme must be present and identical except for case. */
- if (!url->scheme || strcasecmp(filter->scheme, url->scheme)) {
+ if (!url->scheme || ap_casecmpstr(filter->scheme, url->scheme)) {
return 0;
}
return def_depth;
}
- if (strcasecmp(depth, "infinity") == 0) {
+ if (ap_casecmpstr(depth, "infinity") == 0) {
return DAV_INFINITY;
}
else if (strcmp(depth, "0") == 0) {
return 0;
range = apr_pstrdup(r->pool, range_c);
- if (strncasecmp(range, "bytes ", 6) != 0
+ if (ap_casecmpstrn(range, "bytes ", 6) != 0
|| (dash = ap_strchr(range, '-')) == NULL
|| (slash = ap_strchr(range, '/')) == NULL) {
/* malformed header */
r->remaining = 0;
if (tenc) {
- if (strcasecmp(tenc, "chunked")) {
+ if (ap_casecmpstr(tenc, "chunked")) {
/* Use this instead of Apache's default error string */
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00589)
"Unknown Transfer-Encoding %s", tenc);
if (!res_hooks->get_resource_type(resource, &name, &uri) &&
name) {
- if (!uri || !strcasecmp(uri, "DAV:"))
+ if (!uri || !ap_casecmpstr(uri, "DAV:"))
value = apr_pstrcat(p, value ? value : "",
"<D:", name, "/>", NULL);
else
request. the port must match our port.
*/
port = r->connection->local_addr->port;
- if (strcasecmp(comp.scheme, scheme) != 0
+ if (ap_casecmpstr(comp.scheme, scheme) != 0
#ifdef APACHE_PORT_HANDLING_IS_BUSTED
|| comp.port != port
#endif
if (!ctx->noop && ctx->xlate == NULL) {
const char *mime_type = f->r->content_type;
- if (mime_type && (strncasecmp(mime_type, "text/", 5) == 0 ||
+ if (mime_type && (ap_casecmpstrn(mime_type, "text/", 5) == 0 ||
#if APR_CHARSET_EBCDIC
/* On an EBCDIC machine, be willing to translate mod_autoindex-
* generated output. Otherwise, it doesn't look too cool.
*/
strcmp(mime_type, DIR_MAGIC_TYPE) == 0 ||
#endif
- strncasecmp(mime_type, "message/", 8) == 0 ||
+ ap_casecmpstrn(mime_type, "message/", 8) == 0 ||
dc->force_xlate == FX_FORCE)) {
rv = apr_xlate_open(&ctx->xlate,
else {
action = '\0';
}
- if (!strcasecmp(w, "FancyIndexing")) {
+ if (!ap_casecmpstr(w, "FancyIndexing")) {
option = FANCY_INDEXING;
}
- else if (!strcasecmp(w, "FoldersFirst")) {
+ else if (!ap_casecmpstr(w, "FoldersFirst")) {
option = FOLDERS_FIRST;
}
- else if (!strcasecmp(w, "HTMLTable")) {
+ else if (!ap_casecmpstr(w, "HTMLTable")) {
option = TABLE_INDEXING;
}
- else if (!strcasecmp(w, "IconsAreLinks")) {
+ else if (!ap_casecmpstr(w, "IconsAreLinks")) {
option = ICONS_ARE_LINKS;
}
- else if (!strcasecmp(w, "IgnoreCase")) {
+ else if (!ap_casecmpstr(w, "IgnoreCase")) {
option = IGNORE_CASE;
}
- else if (!strcasecmp(w, "IgnoreClient")) {
+ else if (!ap_casecmpstr(w, "IgnoreClient")) {
option = IGNORE_CLIENT;
}
- else if (!strcasecmp(w, "ScanHTMLTitles")) {
+ else if (!ap_casecmpstr(w, "ScanHTMLTitles")) {
option = SCAN_HTML_TITLES;
}
- else if (!strcasecmp(w, "SuppressColumnSorting")) {
+ else if (!ap_casecmpstr(w, "SuppressColumnSorting")) {
option = SUPPRESS_COLSORT;
}
- else if (!strcasecmp(w, "SuppressDescription")) {
+ else if (!ap_casecmpstr(w, "SuppressDescription")) {
option = SUPPRESS_DESC;
}
- else if (!strcasecmp(w, "SuppressHTMLPreamble")) {
+ else if (!ap_casecmpstr(w, "SuppressHTMLPreamble")) {
option = SUPPRESS_PREAMBLE;
}
- else if (!strcasecmp(w, "SuppressIcon")) {
+ else if (!ap_casecmpstr(w, "SuppressIcon")) {
option = SUPPRESS_ICON;
}
- else if (!strcasecmp(w, "SuppressLastModified")) {
+ else if (!ap_casecmpstr(w, "SuppressLastModified")) {
option = SUPPRESS_LAST_MOD;
}
- else if (!strcasecmp(w, "SuppressSize")) {
+ else if (!ap_casecmpstr(w, "SuppressSize")) {
option = SUPPRESS_SIZE;
}
- else if (!strcasecmp(w, "SuppressRules")) {
+ else if (!ap_casecmpstr(w, "SuppressRules")) {
option = SUPPRESS_RULES;
}
- else if (!strcasecmp(w, "TrackModified")) {
+ else if (!ap_casecmpstr(w, "TrackModified")) {
option = TRACK_MODIFIED;
}
- else if (!strcasecmp(w, "VersionSort")) {
+ else if (!ap_casecmpstr(w, "VersionSort")) {
option = VERSION_SORT;
}
- else if (!strcasecmp(w, "XHTML")) {
+ else if (!ap_casecmpstr(w, "XHTML")) {
option = EMIT_XHTML;
}
- else if (!strcasecmp(w, "ShowForbidden")) {
+ else if (!ap_casecmpstr(w, "ShowForbidden")) {
option = SHOW_FORBIDDEN;
}
- else if (!strcasecmp(w, "AddAltClass")) {
+ else if (!ap_casecmpstr(w, "AddAltClass")) {
option = ADDALTCLASS;
}
- else if (!strcasecmp(w, "None")) {
+ else if (!ap_casecmpstr(w, "None")) {
if (action != '\0') {
return "Cannot combine '+' or '-' with 'None' keyword";
}
opts_add = 0;
opts_remove = 0;
}
- else if (!strcasecmp(w, "IconWidth")) {
+ else if (!ap_casecmpstr(w, "IconWidth")) {
if (action != '-') {
d_cfg->icon_width = DEFAULT_ICON_WIDTH;
}
d_cfg->icon_width = 0;
}
}
- else if (!strncasecmp(w, "IconWidth=", 10)) {
+ else if (!ap_casecmpstrn(w, "IconWidth=", 10)) {
if (action == '-') {
return "Cannot combine '-' with IconWidth=n";
}
d_cfg->icon_width = atoi(&w[10]);
}
- else if (!strcasecmp(w, "IconHeight")) {
+ else if (!ap_casecmpstr(w, "IconHeight")) {
if (action != '-') {
d_cfg->icon_height = DEFAULT_ICON_HEIGHT;
}
d_cfg->icon_height = 0;
}
}
- else if (!strncasecmp(w, "IconHeight=", 11)) {
+ else if (!ap_casecmpstrn(w, "IconHeight=", 11)) {
if (action == '-') {
return "Cannot combine '-' with IconHeight=n";
}
d_cfg->icon_height = atoi(&w[11]);
}
- else if (!strcasecmp(w, "NameWidth")) {
+ else if (!ap_casecmpstr(w, "NameWidth")) {
if (action != '-') {
return "NameWidth with no value may only appear as "
"'-NameWidth'";
d_cfg->name_width = DEFAULT_NAME_WIDTH;
d_cfg->name_adjust = K_NOADJUST;
}
- else if (!strncasecmp(w, "NameWidth=", 10)) {
+ else if (!ap_casecmpstrn(w, "NameWidth=", 10)) {
if (action == '-') {
return "Cannot combine '-' with NameWidth=n";
}
d_cfg->name_adjust = K_NOADJUST;
}
}
- else if (!strcasecmp(w, "DescriptionWidth")) {
+ else if (!ap_casecmpstr(w, "DescriptionWidth")) {
if (action != '-') {
return "DescriptionWidth with no value may only appear as "
"'-DescriptionWidth'";
d_cfg->desc_width = DEFAULT_DESC_WIDTH;
d_cfg->desc_adjust = K_NOADJUST;
}
- else if (!strncasecmp(w, "DescriptionWidth=", 17)) {
+ else if (!ap_casecmpstrn(w, "DescriptionWidth=", 17)) {
if (action == '-') {
return "Cannot combine '-' with DescriptionWidth=n";
}
d_cfg->desc_adjust = K_NOADJUST;
}
}
- else if (!strncasecmp(w, "Type=", 5)) {
+ else if (!ap_casecmpstrn(w, "Type=", 5)) {
d_cfg->ctype = apr_pstrdup(cmd->pool, &w[5]);
}
- else if (!strncasecmp(w, "Charset=", 8)) {
+ else if (!ap_casecmpstrn(w, "Charset=", 8)) {
d_cfg->charset = apr_pstrdup(cmd->pool, &w[8]);
}
else {
{
autoindex_config_rec *d_cfg = (autoindex_config_rec *) m;
- if (!strcasecmp(direction, "Ascending")) {
+ if (!ap_casecmpstr(direction, "Ascending")) {
d_cfg->default_direction = D_ASCENDING;
}
- else if (!strcasecmp(direction, "Descending")) {
+ else if (!ap_casecmpstr(direction, "Descending")) {
d_cfg->default_direction = D_DESCENDING;
}
else {
return "First keyword must be 'Ascending' or 'Descending'";
}
- if (!strcasecmp(key, "Name")) {
+ if (!ap_casecmpstr(key, "Name")) {
d_cfg->default_keyid = K_NAME;
}
- else if (!strcasecmp(key, "Date")) {
+ else if (!ap_casecmpstr(key, "Date")) {
d_cfg->default_keyid = K_LAST_MOD;
}
- else if (!strcasecmp(key, "Size")) {
+ else if (!ap_casecmpstr(key, "Size")) {
d_cfg->default_keyid = K_SIZE;
}
- else if (!strcasecmp(key, "Description")) {
+ else if (!ap_casecmpstr(key, "Description")) {
d_cfg->default_keyid = K_DESC;
}
else {
" <title>Server Information</title>\n" "</head>\n", r);
ap_rputs("<body><h1 style=\"text-align: center\">"
"Apache Server Information</h1>\n", r);
- if (!r->args || strcasecmp(r->args, "list")) {
+ if (!r->args || ap_casecmpstr(r->args, "list")) {
if (!r->args) {
ap_rputs("<dl><dt><tt>Subpages:<br />", r);
ap_rputs("<a href=\"?config\">Configuration Files</a>, "
ap_rputs("</tt></dt></dl><hr />", r);
}
- if (!r->args || !strcasecmp(r->args, "server")) {
+ if (!r->args || !ap_casecmpstr(r->args, "server")) {
show_server_settings(r);
}
- if (!r->args || !strcasecmp(r->args, "hooks")) {
+ if (!r->args || !ap_casecmpstr(r->args, "hooks")) {
show_active_hooks(r);
}
- if (!r->args || !strcasecmp(r->args, "providers")) {
+ if (!r->args || !ap_casecmpstr(r->args, "providers")) {
show_providers(r);
}
- if (r->args && 0 == strcasecmp(r->args, "config")) {
+ if (r->args && 0 == ap_casecmpstr(r->args, "config")) {
ap_rputs("<dl><dt><strong>Configuration:</strong>\n", r);
mod_info_module_cmds(r, NULL, ap_conftree, 0, 0);
ap_rputs("</dl><hr />", r);
modules = get_sorted_modules(r->pool);
for (i = 0; i < modules->nelts; i++) {
modp = APR_ARRAY_IDX(modules, i, module *);
- if (!r->args || !strcasecmp(modp->name, r->args)) {
+ if (!r->args || !ap_casecmpstr(modp->name, r->args)) {
ap_rprintf(r,
"<dl><dt><a name=\"%s\"><strong>Module Name:</strong></a> "
"<font size=\"+1\"><tt><a href=\"?%s\">%s</a></tt></font></dt>\n",
}
}
}
- if (!modp && r->args && strcasecmp(r->args, "server")) {
+ if (!modp && r->args && ap_casecmpstr(r->args, "server")) {
ap_rputs("<p><b>No such module</b></p>\n", r);
}
}
while (field && (token = ap_get_list_item(r->pool, &field)) != NULL) {
for (i = 0; i < r->content_languages->nelts; ++i) {
- if (!strcasecmp(token, languages[i]))
+ if (!ap_casecmpstr(token, languages[i]))
break;
}
if (i == r->content_languages->nelts) {
while (field && (token = ap_get_list_item(r->pool, &field)) != NULL) {
for (i = 0; i < r->content_languages->nelts; ++i) {
- if (!strcasecmp(token, languages[i]))
+ if (!ap_casecmpstr(token, languages[i]))
break;
}
if (i == r->content_languages->nelts) {
--last;
}
- if (!strcasecmp(name, a)) {
+ if (!ap_casecmpstr(name, a)) {
/* last1 points to the next char following the ';' delim,
or the trailing NUL char of the string */
last = last1 - (*last1 ? 2 : 1);
{
neg_dir_config *n = n_;
- if (!strcasecmp(w, "None")) {
+ if (!ap_casecmpstr(w, "None")) {
if (n->forcelangpriority & ~FLP_NONE) {
return "Cannot combine ForceLanguagePriority options with None";
}
n->forcelangpriority = FLP_NONE;
}
- else if (!strcasecmp(w, "Prefer")) {
+ else if (!ap_casecmpstr(w, "Prefer")) {
if (n->forcelangpriority & FLP_NONE) {
return "Cannot combine ForceLanguagePriority options None and "
"Prefer";
}
n->forcelangpriority |= FLP_PREFER;
}
- else if (!strcasecmp(w, "Fallback")) {
+ else if (!ap_casecmpstr(w, "Fallback")) {
if (n->forcelangpriority & FLP_NONE) {
return "Cannot combine ForceLanguagePriority options None and "
"Fallback";
/* We need to shortcut the rest of this block following the Body:
* tag - we will not look for continutation after this line.
*/
- if (!strncasecmp(buffer, "Body:", 5))
+ if (!ap_casecmpstrn(buffer, "Body:", 5))
return header_seen;
while (apr_file_getc(&c, map) != APR_EOF) {
cp = (char *)ap_http_scheme(r);
l = strlen(cp);
if ( strlen(r->filename) > l+3
- && strncasecmp(r->filename, cp, l) == 0
+ && ap_casecmpstrn(r->filename, cp, l) == 0
&& r->filename[l] == ':'
&& r->filename[l+1] == '/'
&& r->filename[l+2] == '/' ) {
switch (*key++) {
case 'b':
case 'B':
- if (!*key || !strcasecmp(key, "ackrefescaping")) {
+ if (!*key || !ap_casecmpstr(key, "ackrefescaping")) {
cfg->flags |= RULEFLAG_ESCAPEBACKREF;
if (val && *val) {
cfg->escapes = val;
}
}
- else if (!strcasecmp(key, "NP") || !strcasecmp(key, "ackrefernoplus")) {
+ else if (!ap_casecmpstr(key, "NP") || !ap_casecmpstr(key, "ackrefernoplus")) {
cfg->flags |= RULEFLAG_ESCAPENOPLUS;
}
else {
break;
case 'c':
case 'C':
- if (!*key || !strcasecmp(key, "hain")) { /* chain */
+ if (!*key || !ap_casecmpstr(key, "hain")) { /* chain */
cfg->flags |= RULEFLAG_CHAIN;
}
else if (((*key == 'O' || *key == 'o') && !key[1])
- || !strcasecmp(key, "ookie")) { /* cookie */
+ || !ap_casecmpstr(key, "ookie")) { /* cookie */
data_item *cp = cfg->cookie;
if (!cp) {
break;
case 'd':
case 'D':
- if (!*key || !strcasecmp(key, "PI") || !strcasecmp(key,"iscardpath")) {
+ if (!*key || !ap_casecmpstr(key, "PI") || !ap_casecmpstr(key,"iscardpath")) {
cfg->flags |= (RULEFLAG_DISCARDPATHINFO);
}
break;
case 'e':
case 'E':
- if (!*key || !strcasecmp(key, "nv")) { /* env */
+ if (!*key || !ap_casecmpstr(key, "nv")) { /* env */
data_item *cp = cfg->env;
if (!cp) {
cp->next = NULL;
cp->data = val;
}
- else if (!strcasecmp(key, "nd")) { /* end */
+ else if (!ap_casecmpstr(key, "nd")) { /* end */
cfg->flags |= RULEFLAG_END;
}
else {
case 'f':
case 'F':
- if (!*key || !strcasecmp(key, "orbidden")) { /* forbidden */
+ if (!*key || !ap_casecmpstr(key, "orbidden")) { /* forbidden */
cfg->flags |= (RULEFLAG_STATUS | RULEFLAG_NOSUB);
cfg->forced_responsecode = HTTP_FORBIDDEN;
}
case 'g':
case 'G':
- if (!*key || !strcasecmp(key, "one")) { /* gone */
+ if (!*key || !ap_casecmpstr(key, "one")) { /* gone */
cfg->flags |= (RULEFLAG_STATUS | RULEFLAG_NOSUB);
cfg->forced_responsecode = HTTP_GONE;
}
case 'h':
case 'H':
- if (!*key || !strcasecmp(key, "andler")) { /* handler */
+ if (!*key || !ap_casecmpstr(key, "andler")) { /* handler */
cfg->forced_handler = val;
}
else {
break;
case 'l':
case 'L':
- if (!*key || !strcasecmp(key, "ast")) { /* last */
+ if (!*key || !ap_casecmpstr(key, "ast")) { /* last */
cfg->flags |= RULEFLAG_LASTRULE;
}
else {
case 'n':
case 'N':
if (((*key == 'E' || *key == 'e') && !key[1])
- || !strcasecmp(key, "oescape")) { /* noescape */
+ || !ap_casecmpstr(key, "oescape")) { /* noescape */
cfg->flags |= RULEFLAG_NOESCAPE;
}
- else if (!*key || !strcasecmp(key, "ext")) { /* next */
+ else if (!*key || !ap_casecmpstr(key, "ext")) { /* next */
cfg->flags |= RULEFLAG_NEWROUND;
if (val && *val) {
cfg->maxrounds = atoi(val);
}
else if (((*key == 'S' || *key == 's') && !key[1])
- || !strcasecmp(key, "osubreq")) { /* nosubreq */
+ || !ap_casecmpstr(key, "osubreq")) { /* nosubreq */
cfg->flags |= RULEFLAG_IGNOREONSUBREQ;
}
else if (((*key == 'C' || *key == 'c') && !key[1])
- || !strcasecmp(key, "ocase")) { /* nocase */
+ || !ap_casecmpstr(key, "ocase")) { /* nocase */
cfg->flags |= RULEFLAG_NOCASE;
}
else {
case 'p':
case 'P':
- if (!*key || !strcasecmp(key, "roxy")) { /* proxy */
+ if (!*key || !ap_casecmpstr(key, "roxy")) { /* proxy */
cfg->flags |= RULEFLAG_PROXY;
}
else if (((*key == 'T' || *key == 't') && !key[1])
- || !strcasecmp(key, "assthrough")) { /* passthrough */
+ || !ap_casecmpstr(key, "assthrough")) { /* passthrough */
cfg->flags |= RULEFLAG_PASSTHROUGH;
}
else {
case 'q':
case 'Q':
- if ( !strcasecmp(key, "SA")
- || !strcasecmp(key, "sappend")) { /* qsappend */
+ if ( !ap_casecmpstr(key, "SA")
+ || !ap_casecmpstr(key, "sappend")) { /* qsappend */
cfg->flags |= RULEFLAG_QSAPPEND;
- } else if ( !strcasecmp(key, "SD")
- || !strcasecmp(key, "sdiscard") ) { /* qsdiscard */
+ } else if ( !ap_casecmpstr(key, "SD")
+ || !ap_casecmpstr(key, "sdiscard") ) { /* qsdiscard */
cfg->flags |= RULEFLAG_QSDISCARD;
}
else {
case 'r':
case 'R':
- if (!*key || !strcasecmp(key, "edirect")) { /* redirect */
+ if (!*key || !ap_casecmpstr(key, "edirect")) { /* redirect */
int status = 0;
cfg->flags |= RULEFLAG_FORCEREDIRECT;
if (*val) {
- if (strcasecmp(val, "permanent") == 0) {
+ if (ap_casecmpstr(val, "permanent") == 0) {
status = HTTP_MOVED_PERMANENTLY;
}
- else if (strcasecmp(val, "temp") == 0) {
+ else if (ap_casecmpstr(val, "temp") == 0) {
status = HTTP_MOVED_TEMPORARILY;
}
- else if (strcasecmp(val, "seeother") == 0) {
+ else if (ap_casecmpstr(val, "seeother") == 0) {
status = HTTP_SEE_OTHER;
}
else if (apr_isdigit(*val)) {
case 's':
case 'S':
- if (!*key || !strcasecmp(key, "kip")) { /* skip */
+ if (!*key || !ap_casecmpstr(key, "kip")) { /* skip */
cfg->skip = atoi(val);
}
else {
case 't':
case 'T':
- if (!*key || !strcasecmp(key, "ype")) { /* type */
+ if (!*key || !ap_casecmpstr(key, "ype")) { /* type */
cfg->forced_mimetype = val;
}
else {
}
if (!ap_os_is_path_absolute(cmd->pool, map)) {
- if (strcasecmp(map, "none")) {
+ if (ap_casecmpstr(map, "none")) {
return "format string must be an absolute path, or 'none'";
}
*pmap = NULL;
int ival;
apr_interval_time_t timeout;
- if (!strcasecmp(key, "loadfactor")) {
+ if (!ap_casecmpstr(key, "loadfactor")) {
/* Normalized load factor. Used with BalancerMamber,
* it is a number between 1 and 100.
*/
if (worker->s->lbfactor < 1 || worker->s->lbfactor > 100)
return "LoadFactor must be a number between 1..100";
}
- else if (!strcasecmp(key, "retry")) {
+ else if (!ap_casecmpstr(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 (!strcasecmp(key, "ttl")) {
+ else if (!ap_casecmpstr(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 (!strcasecmp(key, "min")) {
+ else if (!ap_casecmpstr(key, "min")) {
/* Initial number of connections to remote
*/
ival = atoi(val);
return "Min must be a positive number";
worker->s->min = ival;
}
- else if (!strcasecmp(key, "max")) {
+ else if (!ap_casecmpstr(key, "max")) {
/* Maximum number of connections to remote
*/
ival = atoi(val);
worker->s->hmax = ival;
}
/* XXX: More inteligent naming needed */
- else if (!strcasecmp(key, "smax")) {
+ else if (!ap_casecmpstr(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 (!strcasecmp(key, "acquire")) {
+ else if (!ap_casecmpstr(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 (!strcasecmp(key, "timeout")) {
+ else if (!ap_casecmpstr(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 (!strcasecmp(key, "iobuffersize")) {
+ else if (!ap_casecmpstr(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 (!strcasecmp(key, "receivebuffersize")) {
+ else if (!ap_casecmpstr(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 (!strcasecmp(key, "keepalive")) {
- if (!strcasecmp(val, "on"))
+ else if (!ap_casecmpstr(key, "keepalive")) {
+ if (!ap_casecmpstr(val, "on"))
worker->s->keepalive = 1;
- else if (!strcasecmp(val, "off"))
+ else if (!ap_casecmpstr(val, "off"))
worker->s->keepalive = 0;
else
return "KeepAlive must be On|Off";
worker->s->keepalive_set = 1;
}
- else if (!strcasecmp(key, "disablereuse")) {
- if (!strcasecmp(val, "on"))
+ else if (!ap_casecmpstr(key, "disablereuse")) {
+ if (!ap_casecmpstr(val, "on"))
worker->s->disablereuse = 1;
- else if (!strcasecmp(val, "off"))
+ else if (!ap_casecmpstr(val, "off"))
worker->s->disablereuse = 0;
else
return "DisableReuse must be On|Off";
worker->s->disablereuse_set = 1;
}
- else if (!strcasecmp(key, "enablereuse")) {
- if (!strcasecmp(val, "on"))
+ else if (!ap_casecmpstr(key, "enablereuse")) {
+ if (!ap_casecmpstr(val, "on"))
worker->s->disablereuse = 0;
- else if (!strcasecmp(val, "off"))
+ else if (!ap_casecmpstr(val, "off"))
worker->s->disablereuse = 1;
else
return "EnableReuse must be On|Off";
worker->s->disablereuse_set = 1;
}
- else if (!strcasecmp(key, "route")) {
+ else if (!ap_casecmpstr(key, "route")) {
/* Worker route.
*/
if (strlen(val) >= sizeof(worker->s->route))
(int)sizeof(worker->s->route));
PROXY_STRNCPY(worker->s->route, val);
}
- else if (!strcasecmp(key, "redirect")) {
+ else if (!ap_casecmpstr(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 (!strcasecmp(key, "status")) {
+ else if (!ap_casecmpstr(key, "status")) {
const char *v;
int mode = 1;
apr_status_t rv;
return "Unknown status parameter option";
}
}
- else if (!strcasecmp(key, "flushpackets")) {
- if (!strcasecmp(val, "on"))
+ else if (!ap_casecmpstr(key, "flushpackets")) {
+ if (!ap_casecmpstr(val, "on"))
worker->s->flush_packets = flush_on;
- else if (!strcasecmp(val, "off"))
+ else if (!ap_casecmpstr(val, "off"))
worker->s->flush_packets = flush_off;
- else if (!strcasecmp(val, "auto"))
+ else if (!ap_casecmpstr(val, "auto"))
worker->s->flush_packets = flush_auto;
else
return "flushpackets must be on|off|auto";
}
- else if (!strcasecmp(key, "flushwait")) {
+ else if (!ap_casecmpstr(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 (!strcasecmp(key, "ping")) {
+ else if (!ap_casecmpstr(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 (!strcasecmp(key, "lbset")) {
+ else if (!ap_casecmpstr(key, "lbset")) {
ival = atoi(val);
if (ival < 0 || ival > 99)
return "lbset must be between 0 and 99";
worker->s->lbset = ival;
}
- else if (!strcasecmp(key, "connectiontimeout")) {
+ else if (!ap_casecmpstr(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 (!strcasecmp(key, "flusher")) {
+ else if (!ap_casecmpstr(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 (!strcasecmp(key, "stickysession")) {
+ if (!ap_casecmpstr(key, "stickysession")) {
char *path;
/* Balancer sticky session name.
* Set to something like JSESSIONID or
PROXY_STRNCPY(balancer->s->sticky_path, path);
}
}
- else if (!strcasecmp(key, "stickysessionsep")) {
+ else if (!ap_casecmpstr(key, "stickysessionsep")) {
/* separator/delimiter for sessionid and route,
* normally '.'
*/
if (strlen(val) != 1) {
- if (!strcasecmp(val, "off"))
+ if (!ap_casecmpstr(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 (!strcasecmp(key, "nofailover")) {
+ else if (!ap_casecmpstr(key, "nofailover")) {
/* If set to 'on' the session will break
* if the worker is in error state or
* disabled.
*/
- if (!strcasecmp(val, "on"))
+ if (!ap_casecmpstr(val, "on"))
balancer->s->sticky_force = 1;
- else if (!strcasecmp(val, "off"))
+ else if (!ap_casecmpstr(val, "off"))
balancer->s->sticky_force = 0;
else
return "failover must be On|Off";
balancer->s->sticky_force_set = 1;
}
- else if (!strcasecmp(key, "timeout")) {
+ else if (!ap_casecmpstr(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 (!strcasecmp(key, "maxattempts")) {
+ else if (!ap_casecmpstr(key, "maxattempts")) {
/* Maximum number of failover attempts before
* giving up.
*/
balancer->s->max_attempts = ival;
balancer->s->max_attempts_set = 1;
}
- else if (!strcasecmp(key, "lbmethod")) {
+ else if (!ap_casecmpstr(key, "lbmethod")) {
proxy_balancer_method *provider;
if (strlen(val) > (sizeof(balancer->s->lbpname)-1))
return "unknown lbmethod";
}
return "unknown lbmethod";
}
- else if (!strcasecmp(key, "scolonpathdelim")) {
+ else if (!ap_casecmpstr(key, "scolonpathdelim")) {
/* If set to 'on' then ';' will also be
* used as a session path separator/delim (ala
* mod_jk)
*/
- if (!strcasecmp(val, "on"))
+ if (!ap_casecmpstr(val, "on"))
balancer->s->scolonsep = 1;
- else if (!strcasecmp(val, "off"))
+ else if (!ap_casecmpstr(val, "off"))
balancer->s->scolonsep = 0;
else
return "scolonpathdelim must be On|Off";
balancer->s->scolonsep_set = 1;
}
- else if (!strcasecmp(key, "failonstatus")) {
+ else if (!ap_casecmpstr(key, "failonstatus")) {
char *val_split;
char *status;
char *tok_state;
}
}
- else if (!strcasecmp(key, "failontimeout")) {
- if (!strcasecmp(val, "on"))
+ else if (!ap_casecmpstr(key, "failontimeout")) {
+ if (!ap_casecmpstr(val, "on"))
balancer->failontimeout = 1;
- else if (!strcasecmp(val, "off"))
+ else if (!ap_casecmpstr(val, "off"))
balancer->failontimeout = 0;
else
return "failontimeout must be On|Off";
balancer->failontimeout_set = 1;
}
- else if (!strcasecmp(key, "nonce")) {
- if (!strcasecmp(val, "None")) {
+ else if (!ap_casecmpstr(key, "nonce")) {
+ if (!ap_casecmpstr(val, "None")) {
*balancer->s->nonce = '\0';
}
else {
}
balancer->s->nonce_set = 1;
}
- else if (!strcasecmp(key, "growth")) {
+ else if (!ap_casecmpstr(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 (!strcasecmp(key, "forcerecovery")) {
- if (!strcasecmp(val, "on"))
+ else if (!ap_casecmpstr(key, "forcerecovery")) {
+ if (!ap_casecmpstr(val, "on"))
balancer->s->forcerecovery = 1;
- else if (!strcasecmp(val, "off"))
+ else if (!ap_casecmpstr(val, "off"))
balancer->s->forcerecovery = 0;
else
return "forcerecovery must be On|Off";
if (conf->req && r->parsed_uri.scheme) {
/* but it might be something vhosted */
if (!(r->parsed_uri.hostname
- && !strcasecmp(r->parsed_uri.scheme, ap_http_scheme(r))
+ && !ap_casecmpstr(r->parsed_uri.scheme, ap_http_scheme(r))
&& ap_matches_request_vhost(r, r->parsed_uri.hostname,
(apr_port_t)(r->parsed_uri.port_str ? r->parsed_uri.port
: ap_default_port(r))))) {
/* If host does contain a dot already, or it is "localhost", decline */
if (strchr(r->parsed_uri.hostname, '.') != NULL /* has domain, or IPv4 literal */
|| strchr(r->parsed_uri.hostname, ':') != NULL /* IPv6 literal */
- || strcasecmp(r->parsed_uri.hostname, "localhost") == 0)
+ || ap_casecmpstr(r->parsed_uri.hostname, "localhost") == 0)
return DECLINED; /* host name has a dot already */
ref = apr_table_get(r->headers_in, "Referer");
if (NULL != (pathinfo_type = apr_table_get(r->subprocess_env, "proxy-fcgi-pathinfo"))) {
/* It has to be on disk for this to work */
- if (!strcasecmp(pathinfo_type, "full")) {
+ if (!ap_casecmpstr(pathinfo_type, "full")) {
rconf->need_dirwalk = 1;
ap_unescape_url_keep2f(path, 0);
}
- else if (!strcasecmp(pathinfo_type, "first-dot")) {
+ else if (!ap_casecmpstr(pathinfo_type, "first-dot")) {
char *split = ap_strchr(path, '.');
if (split) {
char *slash = ap_strchr(split, '/');
}
}
}
- else if (!strcasecmp(pathinfo_type, "last-dot")) {
+ else if (!ap_casecmpstr(pathinfo_type, "last-dot")) {
char *split = ap_strrchr(path, '.');
if (split) {
char *slash = ap_strchr(split, '/');
* the FCGI server to fixup PATH_INFO because it's the entire path
*/
r->path_info = apr_pstrcat(r->pool, "/", path, NULL);
- if (!strcasecmp(pathinfo_type, "unescape")) {
+ if (!ap_casecmpstr(pathinfo_type, "unescape")) {
ap_unescape_url_keep2f(r->path_info, 0);
}
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01061)
ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, r,
"HTTP: received interim %d response", r->status);
if (!policy
- || (!strcasecmp(policy, "RFC") && ((r->expecting_100 = 1)))) {
+ || (!ap_casecmpstr(policy, "RFC")
+ && ((r->expecting_100 = 1)))) {
ap_send_interim_response(r, 1);
}
/* FIXME: refine this to be able to specify per-response-status
* policies and maybe also add option to bail out with 502
*/
- else if (strcasecmp(policy, "Suppress")) {
+ else if (ap_casecmpstr(policy, "Suppress")) {
ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO(01108)
"undefined proxy interim response policy");
}
if (!distrusted_str) {
distrusted = DISTRUSTED_UNSET;
}
- else if (!strcasecmp(distrusted_str, "1")) {
+ else if (!strcmp(distrusted_str, "1")) {
distrusted = DISTRUSTED;
}
- else if (!strcasecmp(distrusted_str, "0")) {
+ else if (!strcmp(distrusted_str, "0")) {
distrusted = TRUSTED;
}
else {
return NULL;
}
- if (strcasecmp(u->scheme, "http") != 0) {
+ if (ap_casecmpstr(u->scheme, "http") != 0) {
ap_log_cerror(APLOG_MARK, APLOG_DEBUG, rv, c, APLOGNO(01920)
"cannot handle OCSP responder URI '%s'", s);
return NULL;
* c: log conn log id if available and not a once-per-request log line
* else: log request log id if available
*/
- if (arg && !strcasecmp(arg, "c")) {
+ if (arg && !ap_casecmpstr(arg, "c")) {
if (info->c && (*arg != 'C' || !info->r)) {
return cpystrn(buf, info->c->log_id, buflen);
}
return err;
while (priorities[i].t_name != NULL) {
- if (!strcasecmp(str, priorities[i].t_name)) {
+ if (!ap_casecmpstr(str, priorities[i].t_name)) {
*val = priorities[i].t_val;
return NULL;
}
if (finfo.filetype != APR_REG &&
#if defined(WIN32) || defined(OS2) || defined(NETWARE)
- strcasecmp(apr_filepath_name_get(name), "nul") != 0) {
+ ap_casecmpstr(apr_filepath_name_get(name), "nul") != 0) {
#else
strcmp(name, "/dev/null") != 0) {
#endif /* WIN32 || OS2 */