Welcome! Log In Create A New Profile

Advanced

Re: debug points abort, что делать с корками

Maxim Dounin
December 02, 2013 08:52AM
Hello!

On Sat, Nov 30, 2013 at 04:18:47PM -0500, proforg wrote:

> Linux shc 3.6-trunk-amd64 #1 SMP Debian 3.6.8-1~experimental.1 x86_64
> GNU/Linux
>
> nginx version: nginx/1.5.7
> built by gcc 4.4.5 (Debian 4.4.5-8)
> TLS SNI support enabled

[...]

> 2013/11/30 16:06:49 [debug] 17787#0: *4925169 access phase: 9
> 2013/11/30 16:06:49 [debug] 17787#0: *4925169 access phase: 10
> 2013/11/30 16:06:49 [debug] 17787#0: *4925169 post access phase: 11
> 2013/11/30 16:06:49 [debug] 17787#0: *4925169 http client request body
> preread 148
> 2013/11/30 16:06:49 [debug] 17787#0: *4925169 http request body content
> length filter
> 2013/11/30 16:06:49 [debug] 17787#0: *4925169 http body new buf t:1 f:0
> 0000000000AE16BC, pos 0000000000AE16BC, size: 0 file: 0, size: 0

Понятно, при использовании pipelining'а в тело попадает пустой
буфер, хотя не должен бы. Плохого от этого быть не должно, но в
целом ругань по делу. Патч какой-то такой:

# User Maxim Dounin <mdounin@mdounin.ru>
# Date 1385936263 -14400
# Mon Dec 02 02:17:43 2013 +0400
# Node ID 591423596597056f214677ed48a874ec02306fb0
# Parent eda7fcb44dcea02763a5ae2de771b51a1d3e428c
Fixed "zero size buf in output" alerts.

If request had an empty request body (with Content-Length: 0), and there
were preread data available (e.g., due to a pipelined request in buffer),
the "zero size buf in output" alert might be logged while proxying the
request to an upstream.

Similar alerts appeared with client_body_in_file_only if a request had an
empty request body.

diff --git a/src/http/ngx_http_request_body.c b/src/http/ngx_http_request_body.c
--- a/src/http/ngx_http_request_body.c
+++ b/src/http/ngx_http_request_body.c
@@ -160,7 +160,7 @@ ngx_http_read_client_request_body(ngx_ht

ngx_memzero(b, sizeof(ngx_buf_t));

- b->in_file = 1;
+ b->in_file = (rb->temp_file->file.offset != 0);
b->file_last = rb->temp_file->file.offset;
b->file = &rb->temp_file->file;

@@ -384,7 +384,7 @@ ngx_http_do_read_client_request_body(ngx

ngx_memzero(b, sizeof(ngx_buf_t));

- b->in_file = 1;
+ b->in_file = (rb->temp_file->file.offset != 0);
b->file_last = rb->temp_file->file.offset;
b->file = &rb->temp_file->file;

@@ -843,6 +843,10 @@ ngx_http_request_body_length_filter(ngx_

for (cl = in; cl; cl = cl->next) {

+ if (rb->rest == 0) {
+ break;
+ }
+
tl = ngx_chain_get_free_buf(r->pool, &rb->free);
if (tl == NULL) {
return NGX_HTTP_INTERNAL_SERVER_ERROR;

--
Maxim Dounin
http://nginx.org/en/donation.html

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

debug_points abort, что делать с корками

proforg November 29, 2013 02:44PM

Re: debug points abort, что делать с корками

Maxim Dounin November 29, 2013 05:22PM

Re: debug points abort, что делать с корками

proforg November 30, 2013 04:18PM

Re: debug points abort, что делать с корками

Maxim Dounin December 02, 2013 08:52AM

Re: debug points abort, что делать с корками

proforg December 24, 2013 11:33AM

Re: debug points abort, что делать с корками

Maxim Dounin December 25, 2013 09:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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