summaryrefslogtreecommitdiffstats
path: root/modules/loggers
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2020-04-02 00:56:44 +0200
committerYann Ylavic <ylavic@apache.org>2020-04-02 00:56:44 +0200
commit343cdd9bb4488c4f0c632583af8bb4bdae0a32dc (patch)
tree94f3e8526ca2a497d660930a9b945ab2b5a7d52f /modules/loggers
parent* modules/ssl/ssl_engine_io.c (ssl_io_filter_coalesce): Handle the case (diff)
downloadapache2-343cdd9bb4488c4f0c632583af8bb4bdae0a32dc.tar.xz
apache2-343cdd9bb4488c4f0c632583af8bb4bdae0a32dc.zip
core: add r->flushed flag and set it when the response is sent.
By setting EOR->r->flushed in the core output filter, allow one to determine at log_transaction hook time whether the request has been fully flushed through the network, or not (network issue, filter error, n-th pipelined resposne...). Introduce the ap_bucket_eor_request() helper to get the request bound to an EOR bucket, and uses it in ap_core_output_filter() to mark the EOR's request just before destroying it, after all the previous buckets have been sent. While at it, rename the request_rec* member of struct ap_bucket_eor from "data" to "r", which makes the code clearer (not to be confused with b->data). Finally, add CustomLog format %F, showing "F" or "-" depending on r->flushed, for admins to figure out for each request. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1876017 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/loggers')
-rw-r--r--modules/loggers/mod_log_config.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/loggers/mod_log_config.c b/modules/loggers/mod_log_config.c
index 6f9201d609..d85e39322d 100644
--- a/modules/loggers/mod_log_config.c
+++ b/modules/loggers/mod_log_config.c
@@ -416,6 +416,10 @@ static const char *log_request_method(request_rec *r, char *a)
{
return ap_escape_logitem(r->pool, r->method);
}
+static const char *log_request_flushed(request_rec *r, char *a)
+{
+ return (r->flushed) ? "F" : "-";
+}
static const char *log_log_id(request_rec *r, char *a)
{
if (a && !strcmp(a, "c")) {
@@ -1854,6 +1858,7 @@ static int log_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
log_pfn_register(p, "H", log_request_protocol, 0);
log_pfn_register(p, "m", log_request_method, 0);
log_pfn_register(p, "q", log_request_query, 0);
+ log_pfn_register(p, "F", log_request_flushed, 1);
log_pfn_register(p, "X", log_connection_status, 0);
log_pfn_register(p, "C", log_cookie, 0);
log_pfn_register(p, "k", log_requests_on_connection, 0);