diff options
author | Igor Sysoev <igor@sysoev.ru> | 2009-03-02 12:45:12 +0000 |
---|---|---|
committer | Jonathan Kolb <jon@b0g.us> | 2009-03-02 12:45:12 +0000 |
commit | 474ee942eeff6170c5ff14b5004b3152fa60dd8a (patch) | |
tree | e51e2867dffef5360929f9d62c565f5874317189 /src/http/ngx_http_request.c | |
parent | 4217ef32f69513d5b101fb2bcfddac19743351bf (diff) | |
download | nginx-474ee942eeff6170c5ff14b5004b3152fa60dd8a.tar.gz |
Changes with nginx 0.7.39 02 Mar 2009v0.7.39
*) Bugfix: large response with SSI might hang, if gzipping was enabled;
the bug had appeared in 0.7.28.
Thanks to Artem Bokhan.
*) Bugfix: a segmentation fault might occur in worker process, if short
static variants are used in a "try_files" directive.
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r-- | src/http/ngx_http_request.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index f03b574f9..faa8d7fa9 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -300,9 +300,6 @@ ngx_http_init_request(ngx_event_t *rev) port = c->listening->servers; - r->port = port->port; - r->port_text = &port->port_text; - r->connection = c; if (port->naddrs > 1) { @@ -373,13 +370,10 @@ ngx_http_init_request(ngx_event_t *rev) default: /* AF_INET */ addr = port->addrs; addr_conf = &addr[0].conf; - r->in_addr = addr[0].addr; break; } } - r->virtual_names = addr_conf->virtual_names; - /* the default server configuration for the address:port */ cscf = addr_conf->core_srv_conf; @@ -410,7 +404,7 @@ ngx_http_init_request(ngx_event_t *rev) } if (ngx_ssl_create_connection(&sscf->ssl, c, NGX_SSL_BUFFER) - == NGX_ERROR) + != NGX_OK) { ngx_http_close_connection(c); return; @@ -453,7 +447,7 @@ ngx_http_init_request(ngx_event_t *rev) if (ngx_list_init(&r->headers_out.headers, r->pool, 20, sizeof(ngx_table_elt_t)) - == NGX_ERROR) + != NGX_OK) { ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); return; @@ -813,7 +807,7 @@ ngx_http_process_request_line(ngx_event_t *rev) if (ngx_list_init(&r->headers_in.headers, r->pool, 20, sizeof(ngx_table_elt_t)) - == NGX_ERROR) + != NGX_OK) { ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); return; @@ -822,7 +816,7 @@ ngx_http_process_request_line(ngx_event_t *rev) if (ngx_array_init(&r->headers_in.cookies, r->pool, 2, sizeof(ngx_table_elt_t *)) - == NGX_ERROR) + != NGX_OK) { ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); return; @@ -1618,11 +1612,15 @@ ngx_http_find_virtual_server(ngx_http_request_t *r, u_char *host, size_t len) { u_char *server; ngx_uint_t hash; + ngx_http_virtual_names_t *vn; ngx_http_core_loc_conf_t *clcf; ngx_http_core_srv_conf_t *cscf; u_char buf[32]; - if (r->virtual_names == NULL) { + cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); + vn = cscf->virtual_names; + + if (vn == NULL) { return NGX_DECLINED; } @@ -1638,7 +1636,7 @@ ngx_http_find_virtual_server(ngx_http_request_t *r, u_char *host, size_t len) hash = ngx_hash_strlow(server, host, len); - cscf = ngx_hash_find_combined(&r->virtual_names->names, hash, server, len); + cscf = ngx_hash_find_combined(&vn->names, hash, server, len); if (cscf) { goto found; @@ -1646,7 +1644,7 @@ ngx_http_find_virtual_server(ngx_http_request_t *r, u_char *host, size_t len) #if (NGX_PCRE) - if (r->virtual_names->nregex) { + if (vn->nregex) { ngx_int_t n; ngx_uint_t i; ngx_str_t name; @@ -1655,9 +1653,9 @@ ngx_http_find_virtual_server(ngx_http_request_t *r, u_char *host, size_t len) name.len = len; name.data = server; - sn = r->virtual_names->regex; + sn = vn->regex; - for (i = 0; i < r->virtual_names->nregex; i++) { + for (i = 0; i < vn->nregex; i++) { n = ngx_regex_exec(sn[i].regex, &name, NULL, 0); |