]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
core: Set r->request_time before any logging, mod_unique_id needs it.
authorYann Ylavic <ylavic@apache.org>
Tue, 7 Sep 2021 01:09:23 +0000 (01:09 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 7 Sep 2021 01:09:23 +0000 (01:09 +0000)
* server/protocol.c(read_request_line):
  Move r->request_time initialization before first APLOG_TRACE5,
  ap_log_rerror() may run the generate_log_id hooks and call mod_unique_id
  with no timestamp initialized (zero).

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893001 13f79535-47bb-0310-9956-ffa450edef68

server/protocol.c

index 75c4f9eb74a8afc90b51078bcfd1d29cedbeb146..276e4905281306cebc2c0529aba2291630641d15 100644 (file)
@@ -738,13 +738,15 @@ static int read_request_line(request_rec *r, apr_bucket_brigade *bb)
         }
     } while ((len <= 0) && (--num_blank_lines >= 0));
 
+    /* Set r->request_time before any logging, mod_unique_id needs it. */
+    r->request_time = apr_time_now();
+
     if (APLOGrtrace5(r)) {
         ap_log_rerror(APLOG_MARK, APLOG_TRACE5, 0, r,
                       "Request received from client: %s",
                       ap_escape_logitem(r->pool, r->the_request));
     }
 
-    r->request_time = apr_time_now();
     return 1;
 }