[nginx] Upstream: fixed "down" and "backup" parsing.
    Maxim Dounin 
    mdounin at mdounin.ru
       
    Wed Oct  2 11:08:38 UTC 2013
    
    
  
details:   http://hg.nginx.org/nginx/rev/16b68c724438
branches:  
changeset: 5410:16b68c724438
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Wed Oct 02 15:07:15 2013 +0400
description:
Upstream: fixed "down" and "backup" parsing.
Previously arguments starting with "down" or "backup" were considered
valid, e.g. "server ... downFOO;".
diffstat:
 src/http/ngx_http_upstream.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diffs (21 lines):
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -4701,7 +4701,7 @@ ngx_http_upstream_server(ngx_conf_t *cf,
             continue;
         }
 
-        if (ngx_strncmp(value[i].data, "backup", 6) == 0) {
+        if (ngx_strcmp(value[i].data, "backup") == 0) {
 
             if (!(uscf->flags & NGX_HTTP_UPSTREAM_BACKUP)) {
                 goto invalid;
@@ -4712,7 +4712,7 @@ ngx_http_upstream_server(ngx_conf_t *cf,
             continue;
         }
 
-        if (ngx_strncmp(value[i].data, "down", 4) == 0) {
+        if (ngx_strcmp(value[i].data, "down") == 0) {
 
             if (!(uscf->flags & NGX_HTTP_UPSTREAM_DOWN)) {
                 goto invalid;
    
    
More information about the nginx-devel
mailing list