From 0688b9c46ef00de501722d27ad6c56e65fc7e80c Mon Sep 17 00:00:00 2001 From: Hakase Date: Fri, 23 Feb 2018 09:58:46 +0900 Subject: [PATCH] Latest update - 7217 --- src/event/ngx_event_connect.c | 9 +++++++++ src/http/v2/ngx_http_v2.c | 21 ++++----------------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/event/ngx_event_connect.c b/src/event/ngx_event_connect.c index c5bb806..e7f28c9 100644 --- a/src/event/ngx_event_connect.c +++ b/src/event/ngx_event_connect.c @@ -388,7 +388,16 @@ ngx_event_connect_set_transparent(ngx_peer_connection_t *pc, ngx_socket_t s) return NGX_ERROR; } +#else + + ngx_log_error(NGX_LOG_ALERT, pc->log, 0, + "could not enable transparent proxying for IPv6 " + "on this platform"); + + return NGX_ERROR; + #endif + break; #endif /* NGX_HAVE_INET6 */ diff --git a/src/http/v2/ngx_http_v2.c b/src/http/v2/ngx_http_v2.c index 1460dd7..12c9ad1 100644 --- a/src/http/v2/ngx_http_v2.c +++ b/src/http/v2/ngx_http_v2.c @@ -3270,19 +3270,9 @@ ngx_http_v2_validate_header(ngx_http_request_t *r, ngx_http_v2_header_t *header) continue; } - switch (ch) { - case '\0': - case LF: - case CR: - case ':': - ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, - "client sent invalid header name: \"%V\"", - &header->name); - - return NGX_ERROR; - } - - if (ch >= 'A' && ch <= 'Z') { + if (ch == '\0' || ch == LF || ch == CR || ch == ':' + || (ch >= 'A' && ch <= 'Z')) + { ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, "client sent invalid header name: \"%V\"", &header->name); @@ -3296,10 +3286,7 @@ ngx_http_v2_validate_header(ngx_http_request_t *r, ngx_http_v2_header_t *header) for (i = 0; i != header->value.len; i++) { ch = header->value.data[i]; - switch (ch) { - case '\0': - case LF: - case CR: + if (ch == '\0' || ch == LF || ch == CR) { ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, "client sent header \"%V\" with " "invalid value: \"%V\"",