Changeset View
Changeset View
Standalone View
Standalone View
lib/libfetch/http.c
Show First 20 Lines • Show All 1,461 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
struct url *purl; | struct url *purl; | ||||
char *p; | char *p; | ||||
if (flags != NULL && strchr(flags, 'd') != NULL) | if (flags != NULL && strchr(flags, 'd') != NULL) | ||||
return (NULL); | return (NULL); | ||||
if (fetch_no_proxy_match(url->host)) | if (fetch_no_proxy_match(url->host)) | ||||
return (NULL); | return (NULL); | ||||
if (strcmp(url->scheme, SCHEME_HTTPS) == 0) { | |||||
if (((p = getenv("HTTPS_PROXY")) || (p = getenv("https_proxy")) || | |||||
(p = getenv("HTTP_PROXY")) || (p = getenv("http_proxy"))) && | |||||
*p && (purl = fetchParseURL(p))) { | |||||
if (!*purl->scheme) | |||||
strcpy(purl->scheme, SCHEME_HTTP); | |||||
if (!purl->port) | |||||
purl->port = fetch_default_proxy_port(purl->scheme); | |||||
if (strcmp(purl->scheme, SCHEME_HTTP) == 0) | |||||
return (purl); | |||||
fetchFreeURL(purl); | |||||
} | |||||
} else { | |||||
if (((p = getenv("HTTP_PROXY")) || (p = getenv("http_proxy"))) && | if (((p = getenv("HTTP_PROXY")) || (p = getenv("http_proxy"))) && | ||||
*p && (purl = fetchParseURL(p))) { | *p && (purl = fetchParseURL(p))) { | ||||
if (!*purl->scheme) | if (!*purl->scheme) | ||||
strcpy(purl->scheme, SCHEME_HTTP); | strcpy(purl->scheme, SCHEME_HTTP); | ||||
if (!purl->port) | if (!purl->port) | ||||
purl->port = fetch_default_proxy_port(purl->scheme); | purl->port = fetch_default_proxy_port(purl->scheme); | ||||
if (strcmp(purl->scheme, SCHEME_HTTP) == 0) | if (strcmp(purl->scheme, SCHEME_HTTP) == 0) | ||||
return (purl); | return (purl); | ||||
fetchFreeURL(purl); | fetchFreeURL(purl); | ||||
} | |||||
} | } | ||||
return (NULL); | return (NULL); | ||||
} | } | ||||
static void | static void | ||||
http_print_html(FILE *out, FILE *in) | http_print_html(FILE *out, FILE *in) | ||||
{ | { | ||||
size_t len; | size_t len; | ||||
▲ Show 20 Lines • Show All 620 Lines • Show Last 20 Lines |