From 0296d7dfeaf1d354b4df7c0c36fc690b8c51c4b4 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Thu, 7 Apr 2022 10:41:46 +0000 Subject: *) core/mod_http: use RESPONSE meta buckets and a new HTTP/1.x specific filter to send responses through the output filter chain. Specifically: the HTTP_HEADER output filter and ap_send_interim_response() create a RESPONSE bucket and no longer are concerned with HTTP/1.x serialization. A new HTTP1_RESPONSE_OUT transcode filter writes the proper HTTP/1.x bytes when dealing with a RESPONSE bucket. That filter installs itself on the pre_read_request hook when the connection has protocol 'http/1.1'. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899648 13f79535-47bb-0310-9956-ffa450edef68 --- include/mod_core.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') diff --git a/include/mod_core.h b/include/mod_core.h index 4897fee6f5..0c795ceeee 100644 --- a/include/mod_core.h +++ b/include/mod_core.h @@ -31,6 +31,7 @@ #include "apr_buckets.h" #include "httpd.h" +#include "http_protocol.h" #include "util_filter.h" @@ -57,6 +58,9 @@ apr_status_t ap_h1_body_in_filter(ap_filter_t *f, apr_bucket_brigade *b, ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes); +/* HTTP/1.1 response formatting filter. */ +apr_status_t ap_h1_response_out_filter(ap_filter_t *f, apr_bucket_brigade *b); + /* HTTP/1.1 chunked transfer encoding filter. */ apr_status_t ap_http_chunk_filter(ap_filter_t *f, apr_bucket_brigade *b); @@ -100,6 +104,14 @@ AP_CORE_DECLARE(void) ap_init_rng(apr_pool_t *p); /* Update RNG state in parent after fork */ AP_CORE_DECLARE(void) ap_random_parent_after_fork(void); +/** + * Set the keepalive status for this request based on the response + * @param r The current request + * @param resp The response being send + * @return 1 if keepalive can be set, 0 otherwise + */ +AP_CORE_DECLARE(int) ap_h1_set_keepalive(request_rec *r, ap_bucket_response *resp); + #ifdef __cplusplus } #endif -- cgit v1.2.1