]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/tls.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavformat / tls.c
index 38dd70c9df6fbbb09d4ea9321d114eb9d8179aef..2c85d1dedc9884bce21f040f1d75b7d3263f9ffb 100644 (file)
@@ -172,10 +172,6 @@ static int tls_open(URLContext *h, const char *uri, int flags)
 
     ff_tls_init();
 
-    proxy_path = getenv("http_proxy");
-    use_proxy = (proxy_path != NULL) && !getenv("no_proxy") &&
-        av_strstart(proxy_path, "http://", NULL);
-
     av_url_split(NULL, 0, NULL, 0, host, sizeof(host), &port, path, sizeof(path), uri);
     ff_url_join(buf, sizeof(buf), "tcp", NULL, host, port, "%s", path);
 
@@ -185,6 +181,10 @@ static int tls_open(URLContext *h, const char *uri, int flags)
         freeaddrinfo(ai);
     }
 
+    proxy_path = getenv("http_proxy");
+    use_proxy = !ff_http_match_no_proxy(getenv("no_proxy"), host) &&
+                proxy_path != NULL && av_strstart(proxy_path, "http://", NULL);
+
     if (use_proxy) {
         char proxy_host[200], proxy_auth[200], dest[200];
         int proxy_port;