comparison src/http/ngx_http_header_filter.c @ 153:c71aeb75c071

nginx-0.0.1-2003-10-21-20:49:56 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 21 Oct 2003 16:49:56 +0000
parents ef8c87afcfc5
children 46eb23d9471d
comparison
equal deleted inserted replaced
152:fb48bf4fea1c 153:c71aeb75c071
157 if (r->headers_out.content_range && r->headers_out.content_range->value.len) 157 if (r->headers_out.content_range && r->headers_out.content_range->value.len)
158 { 158 {
159 len += 15 + r->headers_out.content_range->value.len + 2; 159 len += 15 + r->headers_out.content_range->value.len + 2;
160 } 160 }
161 161
162 if (r->headers_out.content_length >= 0) { 162 if (r->headers_out.content_length == NULL) {
163 /* "Content-Length: ... \r\n", 2^64 is 20 characters */ 163 if (r->headers_out.content_length_n >= 0) {
164 len += 48; 164 /* "Content-Length: ... \r\n", 2^64 is 20 characters */
165 len += 48;
166 }
165 } 167 }
166 168
167 if (r->headers_out.content_type && r->headers_out.content_type->value.len) { 169 if (r->headers_out.content_type && r->headers_out.content_type->value.len) {
168 r->headers_out.content_type->key.len = 0; 170 r->headers_out.content_type->key.len = 0;
169 len += 14 + r->headers_out.content_type->value.len + 2; 171 len += 14 + r->headers_out.content_type->value.len + 2;
258 h->last = ngx_cpymem(h->last, r->headers_out.content_range->value.data, 260 h->last = ngx_cpymem(h->last, r->headers_out.content_range->value.data,
259 r->headers_out.content_range->value.len); 261 r->headers_out.content_range->value.len);
260 *(h->last++) = CR; *(h->last++) = LF; 262 *(h->last++) = CR; *(h->last++) = LF;
261 } 263 }
262 264
263 /* 2^64 is 20 characters */ 265 if (r->headers_out.content_length == NULL) {
264 if (r->headers_out.content_length >= 0) { 266 /* 2^64 is 20 characters */
265 h->last += ngx_snprintf(h->last, 49, 267 if (r->headers_out.content_length_n >= 0) {
266 "Content-Length: " OFF_FMT CRLF, 268 h->last += ngx_snprintf(h->last, 49,
267 r->headers_out.content_length); 269 "Content-Length: " OFF_FMT CRLF,
270 r->headers_out.content_length_n);
271 }
268 } 272 }
269 273
270 if (r->headers_out.content_type && r->headers_out.content_type->value.len) { 274 if (r->headers_out.content_type && r->headers_out.content_type->value.len) {
271 h->last = ngx_cpymem(h->last, "Content-Type: ", 14); 275 h->last = ngx_cpymem(h->last, "Content-Type: ", 14);
272 h->last = ngx_cpymem(h->last, r->headers_out.content_type->value.data, 276 h->last = ngx_cpymem(h->last, r->headers_out.content_type->value.data,