Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions ngx_http_limit_traffic_rate_filter_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ ngx_http_limit_traffic_rate_filter_handler(ngx_http_request_t *r)
lir->conn++;
ngx_http_limit_traffic_rate_filter_request_queue_t *req;
req = ngx_slab_alloc_locked(shpool, sizeof(ngx_http_limit_traffic_rate_filter_request_queue_t));
if (node == NULL) {
if (req == NULL) {
ngx_shmtx_unlock(&shpool->mutex);
return NGX_HTTP_SERVICE_UNAVAILABLE;
}
Expand Down Expand Up @@ -530,6 +530,7 @@ ngx_http_limit_traffic_rate_filter_create_loc_conf(ngx_conf_t *cf)
return NGX_CONF_ERROR;
}
conf->limit_traffic_rate = NGX_CONF_UNSET_SIZE;
conf->shm_zone= NGX_CONF_UNSET_PTR;
return conf;
}

Expand All @@ -540,6 +541,7 @@ ngx_http_limit_traffic_rate_filter_merge_loc_conf(ngx_conf_t *cf, void *parent,
ngx_http_limit_traffic_rate_filter_conf_t *conf = child;

ngx_conf_merge_size_value(conf->limit_traffic_rate, prev->limit_traffic_rate, 0);
ngx_conf_merge_ptr_value(conf->shm_zone, prev->shm_zone, NULL);

return NGX_CONF_OK;
}
Expand Down Expand Up @@ -772,10 +774,6 @@ ngx_http_limit_traffic_rate(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
ngx_int_t n;
ngx_str_t *value;

if (lircf->shm_zone) {
return "is duplicate";
}

value = cf->args->elts;

lircf->shm_zone = ngx_shared_memory_add(cf, &value[1], 0,
Expand Down