diff options
Diffstat (limited to '')
| -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 | ||||
| -rw-r--r-- | src/http/ngx_http_core_module.c | 32 | ||||
| -rw-r--r-- | src/http/ngx_http_request.c | 6 | ||||
| -rw-r--r-- | src/http/ngx_http_upstream.c | 2 |
10 files changed, 42 insertions, 31 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", diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index c35ccacda..0a686c33a 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -12,7 +12,7 @@ typedef struct { - char *name; + u_char *name; uint32_t method; } ngx_http_method_name_t; @@ -1247,7 +1247,9 @@ ngx_http_auth_basic_user(ngx_http_request_t *r) encoded = r->headers_in.authorization->value; if (encoded.len < sizeof("Basic ") - 1 - || ngx_strncasecmp(encoded.data, "Basic ", sizeof("Basic ") - 1) != 0) + || ngx_strncasecmp(encoded.data, (u_char *) "Basic ", + sizeof("Basic ") - 1) + != 0) { r->headers_in.user.data = (u_char *) ""; return NGX_DECLINED; @@ -2681,19 +2683,19 @@ ngx_http_core_root(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) static ngx_http_method_name_t ngx_methods_names[] = { - { "GET", (uint32_t) ~NGX_HTTP_GET }, - { "HEAD", (uint32_t) ~NGX_HTTP_HEAD }, - { "POST", (uint32_t) ~NGX_HTTP_POST }, - { "PUT", (uint32_t) ~NGX_HTTP_PUT }, - { "DELETE", (uint32_t) ~NGX_HTTP_DELETE }, - { "MKCOL", (uint32_t) ~NGX_HTTP_MKCOL }, - { "COPY", (uint32_t) ~NGX_HTTP_COPY }, - { "MOVE", (uint32_t) ~NGX_HTTP_MOVE }, - { "OPTIONS", (uint32_t) ~NGX_HTTP_OPTIONS }, - { "PROPFIND" , (uint32_t) ~NGX_HTTP_PROPFIND }, - { "PROPPATCH", (uint32_t) ~NGX_HTTP_PROPPATCH }, - { "LOCK", (uint32_t) ~NGX_HTTP_LOCK }, - { "UNLOCK", (uint32_t) ~NGX_HTTP_UNLOCK }, + { (u_char *) "GET", (uint32_t) ~NGX_HTTP_GET }, + { (u_char *) "HEAD", (uint32_t) ~NGX_HTTP_HEAD }, + { (u_char *) "POST", (uint32_t) ~NGX_HTTP_POST }, + { (u_char *) "PUT", (uint32_t) ~NGX_HTTP_PUT }, + { (u_char *) "DELETE", (uint32_t) ~NGX_HTTP_DELETE }, + { (u_char *) "MKCOL", (uint32_t) ~NGX_HTTP_MKCOL }, + { (u_char *) "COPY", (uint32_t) ~NGX_HTTP_COPY }, + { (u_char *) "MOVE", (uint32_t) ~NGX_HTTP_MOVE }, + { (u_char *) "OPTIONS", (uint32_t) ~NGX_HTTP_OPTIONS }, + { (u_char *) "PROPFIND" , (uint32_t) ~NGX_HTTP_PROPFIND }, + { (u_char *) "PROPPATCH", (uint32_t) ~NGX_HTTP_PROPPATCH }, + { (u_char *) "LOCK", (uint32_t) ~NGX_HTTP_LOCK }, + { (u_char *) "UNLOCK", (uint32_t) ~NGX_HTTP_UNLOCK }, { NULL, 0 } }; diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index d37fead3a..b366f79dd 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -1285,14 +1285,16 @@ ngx_http_process_request_header(ngx_http_request_t *r) if (r->headers_in.connection) { if (r->headers_in.connection->value.len == 5 - && ngx_strcasecmp(r->headers_in.connection->value.data, "close") + && ngx_strcasecmp(r->headers_in.connection->value.data, + (u_char *) "close") == 0) { r->headers_in.connection_type = NGX_HTTP_CONNECTION_CLOSE; } else if (r->headers_in.connection->value.len == 10 && ngx_strcasecmp(r->headers_in.connection->value.data, - "keep-alive") == 0) + (u_char *) "keep-alive") + == 0) { r->headers_in.connection_type = NGX_HTTP_CONNECTION_KEEP_ALIVE; diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c index 52860006b..79d372c13 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -2313,7 +2313,7 @@ ngx_http_upstream_copy_content_type(ngx_http_request_t *r, ngx_table_elt_t *h, while (*++p == ' ') { /* void */ } - if (ngx_strncasecmp(p, "charset=", 8) != 0) { + if (ngx_strncasecmp(p, (u_char *) "charset=", 8) != 0) { continue; } |
