diff options
author | Igor Sysoev <igor@sysoev.ru> | 2005-03-19 15:38:37 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2005-03-19 15:38:37 +0300 |
commit | c15717285d2157a603bb1b130b26d7baa549be7e (patch) | |
tree | 56dc8346b22bb2660eecd3bc086d263ac6d67326 /src/http/ngx_http_special_response.c | |
parent | e12fbfe82a176cd386cdcecfeabf43ac8fd870a4 (diff) |
nginx-0.1.25-RELEASE importrelease-0.1.25
*) Bugfix: nginx did run on Linux parisc.
*) Feature: nginx now does not start under FreeBSD if the sysctl
kern.ipc.somaxconn value is too big.
*) Bugfix: if a request was internally redirected by the
ngx_http_index_module module to the ngx_http_proxy_module or
ngx_http_fastcgi_module modules, then the index file was not closed
after request completion.
*) Feature: the "proxy_pass" can be used in location with regular
expression.
*) Feature: the ngx_http_rewrite_filter_module module supports the
condition like "if ($HTTP_USER_AGENT ~ MSIE)".
*) Bugfix: nginx started too slow if the large number of addresses and
text values were used in the "geo" directive.
*) Change: a variable name must be declared as "$name" in the "geo"
directive. The previous variant without "$" is still supported, but
will be removed soon.
*) Feature: the "%{VARIABLE}v" logging parameter.
*) Feature: the "set $name value" directive.
*) Bugfix: gcc 4.0 compatibility.
*) Feature: the --with-openssl-opt=OPTIONS autoconfiguration directive.
Diffstat (limited to 'src/http/ngx_http_special_response.c')
-rw-r--r-- | src/http/ngx_http_special_response.c | 55 |
1 files changed, 38 insertions, 17 deletions
diff --git a/src/http/ngx_http_special_response.c b/src/http/ngx_http_special_response.c index 572ad0a9b..44da5f388 100644 --- a/src/http/ngx_http_special_response.c +++ b/src/http/ngx_http_special_response.c @@ -17,7 +17,7 @@ static u_char error_tail[] = ; -static u_char msie_stub[] = +static u_char ngx_http_msie_stub[] = "<!-- The padding to disable MSIE's friendly error page -->" CRLF "<!-- The padding to disable MSIE's friendly error page -->" CRLF "<!-- The padding to disable MSIE's friendly error page -->" CRLF @@ -234,9 +234,9 @@ ngx_int_t ngx_http_special_response_handler(ngx_http_request_t *r, ngx_int_t error) { ngx_int_t rc; - ngx_uint_t err, i, msie_padding; + ngx_uint_t i, err, msie_padding; ngx_buf_t *b; - ngx_chain_t *out, **ll, *cl; + ngx_chain_t *out, *cl; ngx_http_err_page_t *err_page; ngx_http_core_loc_conf_t *clcf; @@ -327,7 +327,7 @@ ngx_http_special_response_handler(ngx_http_request_t *r, ngx_int_t error) && error >= NGX_HTTP_BAD_REQUEST && error != NGX_HTTP_REQUEST_URI_TOO_LARGE) { - r->headers_out.content_length_n += sizeof(msie_stub) - 1; + r->headers_out.content_length_n += sizeof(ngx_http_msie_stub) - 1; msie_padding = 1; } @@ -360,43 +360,64 @@ ngx_http_special_response_handler(ngx_http_request_t *r, ngx_int_t error) return NGX_OK; } - out = NULL; - ll = NULL; - if (!(b = ngx_calloc_buf(r->pool))) { + b = ngx_calloc_buf(r->pool); + if (b == NULL) { return NGX_ERROR; } + b->memory = 1; b->pos = error_pages[err].data; b->last = error_pages[err].data + error_pages[err].len; - ngx_alloc_link_and_set_buf(cl, b, r->pool, NGX_ERROR); - ngx_chain_add_link(out, ll, cl); + cl = ngx_alloc_chain_link(r->pool); + if (cl == NULL) { + return NGX_ERROR; + } + + cl->buf = b; + out = cl; - if (!(b = ngx_calloc_buf(r->pool))) { + b = ngx_calloc_buf(r->pool); + if (b == NULL) { return NGX_ERROR; } + b->memory = 1; b->pos = error_tail; b->last = error_tail + sizeof(error_tail) - 1; - ngx_alloc_link_and_set_buf(cl, b, r->pool, NGX_ERROR); - ngx_chain_add_link(out, ll, cl); + cl->next = ngx_alloc_chain_link(r->pool); + if (cl->next == NULL) { + return NGX_ERROR; + } + + cl = cl->next; + cl->buf = b; if (msie_padding) { - if (!(b = ngx_calloc_buf(r->pool))) { + b = ngx_calloc_buf(r->pool); + if (b == NULL) { return NGX_ERROR; } + b->memory = 1; - b->pos = msie_stub; - b->last = msie_stub + sizeof(msie_stub) - 1; + b->pos = ngx_http_msie_stub; + b->last = ngx_http_msie_stub + sizeof(ngx_http_msie_stub) - 1; + + cl->next = ngx_alloc_chain_link(r->pool); + if (cl->next == NULL) { + return NGX_ERROR; + } - ngx_alloc_link_and_set_buf(cl, b, r->pool, NGX_ERROR); - ngx_chain_add_link(out, ll, cl); + cl = cl->next; + cl->buf = b; } b->last_buf = 1; + cl->next = NULL; + return ngx_http_output_filter(r, out); } |