diff options
author | Yann Ylavic <ylavic@apache.org> | 2020-04-01 22:56:44 +0000 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2020-04-01 22:56:44 +0000 |
commit | 343cdd9bb4488c4f0c632583af8bb4bdae0a32dc (patch) | |
tree | 94f3e8526ca2a497d660930a9b945ab2b5a7d52f /include | |
parent | fd5afc092ccd71a4e48a0f6c891ed6e1b14e187f (diff) | |
download | httpd-343cdd9bb4488c4f0c632583af8bb4bdae0a32dc.tar.gz |
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 'include')
-rw-r--r-- | include/ap_mmn.h | 3 | ||||
-rw-r--r-- | include/http_request.h | 7 | ||||
-rw-r--r-- | include/httpd.h | 5 |
3 files changed, 14 insertions, 1 deletions
diff --git a/include/ap_mmn.h b/include/ap_mmn.h index 7636683a5b..30c156fbfa 100644 --- a/include/ap_mmn.h +++ b/include/ap_mmn.h @@ -624,6 +624,7 @@ * 20200217.0 (2.5.1-dev) Add and use ap_method_mask_t type * 20200331.0 (2.5.1-dev) Remove ap_request_core_filter() and * ap_request_core_filter_handle. + * 20200331.1 (2.5.1-dev) Add flushed:1 to request_rec */ #define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */ @@ -631,7 +632,7 @@ #ifndef MODULE_MAGIC_NUMBER_MAJOR #define MODULE_MAGIC_NUMBER_MAJOR 20200331 #endif -#define MODULE_MAGIC_NUMBER_MINOR 0 /* 0...n */ +#define MODULE_MAGIC_NUMBER_MINOR 1 /* 0...n */ /** * Determine if the server's current MODULE_MAGIC_NUMBER is at least a diff --git a/include/http_request.h b/include/http_request.h index 4259e8a652..11ddbaf9b6 100644 --- a/include/http_request.h +++ b/include/http_request.h @@ -625,6 +625,13 @@ AP_DECLARE(apr_bucket *) ap_bucket_eor_create(apr_bucket_alloc_t *list, request_rec *r); /** + * Get the request bound to an End Of Request (EOR) bucket. + * @param b The EOR bucket + * @return Its associated request + */ +AP_DECLARE(request_rec *) ap_bucket_eor_request(apr_bucket *b); + +/** * Can be used within any handler to determine if any authentication * is required for the current request. Note that if used with an * access_checker hook, an access_checker_ex hook or an authz provider; the diff --git a/include/httpd.h b/include/httpd.h index 88c71c0c22..c3a81ba446 100644 --- a/include/httpd.h +++ b/include/httpd.h @@ -1092,6 +1092,11 @@ struct request_rec { * Always use ap_request_tainted() to check taint. */ int taint; + /** Whether the response has been flushed through the network, + * relevant at ap_run_log_transaction() time only. + * TODO: compact elsewhere + */ + unsigned int flushed:1; }; /** |