diff options
author | cboesch <cboesch@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2011-02-26 11:57:18 +0000 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-10-30 19:50:20 +0100 |
commit | 5a6dde54af8ce7208585a9e7ad0ef3ede26f24e0 (patch) | |
tree | a1ebd8ec492be4b2d809ab8b91bb5b6dd4b37b37 /stream/network.c | |
parent | a0d7595206e8f536aaf14beb65015e50ceb4f32c (diff) | |
download | mpv-5a6dde54af8ce7208585a9e7ad0ef3ede26f24e0.tar.bz2 mpv-5a6dde54af8ce7208585a9e7ad0ef3ede26f24e0.tar.xz |
url: simplify
Use mp_asprintf in make_noauth_url and make_http_proxy_url.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32971 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: cboesch
Conflicts:
stream/url.c
Note: the mp_asprintf() function was introduced in r32970, and put
into its own files. We just put that directly into url.c, as we use
talloc_asprintf() in general, and mp_asprintf() is for url.c code only.
(Making url.c use talloc would probably result in a big mess.)
Make proxy and url parameter const in get_noauth_url and get_http_proxy_url.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32972 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: cboesch
Diffstat (limited to 'stream/network.c')
-rw-r--r-- | stream/network.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/stream/network.c b/stream/network.c index 7d45ca71d9..572114a806 100644 --- a/stream/network.c +++ b/stream/network.c @@ -121,7 +121,6 @@ check4proxies( URL_t *url ) { proxy = getenv("http_proxy"); if( proxy!=NULL ) { // We got a proxy, build the URL to use it - int len; char *new_url; URL_t *tmp_url; URL_t *proxy_url = url_new( proxy ); @@ -142,14 +141,12 @@ check4proxies( URL_t *url ) { #endif mp_msg(MSGT_NETWORK,MSGL_V,"Using HTTP proxy: %s\n", proxy_url->url ); - len = make_http_proxy_url(proxy_url, url->url, NULL, 0) + 1; - new_url = malloc(len); + new_url = get_http_proxy_url(proxy_url, url->url); if( new_url==NULL ) { mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n"); url_free(proxy_url); return url_out; } - make_http_proxy_url(proxy_url, url->url, new_url, len); tmp_url = url_new( new_url ); if( tmp_url==NULL ) { free( new_url ); |