Upstream: fixed "down" and "backup" parsing.

Previously arguments starting with "down" or "backup" were considered
valid, e.g. "server ... downFOO;".
This commit is contained in:
Maxim Dounin
2013-10-02 15:07:15 +04:00
parent cfb2b55e8d
commit 31d023e53e

View 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;