diff options
Diffstat (limited to 'src/http')
-rw-r--r-- | src/http/modules/ngx_http_fastcgi_module.c | 3 | ||||
-rw-r--r-- | src/http/modules/ngx_http_proxy_module.c | 9 | ||||
-rw-r--r-- | src/http/modules/perl/Makefile.PL | 1 | ||||
-rw-r--r-- | src/http/modules/perl/ngx_http_perl_module.c | 2 | ||||
-rw-r--r-- | src/http/ngx_http.c | 8 | ||||
-rw-r--r-- | src/http/ngx_http_core_module.c | 4 | ||||
-rw-r--r-- | src/http/ngx_http_request.h | 1 | ||||
-rw-r--r-- | src/http/ngx_http_upstream.c | 7 | ||||
-rw-r--r-- | src/http/ngx_http_upstream.h | 2 |
9 files changed, 23 insertions, 14 deletions
diff --git a/src/http/modules/ngx_http_fastcgi_module.c b/src/http/modules/ngx_http_fastcgi_module.c index 978c32542..715b07020 100644 --- a/src/http/modules/ngx_http_fastcgi_module.c +++ b/src/http/modules/ngx_http_fastcgi_module.c @@ -1043,8 +1043,7 @@ ngx_http_fastcgi_process_header(ngx_http_request_t *r) /* there was error while a header line parsing */ ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - ngx_http_upstream_header_errors[rc - - NGX_HTTP_PARSE_HEADER_ERROR]); + "upstream sent invalid header"); return NGX_HTTP_UPSTREAM_INVALID_HEADER; diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c index e66b48b8b..34e6dd197 100644 --- a/src/http/modules/ngx_http_proxy_module.c +++ b/src/http/modules/ngx_http_proxy_module.c @@ -800,9 +800,11 @@ ngx_http_proxy_process_status_line(ngx_http_request_t *r) ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "upstream sent no valid HTTP/1.0 header"); +#if 0 if (u->accel) { return NGX_HTTP_UPSTREAM_INVALID_HEADER; } +#endif r->http_version = NGX_HTTP_VERSION_9; p->status = NGX_HTTP_OK; @@ -961,6 +963,10 @@ ngx_http_proxy_parse_status_line(ngx_http_request_t *r, ngx_http_proxy_ctx_t *p) /* HTTP status code */ case sw_status: + if (ch == ' ') { + break; + } + if (ch < '0' || ch > '9') { return NGX_HTTP_PROXY_PARSE_NO_HEADER; } @@ -1111,8 +1117,7 @@ ngx_http_proxy_process_header(ngx_http_request_t *r) /* there was error while a header line parsing */ ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - ngx_http_upstream_header_errors[rc - - NGX_HTTP_PARSE_HEADER_ERROR]); + "upstream sent invalid header"); return NGX_HTTP_UPSTREAM_INVALID_HEADER; } diff --git a/src/http/modules/perl/Makefile.PL b/src/http/modules/perl/Makefile.PL index 6fa3df744..48f1ebcd2 100644 --- a/src/http/modules/perl/Makefile.PL +++ b/src/http/modules/perl/Makefile.PL @@ -13,6 +13,7 @@ WriteMakefile( AUTHOR => 'Igor Sysoev', CCFLAGS => "$ENV{NGX_PERL_CFLAGS}", + OPTIMIZE => '-O', INC => "-I ../../../../../src/core " . "-I ../../../../../src/event " . diff --git a/src/http/modules/perl/ngx_http_perl_module.c b/src/http/modules/perl/ngx_http_perl_module.c index 069c21646..0a982e6e4 100644 --- a/src/http/modules/perl/ngx_http_perl_module.c +++ b/src/http/modules/perl/ngx_http_perl_module.c @@ -632,7 +632,7 @@ ngx_http_perl_call_handler(pTHX_ ngx_http_request_t *r, SV *sub, "call_sv: %d", status); } else { - line = POPpx; + line = SvPVx(POPs, n_a); rv->len = n_a; rv->data = ngx_palloc(r->pool, n_a); diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c index 7f19a4347..fb5dcb754 100644 --- a/src/http/ngx_http.c +++ b/src/http/ngx_http.c @@ -563,6 +563,8 @@ ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) virtual_names: + ngx_memzero(&ha, sizeof(ngx_hash_keys_arrays_t)); + ha.temp_pool = ngx_create_pool(16384, cf->log); if (ha.temp_pool == NULL) { return NGX_CONF_ERROR; @@ -578,6 +580,9 @@ ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) name = in_addr[a].names.elts; for (s = 0; s < in_addr[a].names.nelts; s++) { + ngx_log_error(NGX_LOG_ALERT, cf->log, 0, + "server name \"%V\"", &name[s].name); + ch = name[s].name.data[0]; if (ch == '*' || ch == '.') { @@ -600,6 +605,9 @@ ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) for (s = 0; s < in_addr[a].names.nelts; s++) { + ngx_log_error(NGX_LOG_ALERT, cf->log, 0, + "wildcard server name \"%V\"", &name[s].name); + ch = name[s].name.data[0]; if (ch != '*' && ch != '.') { diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index da142c381..26a1d6962 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -2243,6 +2243,10 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) ls->conf.rcvbuf = -1; ls->conf.sndbuf = -1; + if (inet_upstream.host.len == 1 && inet_upstream.host.data[0] == '*') { + inet_upstream.host.len = 0; + } + if (inet_upstream.host.len) { inet_upstream.host.data[inet_upstream.host.len] = '\0'; diff --git a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h index facd58ef6..8450b0434 100644 --- a/src/http/ngx_http_request.h +++ b/src/http/ngx_http_request.h @@ -37,7 +37,6 @@ #define NGX_HTTP_PARSE_INVALID_REQUEST 11 #define NGX_HTTP_PARSE_INVALID_09_METHOD 12 -#define NGX_HTTP_PARSE_HEADER_ERROR 13 #define NGX_HTTP_PARSE_INVALID_HEADER 13 #define NGX_HTTP_ZERO_IN_URI 1 diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c index e73b3b379..78608181d 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -259,12 +259,6 @@ static ngx_http_variable_t ngx_http_upstream_vars[] = { }; -char *ngx_http_upstream_header_errors[] = { - "upstream sent invalid header", - "upstream sent too long header line" -}; - - void ngx_http_upstream_init(ngx_http_request_t *r) { @@ -624,6 +618,7 @@ ngx_http_upstream_ssl_init_connection(ngx_http_request_t *r, } c->sendfile = 0; + u->output.sendfile = 0; peer = &u->peer.peers->peer[u->peer.cur_peer]; diff --git a/src/http/ngx_http_upstream.h b/src/http/ngx_http_upstream.h index 1b4795a31..a1780292c 100644 --- a/src/http/ngx_http_upstream.h +++ b/src/http/ngx_http_upstream.h @@ -199,7 +199,5 @@ void ngx_http_upstream_init(ngx_http_request_t *r); extern ngx_module_t ngx_http_upstream_module; -extern char *ngx_http_upstream_header_errors[]; - #endif /* _NGX_HTTP_UPSTREAM_H_INCLUDED_ */ |