MCPcopy Create free account
hub / github.com/apache/httpd / do_double_reverse

Function do_double_reverse

server/core.c:925–955  ·  view source on GitHub ↗

Code from Harald Hanche-Olsen */

Source from the content-addressed store, hash-verified

923
924/* Code from Harald Hanche-Olsen <hanche@imf.unit.no> */
925static APR_INLINE int do_double_reverse (int double_reverse,
926 const char *remote_host,
927 apr_sockaddr_t *client_addr,
928 apr_pool_t *pool)
929{
930 apr_sockaddr_t *sa;
931 apr_status_t rv;
932
933 if (double_reverse) {
934 /* already done */
935 return double_reverse;
936 }
937
938 if (remote_host == NULL || remote_host[0] == '\0') {
939 /* single reverse failed, so don't bother */
940 return -1;
941 }
942
943 rv = apr_sockaddr_info_get(&sa, remote_host, APR_UNSPEC, 0, 0, pool);
944 if (rv == APR_SUCCESS) {
945 while (sa) {
946 if (apr_sockaddr_equal(sa, client_addr)) {
947 return 1;
948 }
949
950 sa = sa->next;
951 }
952 }
953
954 return -1;
955}
956
957AP_DECLARE(const char *) ap_get_remote_host(conn_rec *conn, void *dir_config,
958 int type, int *str_is_ip)

Callers 2

ap_get_remote_hostFunction · 0.85
ap_get_useragent_hostFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected