comparison src/http/ngx_http_upstream.c @ 482:392c16f2d858 NGINX_0_7_53

nginx 0.7.53 *) Change: now a log set by --error-log-path is created from the very start-up. *) Feature: now the start up errors and warnings are outputted to an error_log and stderr. *) Feature: the empty --prefix= configure parameter forces nginx to use a directory where it was run as prefix. *) Feature: the -p switch. *) Feature: the -s switch on Unix platforms. *) Feature: the -? and -h switches. Thanks to Jerome Loyet. *) Feature: now switches may be set in condensed form. *) Bugfix: nginx/Windows did not work if configuration file was given by the -c switch. *) Bugfix: temporary files might be not removed if the "proxy_store", "fastcgi_store", "proxy_cache", or "fastcgi_cache" were used. Thanks to Maxim Dounin. *) Bugfix: an incorrect value was passed to mail proxy authentication server in "Auth-Method" header line; the bug had appeared in 0.7.34. Thanks to Simon Lecaille. *) Bugfix: system error text descriptions were not logged on Linux; the bug had appeared in 0.7.45. *) Bugfix: the "fastcgi_cache_min_uses" directive did not work. Thanks to Andrew Vorobyoff.
author Igor Sysoev <http://sysoev.ru>
date Mon, 27 Apr 2009 00:00:00 +0400
parents 549994537f15
children ed5e10fb40fc
comparison
equal deleted inserted replaced
481:0c98173187ac 482:392c16f2d858
351 ngx_del_timer(c->read); 351 ngx_del_timer(c->read);
352 } 352 }
353 353
354 u = r->upstream; 354 u = r->upstream;
355 355
356 if (!r->post_action && !u->conf->ignore_client_abort) { 356 u->store = (u->conf->store || u->conf->store_lengths);
357
358 if (!u->store && !r->post_action && !u->conf->ignore_client_abort) {
357 r->read_event_handler = ngx_http_upstream_rd_check_broken_connection; 359 r->read_event_handler = ngx_http_upstream_rd_check_broken_connection;
358 r->write_event_handler = ngx_http_upstream_wr_check_broken_connection; 360 r->write_event_handler = ngx_http_upstream_wr_check_broken_connection;
359 } 361 }
360 362
361 if (ngx_event_flags & NGX_USE_CLEAR_EVENT) { 363 if (ngx_event_flags & NGX_USE_CLEAR_EVENT) {
437 439
438 cln->handler = ngx_http_upstream_cleanup; 440 cln->handler = ngx_http_upstream_cleanup;
439 cln->data = r; 441 cln->data = r;
440 u->cleanup = &cln->handler; 442 u->cleanup = &cln->handler;
441 443
442 u->store = (u->conf->store || u->conf->store_lengths);
443
444 if (u->resolved == NULL) { 444 if (u->resolved == NULL) {
445 445
446 uscf = u->conf->upstream; 446 uscf = u->conf->upstream;
447 447
448 } else { 448 } else {
777 777
778 c = r->connection; 778 c = r->connection;
779 u = r->upstream; 779 u = r->upstream;
780 780
781 if (c->error) { 781 if (c->error) {
782 ngx_http_upstream_finalize_request(r, u, 782 if (!u->cacheable) {
783 NGX_HTTP_CLIENT_CLOSED_REQUEST); 783 ngx_http_upstream_finalize_request(r, u,
784 NGX_HTTP_CLIENT_CLOSED_REQUEST);
785 }
784 return; 786 return;
785 } 787 }
786 788
787 if (u->peer.connection == NULL) { 789 if (u->peer.connection == NULL) {
788 return; 790 return;
801 803
802 if (ev->kq_errno) { 804 if (ev->kq_errno) {
803 ev->error = 1; 805 ev->error = 1;
804 } 806 }
805 807
806 if (!u->cacheable && !u->store && u->peer.connection) { 808 if (!u->cacheable && u->peer.connection) {
807 ngx_log_error(NGX_LOG_INFO, ev->log, ev->kq_errno, 809 ngx_log_error(NGX_LOG_INFO, ev->log, ev->kq_errno,
808 "kevent() reported that client closed prematurely " 810 "kevent() reported that client closed prematurely "
809 "connection, so upstream connection is closed too"); 811 "connection, so upstream connection is closed too");
810 ngx_http_upstream_finalize_request(r, u, 812 ngx_http_upstream_finalize_request(r, u,
811 NGX_HTTP_CLIENT_CLOSED_REQUEST); 813 NGX_HTTP_CLIENT_CLOSED_REQUEST);
867 } 869 }
868 870
869 ev->eof = 1; 871 ev->eof = 1;
870 c->error = 1; 872 c->error = 1;
871 873
872 if (!u->cacheable && !u->store && u->peer.connection) { 874 if (!u->cacheable && u->peer.connection) {
873 ngx_log_error(NGX_LOG_INFO, ev->log, err, 875 ngx_log_error(NGX_LOG_INFO, ev->log, err,
874 "client closed prematurely connection, " 876 "client closed prematurely connection, "
875 "so upstream connection is closed too"); 877 "so upstream connection is closed too");
876 ngx_http_upstream_finalize_request(r, u, 878 ngx_http_upstream_finalize_request(r, u,
877 NGX_HTTP_CLIENT_CLOSED_REQUEST); 879 NGX_HTTP_CLIENT_CLOSED_REQUEST);
2484 2486
2485 if (p->downstream_error) { 2487 if (p->downstream_error) {
2486 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 2488 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
2487 "http upstream downstream error"); 2489 "http upstream downstream error");
2488 2490
2489 if (!u->cacheable && u->peer.connection) { 2491 if (!u->cacheable && !u->store && u->peer.connection) {
2490 ngx_http_upstream_finalize_request(r, u, 0); 2492 ngx_http_upstream_finalize_request(r, u, 0);
2491 } 2493 }
2492 } 2494 }
2493 } 2495 }
2494 2496