From: Yann Ylavic Date: Tue, 7 Sep 2021 01:09:23 +0000 (+0000) Subject: core: Set r->request_time before any logging, mod_unique_id needs it. X-Git-Tag: 2.5.0-alpha2-ci-test-only~832 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9fdd6a91fbc9550e167369082d32aceca74be7c2;p=thirdparty%2Fapache%2Fhttpd.git core: Set r->request_time before any logging, mod_unique_id needs it. * 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 --- diff --git a/server/protocol.c b/server/protocol.c index 75c4f9eb74a..276e4905281 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -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; }