diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/ap_mmn.h | 3 | ||||
-rw-r--r-- | include/http_core.h | 25 |
2 files changed, 27 insertions, 1 deletions
diff --git a/include/ap_mmn.h b/include/ap_mmn.h index b7acf6e4bf..59af7ae082 100644 --- a/include/ap_mmn.h +++ b/include/ap_mmn.h @@ -718,6 +718,7 @@ * 20211221.13 (2.5.1-dev) Add hook token_checker to check for authorization other * than username / password. Add autht_provider structure. * 20211221.14 (2.5.1-dev) Add request_rec->final_resp_passed bit + * 20211221.15 (2.5.1-dev) Add ap_get_pollfd_from_conn() */ #define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */ @@ -725,7 +726,7 @@ #ifndef MODULE_MAGIC_NUMBER_MAJOR #define MODULE_MAGIC_NUMBER_MAJOR 20211221 #endif -#define MODULE_MAGIC_NUMBER_MINOR 14 /* 0...n */ +#define MODULE_MAGIC_NUMBER_MINOR 15 /* 0...n */ /** * Determine if the server's current MODULE_MAGIC_NUMBER is at least a diff --git a/include/http_core.h b/include/http_core.h index 8610c98742..7c4f166e09 100644 --- a/include/http_core.h +++ b/include/http_core.h @@ -31,6 +31,7 @@ #include "apr_optional.h" #include "util_filter.h" #include "ap_expr.h" +#include "apr_poll.h" #include "apr_tables.h" #include "http_config.h" @@ -1109,6 +1110,30 @@ AP_DECLARE(int) ap_state_query(int query_code); */ AP_CORE_DECLARE(conn_rec *) ap_create_slave_connection(conn_rec *c); +/** Get a apr_pollfd_t populated with descriptor and descriptor type + * and the timeout to use for it. + * @return APR_ENOTIMPL if not supported for a connection. + */ +AP_DECLARE_HOOK(apr_status_t, get_pollfd_from_conn, + (conn_rec *c, struct apr_pollfd_t *pfd, + apr_interval_time_t *ptimeout)) + +/** + * Pass in a `struct apr_pollfd_t*` and get `desc_type` and `desc` + * populated with a suitable value for polling connection input. + * For primary connection (c->master == NULL), this will be the connection + * socket. For secondary connections this may differ or not be available + * at all. + * Note that APR_NO_DESC may be set to indicate that the connection + * input is already closed. + * + * @param pfd the pollfd to set the descriptor in + * @param ptimeout != NULL to retrieve the timeout in effect + * @return ARP_SUCCESS when the information was assigned. + */ +AP_CORE_DECLARE(apr_status_t) ap_get_pollfd_from_conn(conn_rec *c, + struct apr_pollfd_t *pfd, + apr_interval_time_t *ptimeout); /** Macro to provide a default value if the pointer is not yet initialised */ |