diff options
author | Yann Ylavic <ylavic@apache.org> | 2021-09-09 16:55:24 +0000 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2021-09-09 16:55:24 +0000 |
commit | 2b7f51ade70bf6d517b94311dda5250e2dca85a7 (patch) | |
tree | 2a72ec52aa4cdbe0f8446c15553b877d47abc61d /include/http_connection.h | |
parent | 866cf4dbfbab36fb9d689b9fe835ca2ab7f38291 (diff) | |
download | httpd-2b7f51ade70bf6d517b94311dda5250e2dca85a7.tar.gz |
core: Add ap_create_connection() to create a server or client/proxy connection.
c->outgoing shouldn't be set by mod_ssl, ap_create_connection() allows that
and this commit also replaces all the calls to ap_run_create_connection() in
mod_proxy modules (not in the MPMs which create incoming connections only).
* include/http_connection.h, server/connection.c:
Declare and implement ap_create_connection().
* modules/proxy/proxy_util.c, modules/proxy/mod_proxy_connect.c,
modules/proxy/mod_proxy_ftp.c:
Use ap_create_connection() instead of ap_run_create_connection(), and don't
provide a connection_id a scoreboard handle for outgoing connection.
* server/log.c(do_errorlog_default):
Use c->outgoing instead of c->sbh to determine if it's a "client" or "remote"
connection.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893184 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/http_connection.h')
-rw-r--r-- | include/http_connection.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/http_connection.h b/include/http_connection.h index 8bc009da3b..b49a2577c5 100644 --- a/include/http_connection.h +++ b/include/http_connection.h @@ -135,6 +135,28 @@ AP_DECLARE_HOOK(int,process_connection,(conn_rec *c)) */ AP_DECLARE_HOOK(int,pre_close_connection,(conn_rec *c)) +/** + * 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. + * @param csd The socket that has been accepted + * @param conn_id A unique identifier for this connection. The ID only + * needs to be unique at that time, not forever. + * @param sbh A handle to scoreboard information for this connection. + * @param alloc The bucket allocator to use for all bucket/brigade creations + * @param outgoing Whether it's an outgoing (client) connection + * @return An allocated connection record or NULL. + * @remark To allow for future flags, outgoing must be a boolean (0 or 1) + * for now, otherwise NULL is returned + */ +AP_DECLARE(conn_rec *) ap_create_connection(apr_pool_t *p, + server_rec *server, + apr_socket_t *csd, + long conn_id, void *sbh, + apr_bucket_alloc_t *alloc, + unsigned int outgoing); + + /** End Of Connection (EOC) bucket */ AP_DECLARE_DATA extern const apr_bucket_type_t ap_bucket_type_eoc; |