Mercurial > hg > nginx
changeset 9255:208a4adb82ef
Request body: logging of timeouts.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Sat, 27 Apr 2024 18:19:27 +0300 |
parents | cb1e214efe41 |
children | 43fe0edddba1 |
files | src/http/ngx_http_request_body.c src/http/ngx_http_upstream.c src/http/v2/ngx_http_v2.c src/http/v3/ngx_http_v3_request.c |
diffstat | 4 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/ngx_http_request_body.c Sat Apr 27 18:19:07 2024 +0300 +++ b/src/http/ngx_http_request_body.c Sat Apr 27 18:19:27 2024 +0300 @@ -262,6 +262,8 @@ #endif if (r->connection->read->timedout) { + ngx_log_error(NGX_LOG_INFO, r->connection->log, NGX_ETIMEDOUT, + "client timed out"); r->connection->timedout = 1; return NGX_HTTP_REQUEST_TIME_OUT; } @@ -282,6 +284,8 @@ ngx_int_t rc; if (r->connection->read->timedout) { + ngx_log_error(NGX_LOG_INFO, r->connection->log, NGX_ETIMEDOUT, + "client timed out"); r->connection->timedout = 1; ngx_http_finalize_request(r, NGX_HTTP_REQUEST_TIME_OUT); return;
--- a/src/http/ngx_http_upstream.c Sat Apr 27 18:19:07 2024 +0300 +++ b/src/http/ngx_http_upstream.c Sat Apr 27 18:19:27 2024 +0300 @@ -2361,6 +2361,7 @@ if (c->read->timedout) { c->timedout = 1; + ngx_connection_error(c, NGX_ETIMEDOUT, "client timed out"); ngx_http_upstream_finalize_request(r, u, NGX_HTTP_REQUEST_TIME_OUT); return; }
--- a/src/http/v2/ngx_http_v2.c Sat Apr 27 18:19:07 2024 +0300 +++ b/src/http/v2/ngx_http_v2.c Sat Apr 27 18:19:27 2024 +0300 @@ -4285,6 +4285,9 @@ if (fc->read->timedout) { if (stream->recv_window) { + ngx_log_error(NGX_LOG_INFO, fc->log, NGX_ETIMEDOUT, + "client timed out"); + stream->skip_data = 1; fc->timedout = 1;
--- a/src/http/v3/ngx_http_v3_request.c Sat Apr 27 18:19:07 2024 +0300 +++ b/src/http/v3/ngx_http_v3_request.c Sat Apr 27 18:19:27 2024 +0300 @@ -1281,6 +1281,8 @@ ngx_int_t rc; if (r->connection->read->timedout) { + ngx_log_error(NGX_LOG_INFO, r->connection->log, NGX_ETIMEDOUT, + "client timed out"); r->connection->timedout = 1; ngx_http_finalize_request(r, NGX_HTTP_REQUEST_TIME_OUT); return; @@ -1300,6 +1302,8 @@ ngx_int_t rc; if (r->connection->read->timedout) { + ngx_log_error(NGX_LOG_INFO, r->connection->log, NGX_ETIMEDOUT, + "client timed out"); r->connection->timedout = 1; return NGX_HTTP_REQUEST_TIME_OUT; }