comparison src/http/ngx_http_header_filter_module.c @ 3516:dd1570b6f237

ngx_str_set() and ngx_str_null()
author Igor Sysoev <igor@sysoev.ru>
date Fri, 14 May 2010 09:56:37 +0000
parents 192b727c2563
children 3a64bdacf1e4
comparison
equal deleted inserted replaced
3515:76d252724db5 3516:dd1570b6f237
216 { 216 {
217 /* 2XX */ 217 /* 2XX */
218 218
219 if (status == NGX_HTTP_NO_CONTENT) { 219 if (status == NGX_HTTP_NO_CONTENT) {
220 r->header_only = 1; 220 r->header_only = 1;
221 r->headers_out.content_type.len = 0; 221 ngx_str_null(&r->headers_out.content_type);
222 r->headers_out.content_type.data = NULL;
223 r->headers_out.last_modified_time = -1; 222 r->headers_out.last_modified_time = -1;
224 r->headers_out.last_modified = NULL; 223 r->headers_out.last_modified = NULL;
225 r->headers_out.content_length = NULL; 224 r->headers_out.content_length = NULL;
226 r->headers_out.content_length_n = -1; 225 r->headers_out.content_length_n = -1;
227 } 226 }
369 if (port) { 368 if (port) {
370 len += sizeof(":65535") - 1; 369 len += sizeof(":65535") - 1;
371 } 370 }
372 371
373 } else { 372 } else {
374 host.len = 0; 373 ngx_str_null(&host);
375 host.data = NULL;
376 port = 0; 374 port = 0;
377 } 375 }
378 376
379 if (r->chunked) { 377 if (r->chunked) {
380 len += sizeof("Transfer-Encoding: chunked" CRLF) - 1; 378 len += sizeof("Transfer-Encoding: chunked" CRLF) - 1;
537 535
538 /* update r->headers_out.location->value for possible logging */ 536 /* update r->headers_out.location->value for possible logging */
539 537
540 r->headers_out.location->value.len = b->last - p; 538 r->headers_out.location->value.len = b->last - p;
541 r->headers_out.location->value.data = p; 539 r->headers_out.location->value.data = p;
542 r->headers_out.location->key.len = sizeof("Location") - 1; 540 ngx_str_set(&r->headers_out.location->key, "Location");
543 r->headers_out.location->key.data = (u_char *) "Location";
544 541
545 *b->last++ = CR; *b->last++ = LF; 542 *b->last++ = CR; *b->last++ = LF;
546 } 543 }
547 544
548 if (r->chunked) { 545 if (r->chunked) {