Welcome! Log In Create A New Profile

Advanced

[PROPOSAL PATCH] use a return code for ngx_http_terminate_request()

June 27, 2014 09:07AM
Hello,

Reading ngx_http_request.c source code, I notice some call to ngx_http_terminate_request() is called sometimes with 0 instead of a return code.

0 is a correct valid for a return code ... it's NGX_OK.

Is the patch valid ?

It's based on nginx-1.7.2 version.

Thanks for your reply.

yves

Subject: [PATCH] use a return code for ngx_http_terminate_request()

---
1.0/source/nginx-1.7.2/src/http/ngx_http_request.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/1.0/source/nginx-1.7.2/src/http/ngx_http_request.c b/1.0/source/nginx-1.7.2/src/http/ngx_http_request.c
index 4bf9d1f..8ddfc60 100644
--- a/1.0/source/nginx-1.7.2/src/http/ngx_http_request.c
+++ b/1.0/source/nginx-1.7.2/src/http/ngx_http_request.c
@@ -2329,7 +2329,7 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
if (r->buffered || r->postponed) {

if (ngx_http_set_write_handler(r) != NGX_OK) {
- ngx_http_terminate_request(r, 0);
+ ngx_http_terminate_request(r, NGX_ERROR);
}

return;
@@ -2381,7 +2381,7 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)

if (ngx_http_post_request(pr, NULL) != NGX_OK) {
r->main->count++;
- ngx_http_terminate_request(r, 0);
+ ngx_http_terminate_request(r, NGX_ERROR);
return;
}

@@ -2395,7 +2395,7 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
if (r->buffered || c->buffered || r->postponed || r->blocked) {

if (ngx_http_set_write_handler(r) != NGX_OK) {
- ngx_http_terminate_request(r, 0);
+ ngx_http_terminate_request(r, NGX_ERROR);
}

return;
--
1.7.10.4
Subject Author Posted

[PROPOSAL PATCH] use a return code for ngx_http_terminate_request()

crespin June 27, 2014 09:07AM

Re: [PROPOSAL PATCH] use a return code for ngx_http_terminate_request()

Maxim Dounin June 27, 2014 03:40PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 85
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready