Welcome! Log In Create A New Profile

Advanced

Re: yield 499 while reading client body and client prematurely closed connection

Maxim Dounin
January 16, 2018 07:24AM
Hello!

On Mon, Jan 15, 2018 at 09:59:53PM -0800, tokers wrote:

> # HG changeset patch
> # User Alex Zhang <zchao1995@gmail.com>
> # Date 1516079440 -28800
> # Tue Jan 16 13:10:40 2018 +0800
> # Node ID 9ca5af970d2296a02acefb3070237c5f52119708
> # Parent 93abb5a855d6534f0356882f45be49f8c6a95a8b
> yield 499 while reading client body and client prematurely closed
> connection.
>
> The function ngx_http_do_read_client_request_body returns
> NGX_HTTP_BAD_REQUEST (client prematurely closed connection),
> while the 400 status code cannot reflect that client closed connection
> prematurely. It should return code 499(NGX_HTTP_CLIENT_CLOSED_REQUEST)
> and it is helpful to troubleshoot some relevant problems.
>
> Signed-off-by: Alex Zhang <zchao1995@gmail.com>

The 499 code means that client closed a request before nginx was
able to generate a response code and was waiting for something
external - for example, a response from an upstream server. It is
never meant to indicate a connection close by a client at some
arbitrary time.

If a client fails to provide full request with correct syntax,
this is indicated by 400 with appropriate error message logged at
the info level. For example, the same behaviour can be seen in
the ngx_http_read_request_header() function.

I don't think that changing the meaning of the code is a good
idea, especially given that suggested meaning as seen from the
patch is inconsistent across reading different parts of the
request.

--
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

yield 499 while reading client body and client prematurely closed connection

tokers 647 January 16, 2018 01:12AM

Re: yield 499 while reading client body and client prematurely closed connection

Piotr Sikora via nginx-devel 367 January 16, 2018 01:58AM

Re: yield 499 while reading client body and client prematurely closed connection

Maxim Dounin 673 January 16, 2018 07:24AM



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

Online Users

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