]> git.kaiwu.me - nginx.git/commitdiff
Merge of r4381, r4400:
authorMaxim Dounin <mdounin@mdounin.ru>
Sun, 5 Feb 2012 15:47:58 +0000 (15:47 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Sun, 5 Feb 2012 15:47:58 +0000 (15:47 +0000)
Fixed limit_conn_log_level/limit_req_log_level inheritance.  The
directives did not work if there were no limit_conn/limit_req
specified on the same level.

The code for limit_conn is different in 1.0.x, conflict resolved
manually.

src/http/modules/ngx_http_limit_req_module.c
src/http/modules/ngx_http_limit_zone_module.c

index 718fae8e2e29c8e37578ed73ff4b78c05032d4d2..779b397c2dd3e00626e20a71056e2055e22ac165 100644 (file)
@@ -569,7 +569,9 @@ 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;
+        conf->burst = prev->burst;
+        conf->nodelay = prev->nodelay;
     }
 
     ngx_conf_merge_uint_value(conf->limit_log_level, prev->limit_log_level,
index 31df316e4838036d6552b6aa45ac5aac8777cc4e..ea780cfca932492c027580fbbbbfd9c6709140d1 100644 (file)
@@ -421,7 +421,8 @@ ngx_http_limit_zone_merge_conf(ngx_conf_t *cf, void *parent, void *child)
     ngx_http_limit_zone_conf_t *conf = child;
 
     if (conf->shm_zone == NULL) {
-        *conf = *prev;
+        conf->shm_zone = prev->shm_zone;
+        conf->conn = prev->conn;
     }
 
     ngx_conf_merge_uint_value(conf->log_level, prev->log_level, NGX_LOG_ERR);