diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2007-02-14 18:51:19 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2007-02-14 18:51:19 +0000 |
| commit | 722231f40788d1243bf302227ed7b6fdfeaea492 (patch) | |
| tree | f408767af10da88546a8d2b518601aef67ffdfb0 /src/http/modules | |
| parent | 0ddd9d6e5ebe8cf3fddaf5f017992f0740dd7996 (diff) | |
| download | nginx-722231f40788d1243bf302227ed7b6fdfeaea492.tar.gz nginx-722231f40788d1243bf302227ed7b6fdfeaea492.tar.bz2 | |
ngx_strcasecmp()/ngx_strncasecmp()
Diffstat (limited to 'src/http/modules')
| -rw-r--r-- | src/http/modules/ngx_http_addition_filter_module.c | 4 | ||||
| -rw-r--r-- | src/http/modules/ngx_http_charset_filter_module.c | 10 | ||||
| -rw-r--r-- | src/http/modules/ngx_http_headers_filter_module.c | 2 | ||||
| -rw-r--r-- | src/http/modules/ngx_http_proxy_module.c | 4 | ||||
| -rw-r--r-- | src/http/modules/ngx_http_range_filter_module.c | 4 | ||||
| -rw-r--r-- | src/http/modules/ngx_http_referer_module.c | 2 | ||||
| -rw-r--r-- | src/http/modules/ngx_http_ssi_filter_module.c | 7 |
7 files changed, 20 insertions, 13 deletions
diff --git a/src/http/modules/ngx_http_addition_filter_module.c b/src/http/modules/ngx_http_addition_filter_module.c index 5025f5649..948008212 100644 --- a/src/http/modules/ngx_http_addition_filter_module.c +++ b/src/http/modules/ngx_http_addition_filter_module.c @@ -100,8 +100,8 @@ ngx_http_addition_header_filter(ngx_http_request_t *r) return ngx_http_next_header_filter(r); } - if (ngx_strncasecmp(r->headers_out.content_type.data, "text/html", - sizeof("text/html") - 1) + if (ngx_strncasecmp(r->headers_out.content_type.data, + (u_char *) "text/html", sizeof("text/html") - 1) != 0) { return ngx_http_next_header_filter(r); diff --git a/src/http/modules/ngx_http_charset_filter_module.c b/src/http/modules/ngx_http_charset_filter_module.c index cae9bbe53..0139cc671 100644 --- a/src/http/modules/ngx_http_charset_filter_module.c +++ b/src/http/modules/ngx_http_charset_filter_module.c @@ -239,8 +239,10 @@ ngx_http_charset_header_filter(ngx_http_request_t *r) } else { ct = r->headers_out.content_type.data; - if (ngx_strncasecmp(ct, "text/", 5) != 0 - && ngx_strncasecmp(ct, "application/x-javascript", 24) != 0) + if (ngx_strncasecmp(ct, (u_char *) "text/", 5) != 0 + && ngx_strncasecmp(ct, + (u_char *) "application/x-javascript", 24) + != 0) { return ngx_http_next_header_filter(r); } @@ -1118,7 +1120,7 @@ ngx_http_charset_map_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) table->src = src; table->dst = dst; - if (ngx_strcasecmp(value[2].data, "utf-8") == 0) { + if (ngx_strcasecmp(value[2].data, (u_char *) "utf-8") == 0) { table->src2dst = ngx_pcalloc(cf->pool, 256 * NGX_UTF_LEN); if (table->src2dst == NULL) { return NGX_CONF_ERROR; @@ -1372,7 +1374,7 @@ ngx_http_add_charset(ngx_array_t *charsets, ngx_str_t *name) c->name = *name; c->length = 0; - if (ngx_strcasecmp(name->data, "utf-8") == 0) { + if (ngx_strcasecmp(name->data, (u_char *) "utf-8") == 0) { c->utf8 = 1; } else { diff --git a/src/http/modules/ngx_http_headers_filter_module.c b/src/http/modules/ngx_http_headers_filter_module.c index 8d17b43fa..599bd14b7 100644 --- a/src/http/modules/ngx_http_headers_filter_module.c +++ b/src/http/modules/ngx_http_headers_filter_module.c @@ -411,7 +411,7 @@ ngx_http_headers_add(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) value = cf->args->elts; - if (ngx_strcasecmp(value[1].data, "cache-control") == 0) { + if (ngx_strcasecmp(value[1].data, (u_char *) "cache-control") == 0) { hcf->cache_control = value[2]; return NGX_CONF_OK; } diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c index 63ee8fd80..cbd2ce8e0 100644 --- a/src/http/modules/ngx_http_proxy_module.c +++ b/src/http/modules/ngx_http_proxy_module.c @@ -2111,11 +2111,11 @@ ngx_http_proxy_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) url = &value[1]; - if (ngx_strncasecmp(url->data, "http://", 7) == 0) { + if (ngx_strncasecmp(url->data, (u_char *) "http://", 7) == 0) { add = 7; port = 80; - } else if (ngx_strncasecmp(url->data, "https://", 8) == 0) { + } else if (ngx_strncasecmp(url->data, (u_char *) "https://", 8) == 0) { #if (NGX_HTTP_SSL) diff --git a/src/http/modules/ngx_http_range_filter_module.c b/src/http/modules/ngx_http_range_filter_module.c index 0c945d85f..62b537fb0 100644 --- a/src/http/modules/ngx_http_range_filter_module.c +++ b/src/http/modules/ngx_http_range_filter_module.c @@ -152,7 +152,9 @@ ngx_http_range_header_filter(ngx_http_request_t *r) if (r->headers_in.range == NULL || r->headers_in.range->value.len < 7 - || ngx_strncasecmp(r->headers_in.range->value.data, "bytes=", 6) != 0) + || ngx_strncasecmp(r->headers_in.range->value.data, + (u_char *) "bytes=", 6) + != 0) { r->headers_out.accept_ranges = ngx_list_push(&r->headers_out.headers); if (r->headers_out.accept_ranges == NULL) { diff --git a/src/http/modules/ngx_http_referer_module.c b/src/http/modules/ngx_http_referer_module.c index f3597a1d2..b2c2ef597 100644 --- a/src/http/modules/ngx_http_referer_module.c +++ b/src/http/modules/ngx_http_referer_module.c @@ -106,7 +106,7 @@ ngx_http_referer_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v, ref = r->headers_in.referer->value.data; if (len < sizeof("http://i.ru") - 1 - || (ngx_strncasecmp(ref, "http://", 7) != 0)) + || (ngx_strncasecmp(ref, (u_char *) "http://", 7) != 0)) { if (rlcf->blocked_referer) { goto valid; diff --git a/src/http/modules/ngx_http_ssi_filter_module.c b/src/http/modules/ngx_http_ssi_filter_module.c index c8e11bf20..e1d0e924d 100644 --- a/src/http/modules/ngx_http_ssi_filter_module.c +++ b/src/http/modules/ngx_http_ssi_filter_module.c @@ -1890,10 +1890,13 @@ ngx_http_ssi_include(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx, return NGX_HTTP_SSI_ERROR; } - if (wait->len == 2 && ngx_strncasecmp(wait->data, "no", 2) == 0) { + if (wait->len == 2 + && ngx_strncasecmp(wait->data, (u_char *) "no", 2) == 0) + { wait = NULL; - } else if (wait->len != 3 || ngx_strncasecmp(wait->data, "yes", 3) != 0) + } else if (wait->len != 3 + || ngx_strncasecmp(wait->data, (u_char *) "yes", 3) != 0) { ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "invalid value \"%V\" in the \"wait\" parameter", |
