Welcome! Log In Create A New Profile

Advanced

[nginx] Fixed post_action to not trigger "header already sent" a...

Maxim Dounin
November 28, 2014 09:00AM
details: http://hg.nginx.org/nginx/rev/c76d851c5e7a
branches:
changeset: 5925:c76d851c5e7a
user: Maxim Dounin <mdounin@mdounin.ru>
date: Fri Nov 28 16:57:50 2014 +0300
description:
Fixed post_action to not trigger "header already sent" alert.

The alert was introduced in 03ff14058272 (1.5.4), and was triggered on each
post_action invocation.

There is no real need to call header filters in case of post_action,
so return NGX_OK from ngx_http_send_header() if r->post_action is set.

diffstat:

src/http/ngx_http_core_module.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diffs (14 lines):

diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -1973,6 +1973,10 @@ ngx_http_send_response(ngx_http_request_
ngx_int_t
ngx_http_send_header(ngx_http_request_t *r)
{
+ if (r->post_action) {
+ return NGX_OK;
+ }
+
if (r->header_sent) {
ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
"header already sent");

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Fixed post_action to not trigger "header already sent" a...

Maxim Dounin 1333 November 28, 2014 09:00AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 276
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready