Welcome! Log In Create A New Profile

Advanced

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

Maxim Dounin
June 27, 2014 03:44PM
Hello!

On Fri, Jun 27, 2014 at 09:26:23AM -0400, crespin wrote:

> Hello,
>
> here is another path still on ngx_http_request.c.
> In function ngx_http_close_request(), the second parameter is an error
> code.
>
> This error code is used in ngx_http_free_request() to set the HTTP status
> code if it's not present or if no bytes are already sent.
>
> Use NGX_OK instead of zero seems - for me - valid.

The same logic applies as in the previous answer about
ngx_http_terminate_request().

> When ngx_http_close_request() is called after an error, I guess it's must be
> NGX_HTTP_INTERNAL_SERVER_ERROR.
>
> Perhaps, it's better to do two patch one for zero to NGX_OK and another for
> NGX_HTTP_INTERNAL_SERVER_ERROR.

Use of NGX_HTTP_INTERNAL_SERVER_ERROR is wrong, as there are no
chances that this response code will be ever actually sent.
Response headers are either already sent, or won't be sent at all.

--
Maxim Dounin
http://nginx.org/

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

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

crespin June 27, 2014 09:26AM

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

Maxim Dounin June 27, 2014 03:44PM

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

crespin June 28, 2014 06:54AM

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

Maxim Dounin June 30, 2014 03:02PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 87
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