]> git.kaiwu.me - nginx.git/commitdiff
Fixed limit_conn_log_level/limit_req_log_level inheritance.
authorValentin Bartenev <vbart@nginx.com>
Sun, 25 Dec 2011 19:32:31 +0000 (19:32 +0000)
committerValentin Bartenev <vbart@nginx.com>
Sun, 25 Dec 2011 19:32:31 +0000 (19:32 +0000)
The directives did not work if there were no limit_conn/limit_req specified on
the same level.

src/http/modules/ngx_http_limit_conn_module.c
src/http/modules/ngx_http_limit_req_module.c

index a84d54d7ea01756a228d569ad7ad4daca53eb85f..40f05a22eee17914e21f13d0bcb111fc9184ecef 100644 (file)
@@ -483,7 +483,7 @@ ngx_http_limit_conn_merge_conf(ngx_conf_t *cf, void *parent, void *child)
     ngx_http_limit_conn_conf_t *conf = child;
 
     if (conf->limits.elts == NULL) {
-        *conf = *prev;
+        conf->limits = prev->limits;
     }
 
     ngx_conf_merge_uint_value(conf->log_level, prev->log_level, NGX_LOG_ERR);
index 718fae8e2e29c8e37578ed73ff4b78c05032d4d2..865f7666dba6c0b78f37f5b5f805e3abdcdd57af 100644 (file)
@@ -569,7 +569,7 @@ ngx_http_limit_req_merge_conf(ngx_conf_t *cf, void *parent, void *child)
     ngx_http_limit_req_conf_t *conf = child;
 
     if (conf->shm_zone == NULL) {
-        *conf = *prev;
+        conf->shm_zone = prev->shm_zone;
     }
 
     ngx_conf_merge_uint_value(conf->limit_log_level, prev->limit_log_level,