summaryrefslogtreecommitdiff
path: root/modules/http
diff options
context:
space:
mode:
authorRuediger Pluem <rpluem@apache.org>2022-03-31 20:10:21 +0000
committerRuediger Pluem <rpluem@apache.org>2022-03-31 20:10:21 +0000
commit885a08dc2eadbca9182a89e75ef6028b65827ff9 (patch)
tree7f1057966256de272a503721f87ee7167864cc0f /modules/http
parent5d443ed4fdb9907cf3f436cb852f85c89f9f38ac (diff)
downloadhttpd-885a08dc2eadbca9182a89e75ef6028b65827ff9.tar.gz
* In case we see an EOC bucket and there was an error bucket before, use its
status as status for the request. This should ensure proper status logging in the access log. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899454 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/http')
-rw-r--r--modules/http/http_filters.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/http/http_filters.c b/modules/http/http_filters.c
index dbdd515592..d41a519b50 100644
--- a/modules/http/http_filters.c
+++ b/modules/http/http_filters.c
@@ -1802,6 +1802,7 @@ AP_DECLARE(long) ap_get_client_block(request_rec *r, char *buffer,
/* Context struct for ap_http_outerror_filter */
typedef struct {
int seen_eoc;
+ int first_error;
} outerror_filter_ctx_t;
/* Filter to handle any error buckets on output */
@@ -1831,12 +1832,26 @@ apr_status_t ap_http_outerror_filter(ap_filter_t *f,
/* stream aborted and we have not ended it yet */
r->connection->keepalive = AP_CONN_CLOSE;
}
+ /*
+ * Memorize the status code of the first error bucket for possible
+ * later use.
+ */
+ if (!ctx->first_error) {
+ ctx->first_error = ((ap_bucket_error *)(e->data))->status;
+ }
continue;
}
/* Detect EOC buckets and memorize this in the context. */
if (AP_BUCKET_IS_EOC(e)) {
r->connection->keepalive = AP_CONN_CLOSE;
ctx->seen_eoc = 1;
+ /* Set the request status to the status of the first error bucket.
+ * This should ensure that we log an appropriate status code in
+ * the access log.
+ */
+ if (ctx->first_error) {
+ r->status = ctx->first_error;
+ }
}
}
/*