diff src/http/ngx_http_special_response.c @ 164:84036764e215

nginx-0.0.1-2003-10-29-11:30:44 import
author Igor Sysoev <igor@sysoev.ru>
date Wed, 29 Oct 2003 08:30:44 +0000
parents 96993d4d5067
children 894a01c6aea3
line wrap: on
line diff
--- 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(ng
                                           + 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(ng
     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(ng
     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(ng
         && 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;