summaryrefslogtreecommitdiff
path: root/include/http_core.h
diff options
context:
space:
mode:
authorWilliam A. Rowe Jr <wrowe@apache.org>2016-02-11 21:43:32 +0000
committerWilliam A. Rowe Jr <wrowe@apache.org>2016-02-11 21:43:32 +0000
commit69479166433991df62715f6fa4c6a5889121f4f8 (patch)
treef9cd5198f448eb214d34a7e34d0e13d63f760db1 /include/http_core.h
parented1695a87aa8be681481af84a72b78ccbc83ca25 (diff)
downloadhttpd-69479166433991df62715f6fa4c6a5889121f4f8.tar.gz
Introduce an ap_get_useragent_host() accessor to replace the old
ap_get_remote_host() in most applications, but preserve the original behavior for all ap_get_remote_host() consumers (mostly, because we don't have the request_rec in the first place, and also to avoid any unintended consequences). This accessor continues to store the remote_host of connection based uesr agents within the conn_rec for optimization. Only where some other module modifies the useragent_addr will we perform a per-request query of the remote_host. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729897 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/http_core.h')
-rw-r--r--include/http_core.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/include/http_core.h b/include/http_core.h
index 684fba49cf..a6f1d28b8b 100644
--- a/include/http_core.h
+++ b/include/http_core.h
@@ -159,6 +159,32 @@ AP_DECLARE(int) ap_allow_overrides(request_rec *r);
AP_DECLARE(const char *) ap_document_root(request_rec *r);
/**
+ * Lookup the remote user agent's DNS name or IP address
+ * @ingroup get_remote_hostname
+ * @param req The current request
+ * @param type The type of lookup to perform. One of:
+ * <pre>
+ * REMOTE_HOST returns the hostname, or NULL if the hostname
+ * lookup fails. It will force a DNS lookup according to the
+ * HostnameLookups setting.
+ * REMOTE_NAME returns the hostname, or the dotted quad if the
+ * hostname lookup fails. It will force a DNS lookup according
+ * to the HostnameLookups setting.
+ * REMOTE_NOLOOKUP is like REMOTE_NAME except that a DNS lookup is
+ * never forced.
+ * REMOTE_DOUBLE_REV will always force a DNS lookup, and also force
+ * a double reverse lookup, regardless of the HostnameLookups
+ * setting. The result is the (double reverse checked)
+ * hostname, or NULL if any of the lookups fail.
+ * </pre>
+ * @param str_is_ip unless NULL is passed, this will be set to non-zero on
+ * output when an IP address string is returned
+ * @return The remote hostname (based on the request useragent_ip)
+ */
+AP_DECLARE(const char *) ap_get_useragent_host(request_rec *req, int type,
+ int *str_is_ip);
+
+/**
* Lookup the remote client's DNS name or IP address
* @ingroup get_remote_host
* @param conn The current connection
@@ -180,7 +206,7 @@ AP_DECLARE(const char *) ap_document_root(request_rec *r);
* </pre>
* @param str_is_ip unless NULL is passed, this will be set to non-zero on output when an IP address
* string is returned
- * @return The remote hostname
+ * @return The remote hostname (based on the connection client_ip)
*/
AP_DECLARE(const char *) ap_get_remote_host(conn_rec *conn, void *dir_config, int type, int *str_is_ip);