summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStefan Eissing <icing@apache.org>2022-03-18 09:52:52 +0000
committerStefan Eissing <icing@apache.org>2022-03-18 09:52:52 +0000
commit6bd9d17e081692d3555d1c9803962c883acd136b (patch)
tree61bed2fc5a3746e58932712e5c5eb477a11fa5f0 /include
parent898f3dc3d0b60320e2f2fb09c7979b46a9fa116e (diff)
downloadhttpd-6bd9d17e081692d3555d1c9803962c883acd136b.tar.gz
*) core: adding a new hook and method to the API:
create_secondary_connection and ap_create_secondary_connection() to setup connections related to a "master" one, as used in the HTTP/2 protocol implementation. *) mod_http2: using the new API calls to get rid of knowledge about how the core handles conn_rec specifics. Improvements in pollset stream handling to use less sets. Using atomic read/writes instead of volatiles now. Keeping a reserve of "transit" pools and bucket_allocs for use on secondary connections to avoid repeated setup/teardowns. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899032 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include')
-rw-r--r--include/ap_mmn.h5
-rw-r--r--include/http_connection.h25
2 files changed, 29 insertions, 1 deletions
diff --git a/include/ap_mmn.h b/include/ap_mmn.h
index 84c566e0f0..6457cb21d9 100644
--- a/include/ap_mmn.h
+++ b/include/ap_mmn.h
@@ -702,6 +702,9 @@
* and ap_thread_current()
* 20211221.4 (2.5.1-dev) Add hook child_stopped to get informed that a child
* has stopped processing any requests.
+ * 20211221.5 (2.5.1-dev) Add hook create_secondary_connection and method
+ * ap_create_secondary_connection() to have connection
+ * setup of http2-like connections in core.
*
*/
@@ -710,7 +713,7 @@
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20211221
#endif
-#define MODULE_MAGIC_NUMBER_MINOR 4 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 5 /* 0...n */
/**
* Determine if the server's current MODULE_MAGIC_NUMBER is at least a
diff --git a/include/http_connection.h b/include/http_connection.h
index 747a84af6e..a89113bcb3 100644
--- a/include/http_connection.h
+++ b/include/http_connection.h
@@ -151,6 +151,20 @@ AP_DECLARE_HOOK(int,pre_close_connection,(conn_rec *c))
AP_DECLARE(int) ap_pre_connection(conn_rec *c, void *csd);
/**
+ * create_secondary_connection is a RUN_FIRST hook which allows modules to create
+ * secondary connections. In general, you should not install filters with the
+ * create_secondary_connection hook. This hook should close the connection
+ * if it encounters a fatal error condition.
+ *
+ * @param p The pool for the secondary connection
+ * @param master The master connection this belongs to.
+ * @param alloc The bucket allocator to use for all bucket/brigade creations
+ * @return An allocated connection record or NULL.
+ */
+AP_DECLARE_HOOK(conn_rec *, create_secondary_connection,
+ (apr_pool_t *p, conn_rec *master, apr_bucket_alloc_t *alloc))
+
+/**
* Create a new server/incoming or client/outgoing/proxy connection
* @param p The pool from which to allocate the connection record
* @param server The server record to create the connection too.
@@ -171,6 +185,17 @@ AP_DECLARE(conn_rec *) ap_create_connection(apr_pool_t *p,
apr_bucket_alloc_t *alloc,
unsigned int outgoing);
+/**
+ * Create a new secondary connection based on a master one.
+ * @param pool The pool for the secondary connection
+ * @param master The master connection this belongs to.
+ * @param alloc The bucket allocator to use for all bucket/brigade creations
+ * @return An allocated connection record or NULL.
+ */
+AP_DECLARE(conn_rec *) ap_create_secondary_connection(apr_pool_t *pool,
+ conn_rec *master,
+ apr_bucket_alloc_t *alloc);
+
/** End Of Connection (EOC) bucket */
AP_DECLARE_DATA extern const apr_bucket_type_t ap_bucket_type_eoc;