diff options
author | cboesch <cboesch@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-12-03 23:10:36 +0000 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-12-16 05:19:17 +0200 |
commit | 1737297b581eca0ebcb7a399253771450cc24176 (patch) | |
tree | 77ac3a89101319331bee9d35f5bff7ef574bfb6a /stream/url.c | |
parent | db522b94e05ba42ebe1ec489d9a61b2e254a9c84 (diff) | |
download | mpv-1737297b581eca0ebcb7a399253771450cc24176.tar.bz2 mpv-1737297b581eca0ebcb7a399253771450cc24176.tar.xz |
stream/http: Add support for login/password in http_proxy env variable
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32673 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream/url.c')
-rw-r--r-- | stream/url.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/stream/url.c b/stream/url.c index 92ea058831..c898d092b5 100644 --- a/stream/url.c +++ b/stream/url.c @@ -67,6 +67,19 @@ static int make_noauth_url(URL_t *url, char *dst, int dst_size) url->hostname, url->file); } +int make_http_proxy_url(URL_t *proxy, const char *host_url, char *dst, + int dst_size) +{ + if (proxy->username) + return snprintf(dst, dst_size, "http_proxy://%s:%s@%s:%d/%s", + proxy->username, + proxy->password ? proxy->password : "", + proxy->hostname, proxy->port, host_url); + else + return snprintf(dst, dst_size, "http_proxy://%s:%d/%s", + proxy->hostname, proxy->port, host_url); +} + URL_t* url_new(const char* url) { int pos1, pos2,v6addr = 0, noauth_len; |