diff src/http/ngx_http_upstream.c @ 372:6639b93e81b2 NGINX_0_6_30

nginx 0.6.30 *) Change: now if an "include" directive pattern does not match any file, then nginx does not issue an error. *) Feature: now the time in directives may be specified without spaces, for example, "1h50m". *) Bugfix: memory leaks if the "ssl_verify_client" directive was on. Thanks to Chavelle Vincent. *) Bugfix: the "sub_filter" directive might set text to change into output. *) Bugfix: the "error_page" directive did not take into account arguments in redirected URI. *) Bugfix: now nginx always opens files in binary mode under Cygwin. *) Bugfix: nginx could not be built on OpenBSD; bug appeared in 0.6.15.
author Igor Sysoev <http://sysoev.ru>
date Tue, 29 Apr 2008 00:00:00 +0400
parents 9a242235a80a
children 984bb0b1399b
line wrap: on
line diff
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -333,7 +333,6 @@ ngx_http_upstream_init(ngx_http_request_
 
     clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
 
-    u->output.sendfile = c->sendfile;
     u->output.pool = r->pool;
     u->output.bufs.num = 1;
     u->output.bufs.size = clcf->client_body_buffer_size;
@@ -422,13 +421,14 @@ ngx_http_upstream_init(ngx_http_request_
         ctx->data = r;
         ctx->timeout = clcf->resolver_timeout;
 
+        u->resolved->ctx = ctx;
+
         if (ngx_resolve_name(ctx) != NGX_OK) {
+            u->resolved->ctx = NULL;
             ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
             return;
         }
 
-        u->resolved->ctx = ctx;
-
         return;
     }
 
@@ -702,6 +702,7 @@ ngx_http_upstream_connect(ngx_http_reque
     c->read->handler = ngx_http_upstream_process_header;
 
     c->sendfile &= r->connection->sendfile;
+    u->output.sendfile = c->sendfile;
 
     c->pool = r->pool;
     c->read->log = c->write->log = c->log = r->connection->log;
@@ -2612,6 +2613,10 @@ ngx_http_upstream_copy_content_type(ngx_
 
         while (*++p == ' ') { /* void */ }
 
+        if (*p == '\0') {
+            return NGX_OK;
+        }
+
         if (ngx_strncasecmp(p, (u_char *) "charset=", 8) != 0) {
             continue;
         }
@@ -3200,7 +3205,7 @@ ngx_http_upstream_server(ngx_conf_t *cf,
 
             fail_timeout = ngx_parse_time(&s, 1);
 
-            if (fail_timeout < 0) {
+            if (fail_timeout == NGX_ERROR) {
                 goto invalid;
             }