Welcome! Log In Create A New Profile

Advanced

Re: c->error on 412 responses from not_modified_filter

Maxim Dounin
August 30, 2020 10:08PM
Hello!

On Thu, Aug 27, 2020 at 06:37:56AM +0000, am55444 wrote:

> I am trying to understand reasoning behind nginx setting ngx_connection_t->error (via filter_finalize check in ngx_http_finalize_request) for 412 responses in ngx_http_not_modified_filter.
>
> From the initial introduction of filter_finalize, looks like it was intended to handle large responses for image filter. However I couldn't find c->error being read anywhere after ngx_http_terminate_request (which is called from ngx_http_finalize_request).
> https://github.com/nginx/nginx/blob/554916301c424f02b1cabc073845b64f8681099b/src/http/ngx_http_request.c#L2477
>
> Can someone please point me to the right direction?

The c->error flag is set by filter finalization to prevent further
output of the original response after the response produced by the
filter finalization is sent. The c->error flag is tested by the
ngx_http_write_filter() function.

(Note that this is a hack / a misuse of the c->error flag. And
this hack is known to cause various bad effects. Notably, it
prevents connections from being kept alive.)

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

Re: c->error on 412 responses from not_modified_filter

Maxim Dounin 123 August 30, 2020 10:08PM



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

Online Users

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