summaryrefslogtreecommitdiff
path: root/libavformat/http.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/http.c')
-rw-r--r--libavformat/http.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavformat/http.c b/libavformat/http.c
index 9666ca3206..9645bd1ffb 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -106,10 +106,6 @@ static int http_open_cnx(URLContext *h)
HTTPAuthType cur_auth_type, cur_proxy_auth_type;
HTTPContext *s = h->priv_data;
- proxy_path = getenv("http_proxy");
- use_proxy = (proxy_path != NULL) && !getenv("no_proxy") &&
- av_strstart(proxy_path, "http://", NULL);
-
/* fill the dest addr */
redo:
/* needed in any case to build the host string */
@@ -118,6 +114,10 @@ static int http_open_cnx(URLContext *h)
path1, sizeof(path1), s->location);
ff_url_join(hoststr, sizeof(hoststr), NULL, NULL, hostname, port, NULL);
+ proxy_path = getenv("http_proxy");
+ use_proxy = !ff_http_match_no_proxy(getenv("no_proxy"), hostname) &&
+ proxy_path != NULL && av_strstart(proxy_path, "http://", NULL);
+
if (!strcmp(proto, "https")) {
lower_proto = "tls";
use_proxy = 0;