Mercurial > hg > nginx-vendor-1-0
comparison src/http/ngx_http_upstream.c @ 326:9fc4ab6673f9 NGINX_0_6_7
nginx 0.6.7
*) Change: now the paths specified in the "include",
"auth_basic_user_file", "perl_modules", "ssl_certificate",
"ssl_certificate_key", and "ssl_client_certificate" directives are
relative to directory of nginx configuration file nginx.conf, but
not to nginx prefix directory.
*) Change: the --sysconfdir=PATH option in configure was canceled.
*) Change: the special make target "upgrade1" was defined for online
upgrade of 0.1.x versions.
*) Feature: the "server_name" and "valid_referers" directives support
regular expressions.
*) Feature: the "server" directive in the "upstream" context supports
the "backup" parameter.
*) Feature: the ngx_http_perl_module supports the
$r->discard_request_body.
*) Feature: the "add_header Last-Modified ..." directive changes the
"Last-Modified" response header line.
*) Bugfix: if an response different than 200 was returned to an request
with body and connection went to the keep-alive state after the
request, then nginx returned 400 for the next request.
*) Bugfix: a segmentation fault occurred in worker process if invalid
address was set in the "auth_http" directive.
*) Bugfix: now nginx uses default listen backlog value 511 on all
platforms except FreeBSD.
Thanks to Jiang Hong.
*) Bugfix: a worker process may got caught in an endless loop, if an
"server" inside "upstream" block was marked as "down"; bug appeared
in 0.6.6.
*) Bugfix: now Solaris sendfilev() is not used to transfer the client
request body to FastCGI-server via the unix domain socket.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Wed, 15 Aug 2007 00:00:00 +0400 |
parents | f7cd062ee035 |
children | 1c519aff5c0c |
comparison
equal
deleted
inserted
replaced
325:f395c7a4c8a8 | 326:9fc4ab6673f9 |
---|---|
563 | 563 |
564 u->state->peer = u->peer.name; | 564 u->state->peer = u->peer.name; |
565 | 565 |
566 if (rc == NGX_BUSY) { | 566 if (rc == NGX_BUSY) { |
567 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "no live upstreams"); | 567 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "no live upstreams"); |
568 } | 568 ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_NOLIVE); |
569 | 569 return; |
570 if (rc == NGX_BUSY || rc == NGX_DECLINED) { | 570 } |
571 | |
572 if (rc == NGX_DECLINED) { | |
571 ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_ERROR); | 573 ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_ERROR); |
572 return; | 574 return; |
573 } | 575 } |
574 | 576 |
575 /* rc == NGX_OK || rc == NGX_AGAIN */ | 577 /* rc == NGX_OK || rc == NGX_AGAIN */ |
579 c->data = r; | 581 c->data = r; |
580 | 582 |
581 c->write->handler = ngx_http_upstream_send_request_handler; | 583 c->write->handler = ngx_http_upstream_send_request_handler; |
582 c->read->handler = ngx_http_upstream_process_header; | 584 c->read->handler = ngx_http_upstream_process_header; |
583 | 585 |
584 c->sendfile = r->connection->sendfile; | 586 c->sendfile &= r->connection->sendfile; |
585 | 587 |
586 c->pool = r->pool; | 588 c->pool = r->pool; |
587 c->read->log = c->write->log = c->log = r->connection->log; | 589 c->read->log = c->write->log = c->log = r->connection->log; |
588 | 590 |
589 /* init or reinit the ngx_output_chain() and ngx_chain_writer() contexts */ | 591 /* init or reinit the ngx_output_chain() and ngx_chain_writer() contexts */ |
2151 state = NGX_PEER_NEXT; | 2153 state = NGX_PEER_NEXT; |
2152 } else { | 2154 } else { |
2153 state = NGX_PEER_FAILED; | 2155 state = NGX_PEER_FAILED; |
2154 } | 2156 } |
2155 | 2157 |
2156 u->peer.free(&u->peer, u->peer.data, state); | 2158 if (ft_type != NGX_HTTP_UPSTREAM_FT_NOLIVE) { |
2159 u->peer.free(&u->peer, u->peer.data, state); | |
2160 } | |
2157 | 2161 |
2158 if (ft_type == NGX_HTTP_UPSTREAM_FT_TIMEOUT) { | 2162 if (ft_type == NGX_HTTP_UPSTREAM_FT_TIMEOUT) { |
2159 ngx_log_error(NGX_LOG_ERR, r->connection->log, NGX_ETIMEDOUT, | 2163 ngx_log_error(NGX_LOG_ERR, r->connection->log, NGX_ETIMEDOUT, |
2160 "upstream timed out"); | 2164 "upstream timed out"); |
2161 } | 2165 } |
3116 } | 3120 } |
3117 | 3121 |
3118 continue; | 3122 continue; |
3119 } | 3123 } |
3120 | 3124 |
3125 if (ngx_strncmp(value[i].data, "backup", 6) == 0) { | |
3126 | |
3127 if (!(uscf->flags & NGX_HTTP_UPSTREAM_BACKUP)) { | |
3128 goto invalid; | |
3129 } | |
3130 | |
3131 us->backup = 1; | |
3132 | |
3133 continue; | |
3134 } | |
3135 | |
3121 if (ngx_strncmp(value[i].data, "down", 4) == 0) { | 3136 if (ngx_strncmp(value[i].data, "down", 4) == 0) { |
3122 | 3137 |
3123 if (!(uscf->flags & NGX_HTTP_UPSTREAM_DOWN)) { | 3138 if (!(uscf->flags & NGX_HTTP_UPSTREAM_DOWN)) { |
3124 goto invalid; | 3139 goto invalid; |
3125 } | 3140 } |