| 1938 | } |
| 1939 | |
| 1940 | PROXY_DECLARE(const char *) ap_proxy_de_socketfy(apr_pool_t *p, const char *url) |
| 1941 | { |
| 1942 | const char *ptr; |
| 1943 | /* |
| 1944 | * We could be passed a URL during the config stage that contains |
| 1945 | * the UDS path... ignore it |
| 1946 | */ |
| 1947 | if (!ap_cstr_casecmpn(url, "unix:", 5) && |
| 1948 | ((ptr = ap_strchr_c(url + 5, '|')) != NULL)) { |
| 1949 | /* move past the 'unix:...|' UDS path info */ |
| 1950 | const char *ret, *c; |
| 1951 | |
| 1952 | ret = ptr + 1; |
| 1953 | /* special cases: "unix:...|scheme:" ind "unix:...|scheme://" are OK, |
| 1954 | * expand to "unix:....|scheme://localhost" |
| 1955 | */ |
| 1956 | c = ap_strchr_c(ret, ':'); |
| 1957 | if (c == NULL) { |
| 1958 | return NULL; |
| 1959 | } |
| 1960 | if (c[1] == '\0') { |
| 1961 | return apr_pstrcat(p, ret, "//localhost", NULL); |
| 1962 | } |
| 1963 | else if (c[1] == '/' && c[2] == '/' && !c[3]) { |
| 1964 | return apr_pstrcat(p, ret, "localhost", NULL); |
| 1965 | } |
| 1966 | else { |
| 1967 | return ret; |
| 1968 | } |
| 1969 | } |
| 1970 | return url; |
| 1971 | } |
| 1972 | |
| 1973 | static const char * |
| 1974 | add_pass(cmd_parms *cmd, void *dummy, const char *arg, int is_regex) |
no test coverage detected