Skip to content

Merge 2.7.x #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 17, 2013
Merged
Show file tree
Hide file tree
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
9 changes: 7 additions & 2 deletions nginx/modsecurity/ngx_http_modsecurity.c
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ ngx_http_modsecurity_header_filter(ngx_http_request_t *r) {
return ngx_http_next_header_filter(r);
}

if (r != r->main || !cf->enable || ctx->complete) {
if (r != r->main || !cf->enable || ctx == NULL ||ctx->complete) {
return ngx_http_next_header_filter(r);
}

Expand Down Expand Up @@ -1140,6 +1140,10 @@ ngx_http_modsecurity_header_filter(ngx_http_request_t *r) {
}

/* SecResponseBodyAccess on, process rules in body filter */

/* pretend we are ngx_http_header_filter */
r->header_sent = 1;

r->filter_need_in_memory = 1;
return NGX_OK;
}
Expand All @@ -1156,7 +1160,7 @@ ngx_http_modsecurity_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
cf = ngx_http_get_module_loc_conf(r, ngx_http_modsecurity);
ctx = ngx_http_get_module_ctx(r, ngx_http_modsecurity);

if (r != r->main || !cf->enable || ctx->complete) {
if (r != r->main || !cf->enable || ctx == NULL || ctx->complete) {
return ngx_http_next_body_filter(r, in);
}

Expand Down Expand Up @@ -1212,6 +1216,7 @@ ngx_http_modsecurity_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
r->headers_out.content_length = NULL; /* header filter will set this */
}

r->header_sent = 0;
rc = ngx_http_next_header_filter(r);

if (rc == NGX_ERROR || rc > NGX_OK) {
Expand Down
2 changes: 1 addition & 1 deletion nginx/modsecurity/ngx_pool_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ ngx_pool_context_init_conf(ngx_cycle_t *cycle, void *conf)
{
ngx_pool_context_conf_t *pcf = conf;

ngx_conf_init_uint_value(pcf->size, NGX_POOL_CTX_SIZE);
ngx_conf_init_uint_value(pcf->size, cycle->connection_n);

ngx_pool_context_hash_size = pcf->size;

Expand Down