comparison src/http/ngx_http_header_filter.c @ 4:4b2dafa26fe2 NGINX_0_1_2

nginx 0.1.2 *) Feature: the --user=USER, --group=GROUP, and --with-ld-opt=OPTIONS options in configure. *) Feature: the server_name directive supports *.domain.tld. *) Bugfix: the portability improvements. *) Bugfix: if configuration file was set in command line, the reconfiguration was impossible; bug appeared in 0.1.1. *) Bugfix: proxy module may get caught in an endless loop when sendfile is not used. *) Bugfix: with sendfile the response was not recoded according to the charset module directives; bug appeared in 0.1.1. *) Bugfix: very seldom bug in the kqueue processing. *) Bugfix: the gzip module compressed the proxied responses that was already compressed.
author Igor Sysoev <http://sysoev.ru>
date Thu, 21 Oct 2004 00:00:00 +0400
parents cc9f381affaa
children 80ba094c6b3e
comparison
equal deleted inserted replaced
3:8beaf7b3241f 4:4b2dafa26fe2
315 *(b->last++) = CR; *(b->last++) = LF; 315 *(b->last++) = CR; *(b->last++) = LF;
316 } 316 }
317 317
318 if (r->headers_out.content_length == NULL) { 318 if (r->headers_out.content_length == NULL) {
319 if (r->headers_out.content_length_n >= 0) { 319 if (r->headers_out.content_length_n >= 0) {
320 b->last = ngx_sprintf(b->last, "Content-Length: %O" CRLF,
321 r->headers_out.content_length_n);
322
323 #if 0
320 b->last += ngx_snprintf((char *) b->last, 324 b->last += ngx_snprintf((char *) b->last,
321 sizeof("Content-Length: ") + NGX_OFF_T_LEN + 2, 325 sizeof("Content-Length: ") + NGX_OFF_T_LEN + 2,
322 "Content-Length: " OFF_T_FMT CRLF, 326 "Content-Length: " OFF_T_FMT CRLF,
323 r->headers_out.content_length_n); 327 r->headers_out.content_length_n);
328 #endif
324 } 329 }
325 } 330 }
326 331
327 if (r->headers_out.content_type && r->headers_out.content_type->value.len) { 332 if (r->headers_out.content_type && r->headers_out.content_type->value.len) {
328 b->last = ngx_cpymem(b->last, "Content-Type: ", 333 b->last = ngx_cpymem(b->last, "Content-Type: ",
370 if (!(r->headers_out.last_modified && r->headers_out.last_modified->key.len) 375 if (!(r->headers_out.last_modified && r->headers_out.last_modified->key.len)
371 && r->headers_out.last_modified_time != -1) 376 && r->headers_out.last_modified_time != -1)
372 { 377 {
373 b->last = ngx_cpymem(b->last, "Last-Modified: ", 378 b->last = ngx_cpymem(b->last, "Last-Modified: ",
374 sizeof("Last-Modified: ") - 1); 379 sizeof("Last-Modified: ") - 1);
375 b->last += ngx_http_time(b->last, r->headers_out.last_modified_time); 380 b->last = ngx_http_time(b->last, r->headers_out.last_modified_time);
376 381
377 *(b->last++) = CR; *(b->last++) = LF; 382 *(b->last++) = CR; *(b->last++) = LF;
378 } 383 }
379 384
380 if (r->chunked) { 385 if (r->chunked) {
387 sizeof("Connection: keep-alive" CRLF) - 1); 392 sizeof("Connection: keep-alive" CRLF) - 1);
388 393
389 if (clcf->keepalive_header 394 if (clcf->keepalive_header
390 && (r->headers_in.gecko || r->headers_in.konqueror)) 395 && (r->headers_in.gecko || r->headers_in.konqueror))
391 { 396 {
397 b->last = ngx_sprintf(b->last, "Keep-Alive: timeout=%T" CRLF,
398 clcf->keepalive_header);
399 #if 0
392 b->last += ngx_snprintf((char *) b->last, 400 b->last += ngx_snprintf((char *) b->last,
393 sizeof("Keep-Alive: timeout=") + TIME_T_LEN + 2, 401 sizeof("Keep-Alive: timeout=") + TIME_T_LEN + 2,
394 "Keep-Alive: timeout=" TIME_T_FMT CRLF, 402 "Keep-Alive: timeout=" TIME_T_FMT CRLF,
395 clcf->keepalive_header); 403 clcf->keepalive_header);
404 #endif
396 } 405 }
397 406
398 } else { 407 } else {
399 b->last = ngx_cpymem(b->last, "Connection: close" CRLF, 408 b->last = ngx_cpymem(b->last, "Connection: close" CRLF,
400 sizeof("Connection: close" CRLF) - 1); 409 sizeof("Connection: close" CRLF) - 1);