# HG changeset patch # User Maxim Dounin # Date 1714231167 -10800 # Node ID 208a4adb82ef5d40e88dd3fb0aa6b2a77f64a24e # Parent cb1e214efe4134c90738248d3326e6cf79715038 Request body: logging of timeouts. 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 @@ -262,6 +262,8 @@ ngx_http_read_unbuffered_request_body(ng #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_http_read_client_request_body_handle 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; diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -2361,6 +2361,7 @@ ngx_http_upstream_read_request_handler(n 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; } diff --git a/src/http/v2/ngx_http_v2.c b/src/http/v2/ngx_http_v2.c --- a/src/http/v2/ngx_http_v2.c +++ b/src/http/v2/ngx_http_v2.c @@ -4285,6 +4285,9 @@ ngx_http_v2_read_unbuffered_request_body 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; diff --git a/src/http/v3/ngx_http_v3_request.c b/src/http/v3/ngx_http_v3_request.c --- a/src/http/v3/ngx_http_v3_request.c +++ b/src/http/v3/ngx_http_v3_request.c @@ -1281,6 +1281,8 @@ ngx_http_v3_read_client_request_body_han 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_http_v3_read_unbuffered_request_body 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; }