[nginx] svn commit: r4350 - in branches/stable-1.0: . src/http

mdounin at mdounin.ru mdounin at mdounin.ru
Tue Dec 13 18:34:35 UTC 2011


Author: mdounin
Date: 2011-12-13 18:34:34 +0000 (Tue, 13 Dec 2011)
New Revision: 4350

Log:
Merge of r4153:

Better handling of late upstream creation.

Configuration with duplicate upstream blocks defined after first use, i.e.
like

    server {
        ...
        location / {
            proxy_pass http://backend;
        }
    }

    upstream backend { ... }
    upstream backend { ... }

now correctly results in "duplicate upstream" error.

Additionally, upstream blocks defined after first use now handle various
server directive parameters ("weight", "max_fails", etc.).  Previously
configuration like

    server {
        ...
        location / {
            proxy_pass http://backend;
        }
    }

    upstream backend {
        server 127.0.0.1 max_fails=5;
    }

incorrectly resulted in "invalid parameter "max_fails=5"" error.


Modified:
   branches/stable-1.0/
   branches/stable-1.0/src/http/ngx_http_upstream.c


Property changes on: branches/stable-1.0
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4152,4154-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4219-4220,4229-4230,4232,4235-4237,4265,4268,4280,4283,4321,4342-4343
   + /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4219-4220,4229-4230,4232,4235-4237,4265,4268,4280,4283,4321,4342-4343

Modified: branches/stable-1.0/src/http/ngx_http_upstream.c
===================================================================
--- branches/stable-1.0/src/http/ngx_http_upstream.c	2011-12-13 18:30:15 UTC (rev 4349)
+++ branches/stable-1.0/src/http/ngx_http_upstream.c	2011-12-13 18:34:34 UTC (rev 4350)
@@ -4280,6 +4280,10 @@
             continue;
         }
 
+        if (flags & NGX_HTTP_UPSTREAM_CREATE) {
+            uscfp[i]->flags = flags;
+        }
+
         return uscfp[i];
     }
 



More information about the nginx-devel mailing list