]> git.kaiwu.me - nginx.git/commitdiff
Upstream: fixed "down" and "backup" parsing.
authorMaxim Dounin <mdounin@mdounin.ru>
Wed, 2 Oct 2013 11:07:15 +0000 (15:07 +0400)
committerMaxim Dounin <mdounin@mdounin.ru>
Wed, 2 Oct 2013 11:07:15 +0000 (15:07 +0400)
Previously arguments starting with "down" or "backup" were considered
valid, e.g. "server ... downFOO;".

src/http/ngx_http_upstream.c

index 4a4f8eba23fb07cd9c2a4b53d7c34a8b29fc7360..88d84c9ccc792c980e21d88698d89aad644d4db7 100644 (file)
@@ -4701,7 +4701,7 @@ ngx_http_upstream_server(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
             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, ngx_command_t *cmd, void *conf)
             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;