diff options
author | Igor Sysoev <igor@sysoev.ru> | 2003-10-29 08:30:44 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2003-10-29 08:30:44 +0000 |
commit | b5faed2dc853ee7e6bda6004b16ceedc6c194641 (patch) | |
tree | 7812abde1b258c5e751ac6a85072c792549d55f5 /src/http/ngx_http_special_response.c | |
parent | ab0c4f5038cec58e23a023d8a1e01be038504e3e (diff) | |
download | nginx-b5faed2dc853ee7e6bda6004b16ceedc6c194641.tar.gz nginx-b5faed2dc853ee7e6bda6004b16ceedc6c194641.zip |
nginx-0.0.1-2003-10-29-11:30:44 import
Diffstat (limited to 'src/http/ngx_http_special_response.c')
-rw-r--r-- | src/http/ngx_http_special_response.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/http/ngx_http_special_response.c b/src/http/ngx_http_special_response.c index c1a37f1ca..8f9d8ce7d 100644 --- a/src/http/ngx_http_special_response.c +++ b/src/http/ngx_http_special_response.c @@ -218,9 +218,11 @@ int ngx_http_special_response_handler(ngx_http_request_t *r, int error) + sizeof(error_tail) - 1 + sizeof(msie_stub) - 1; - ngx_test_null(r->headers_out.content_type, - ngx_push_table(r->headers_out.headers), - NGX_HTTP_INTERNAL_SERVER_ERROR); + if (!(r->headers_out.content_type = + ngx_http_add_header(&r->headers_out, ngx_http_headers_out))) + { + return NGX_ERROR; + } r->headers_out.content_type->key.len = 12; r->headers_out.content_type->key.data = "Content-Type"; @@ -245,7 +247,9 @@ int ngx_http_special_response_handler(ngx_http_request_t *r, int error) out = NULL; ll = NULL; - ngx_test_null(h, ngx_calloc_hunk(r->pool), NGX_ERROR); + if (!(h = ngx_calloc_hunk(r->pool))) { + return NGX_ERROR; + } h->type = NGX_HUNK_MEMORY|NGX_HUNK_IN_MEMORY; h->pos = error_pages[err].data; h->last = error_pages[err].data + error_pages[err].len; @@ -254,7 +258,9 @@ int ngx_http_special_response_handler(ngx_http_request_t *r, int error) ngx_chain_add_link(out, ll, cl); - ngx_test_null(h, ngx_calloc_hunk(r->pool), NGX_ERROR); + if (!(h = ngx_calloc_hunk(r->pool))) { + return NGX_ERROR; + } h->type = NGX_HUNK_MEMORY|NGX_HUNK_IN_MEMORY; h->pos = error_tail; h->last = error_tail + sizeof(error_tail) - 1; @@ -270,7 +276,9 @@ int ngx_http_special_response_handler(ngx_http_request_t *r, int error) && error != NGX_HTTP_REQUEST_URI_TOO_LARGE ) { - ngx_test_null(h, ngx_calloc_hunk(r->pool), NGX_ERROR); + if (!(h = ngx_calloc_hunk(r->pool))) { + return NGX_ERROR; + } h->type = NGX_HUNK_MEMORY|NGX_HUNK_IN_MEMORY; h->pos = msie_stub; h->last = msie_stub + sizeof(msie_stub) - 1; |