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

Function ap_proxy_de_socketfy

modules/proxy/mod_proxy.c:1940–1971  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1938}
1939
1940PROXY_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
1973static const char *
1974 add_pass(cmd_parms *cmd, void *dummy, const char *arg, int is_regex)

Callers 5

add_passFunction · 0.85
add_memberFunction · 0.85
set_proxy_paramFunction · 0.85
proxysectionFunction · 0.85
ap_proxy_get_worker_exFunction · 0.85

Calls 2

ap_cstr_casecmpnFunction · 0.85
ap_strchr_cFunction · 0.85

Tested by

no test coverage detected