Code from Harald Hanche-Olsen */
| 923 | |
| 924 | /* Code from Harald Hanche-Olsen <hanche@imf.unit.no> */ |
| 925 | static 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 | |
| 957 | AP_DECLARE(const char *) ap_get_remote_host(conn_rec *conn, void *dir_config, |
| 958 | int type, int *str_is_ip) |
no outgoing calls
no test coverage detected