[FFmpeg-trac] #2129(avformat:new): no_proxy environment variable implemented wrong
FFmpeg
trac at avcodec.org
Thu Jan 10 15:03:49 CET 2013
#2129: no_proxy environment variable implemented wrong
-----------------------------------+--------------------------------------
Reporter: divVerent | Type: defect
Status: new | Priority: normal
Component: avformat | Version: git-master
Keywords: http | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-----------------------------------+--------------------------------------
Summary of the bug:
no_proxy is defined as an exclusion list; however, to ffmpeg, this
variable disables proxy support entirely
How to reproduce:
{{{
% strace -fe connect ffplay "http://192.0.2.42/foo.mp3"
[pid 4727] connect(6, {sa_family=AF_INET, sin_port=htons(80),
sin_addr=inet_addr("192.0.2.42")}, 16) = -1 EINPROGRESS (Operation now in
progress)
# no proxy is used. good
% env http_proxy="http://192.0.2.23:8080" strace -fe connect ffplay
"http://192.0.2.42/foo.mp3"
[pid 4658] connect(6, {sa_family=AF_INET, sin_port=htons(8080),
sin_addr=inet_addr("192.0.2.23")}, 16) = -1 EINPROGRESS (Operation now in
progress)
# proxy is properly used, good
% env http_proxy="http://192.0.2.23:8080" no_proxy="192.0.2.42" strace -fe
connect ffplay "http://192.0.2.42/foo.mp3"
[pid 4837] connect(6, {sa_family=AF_INET, sin_port=htons(80),
sin_addr=inet_addr("192.0.2.42")}, 16) = -1 EINPROGRESS (Operation now in
progress)
# proxy is not used, good
env http_proxy="http://192.0.2.23:8080" no_proxy="192.0.2.123" strace -fe
connect ffplay "http://192.0.2.42/foo.mp3"
[pid 4894] connect(6, {sa_family=AF_INET, sin_port=htons(80),
sin_addr=inet_addr("192.0.2.42")}, 16) = -1 EINPROGRESS (Operation now in
progress)
# proxy is not used, BAD!
}}}
Cause in the source, to be found in libavformat/tls.c and
libavformat/http.c:
{{{
proxy_path = getenv("http_proxy");
use_proxy = (proxy_path != NULL) && !getenv("no_proxy") &&
av_strstart(proxy_path, "http://", NULL);
}}}
Actually, the no_proxy variable would need parsing and comparing to the
URL!
See here:
http://www.w3.org/Daemon/User/Proxies/ProxyClients.html
http://lynx.isc.org/lynx2.8.6/lynx2-8-6/lynx_help/keystrokes/environments.html
curl(1)
wget(1)
http://www.gnu.org/software/emacs/manual/html_node/url/Proxies.html
--
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2129>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list