diff src/http/modules/ngx_http_range_filter.c @ 415:3c56e834be46

nginx-0.0.10-2004-09-05-23:54:02 import
author Igor Sysoev <igor@sysoev.ru>
date Sun, 05 Sep 2004 19:54:02 +0000
parents 2e3cbc1bbe3c
children b9bd635011de
line wrap: on
line diff
--- a/src/http/modules/ngx_http_range_filter.c
+++ b/src/http/modules/ngx_http_range_filter.c
@@ -123,9 +123,8 @@ static ngx_int_t ngx_http_range_header_f
         || ngx_strncasecmp(r->headers_in.range->value.data, "bytes=", 6) != 0)
     {
 
-        if (!(r->headers_out.accept_ranges =
-                   ngx_http_add_header(&r->headers_out, ngx_http_headers_out)))
-        {
+        r->headers_out.accept_ranges = ngx_push_list(&r->headers_out.headers);
+        if (r->headers_out.accept_ranges == NULL) {
             return NGX_ERROR;
         }
 
@@ -245,18 +244,19 @@ static ngx_int_t ngx_http_range_header_f
         r->headers_out.status = rc;
         r->headers_out.ranges.nelts = 0;
 
-        if (!(r->headers_out.content_range =
-                   ngx_http_add_header(&r->headers_out, ngx_http_headers_out)))
-        {
+        r->headers_out.content_range = ngx_push_list(&r->headers_out.headers);
+        if (r->headers_out.content_range == NULL) {
             return NGX_ERROR;
         }
 
         r->headers_out.content_range->key.len = sizeof("Content-Range") - 1;
         r->headers_out.content_range->key.data = (u_char *) "Content-Range";
 
-        ngx_test_null(r->headers_out.content_range->value.data,
-                      ngx_palloc(r->pool, 8 + 20 + 1),
-                      NGX_ERROR);
+        r->headers_out.content_range->value.data =
+                                               ngx_palloc(r->pool, 8 + 20 + 1);
+        if (r->headers_out.content_range->value.data == NULL) {
+            return NGX_ERROR;
+        }
 
         r->headers_out.content_range->value.len =
                 ngx_snprintf((char *) r->headers_out.content_range->value.data,
@@ -276,9 +276,9 @@ static ngx_int_t ngx_http_range_header_f
 
         if (r->headers_out.ranges.nelts == 1) {
 
-            if (!(r->headers_out.content_range =
-                   ngx_http_add_header(&r->headers_out, ngx_http_headers_out)))
-            {
+            r->headers_out.content_range =
+                                        ngx_push_list(&r->headers_out.headers);
+            if (r->headers_out.content_range == NULL) {
                 return NGX_ERROR;
             }