[nginx] Request body: improved debug logging.

Maxim Dounin mdounin at mdounin.ru
Sat Apr 27 15:56:47 UTC 2024


details:   http://freenginx.org/hg/nginx/rev/0748264a1278
branches:  
changeset: 9257:0748264a1278
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Sat Apr 27 18:21:05 2024 +0300
description:
Request body: improved debug logging.

diffstat:

 src/http/ngx_http_request_body.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (32 lines):

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
@@ -48,6 +48,9 @@ ngx_http_read_client_request_body(ngx_ht
         return NGX_OK;
     }
 
+    ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
+                   "http read request body");
+
     if (ngx_http_test_expect(r) != NGX_OK) {
         rc = NGX_HTTP_INTERNAL_SERVER_ERROR;
         goto done;
@@ -649,6 +652,9 @@ ngx_http_discard_request_body(ngx_http_r
         return NGX_OK;
     }
 
+    ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
+                   "http set discard body");
+
 #if (NGX_HTTP_V2)
     if (r->stream) {
         r->stream->skip_data = 1;
@@ -668,8 +674,6 @@ ngx_http_discard_request_body(ngx_http_r
 
     rev = r->connection->read;
 
-    ngx_log_debug0(NGX_LOG_DEBUG_HTTP, rev->log, 0, "http set discard body");
-
     if (rev->timer_set) {
         ngx_del_timer(rev);
     }



More information about the nginx-devel mailing list