Commit ac4744b7 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

mms: use vlc_getProxyUrl()

parent 0535b128
......@@ -55,12 +55,6 @@ static void Close( vlc_object_t * );
#define BITRATE_LONGTEXT N_( \
"Select the stream with the maximum bitrate under that limit." )
#define PROXY_TEXT N_("HTTP proxy")
#define PROXY_LONGTEXT N_( \
"HTTP proxy to be used It must be of the form " \
"http://[user[:pass]@]myproxy.mydomain:myport/ ; " \
"if empty, the http_proxy environment variable will be tried." )
#define TIMEOUT_TEXT N_("TCP/UDP timeout (ms)")
#define TIMEOUT_LONGTEXT N_("Amount of time (in ms) to wait before aborting network reception of data. Note that there will be 10 retries before completely giving up.")
......@@ -77,8 +71,7 @@ vlc_module_begin ()
add_bool( "mms-all", false, ALL_TEXT, ALL_LONGTEXT, true )
add_integer( "mms-maxbitrate", 0, BITRATE_TEXT, BITRATE_LONGTEXT ,
false )
add_string( "mmsh-proxy", NULL, PROXY_TEXT, PROXY_LONGTEXT,
false )
add_obsolete_string( "mmsh-proxy" ) /* since 3.0.0 */
add_shortcut( "mms", "mmsu", "mmst", "mmsh" )
set_callbacks( Open, Close )
......
......@@ -77,7 +77,6 @@ int MMSHOpen( access_t *p_access )
{
access_sys_t *p_sys;
char *psz_location = NULL;
char *psz_proxy;
STANDARD_BLOCK_ACCESS_INIT
......@@ -87,39 +86,15 @@ int MMSHOpen( access_t *p_access )
/* Handle proxy */
p_sys->b_proxy = false;
memset( &p_sys->proxy, 0, sizeof(p_sys->proxy) );
/* Check proxy */
/* TODO reuse instead http-proxy from http access ? */
psz_proxy = var_CreateGetNonEmptyString( p_access, "mmsh-proxy" );
if( !psz_proxy )
{
char *psz_http_proxy = var_InheritString( p_access, "http-proxy" );
if( psz_http_proxy )
{
psz_proxy = psz_http_proxy;
var_SetString( p_access, "mmsh-proxy", psz_proxy );
}
}
if( psz_proxy )
char *psz_proxy = vlc_getProxyUrl( p_access->psz_url );
if( psz_proxy != NULL )
{
p_sys->b_proxy = true;
vlc_UrlParse( &p_sys->proxy, psz_proxy );
free( psz_proxy );
}
else
{
const char *http_proxy = getenv( "http_proxy" );
if( http_proxy )
{
p_sys->b_proxy = true;
vlc_UrlParse( &p_sys->proxy, http_proxy );
}
}
if( p_sys->b_proxy )
{
if( ( p_sys->proxy.psz_host == NULL ) ||
( *p_sys->proxy.psz_host == '\0' ) )
{
......@@ -172,7 +147,8 @@ int MMSHOpen( access_t *p_access )
return VLC_SUCCESS;
error:
vlc_UrlClean( &p_sys->proxy );
if( p_sys->b_proxy )
vlc_UrlClean( &p_sys->proxy );
vlc_UrlClean( &p_sys->url );
free( p_sys );
return VLC_EGENERIC;
......@@ -189,7 +165,8 @@ void MMSHClose ( access_t *p_access )
free( p_sys->p_header );
vlc_UrlClean( &p_sys->proxy );
if( p_sys->b_proxy )
vlc_UrlClean( &p_sys->proxy );
vlc_UrlClean( &p_sys->url );
free( p_sys );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment