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

HTTP: remove --http-use-IE-proxy and assume it is always true

Nobody is ever going to use this if it needs to be enabled.
parent 5192e2f1
...@@ -97,11 +97,6 @@ static void Close( vlc_object_t * ); ...@@ -97,11 +97,6 @@ static void Close( vlc_object_t * );
#define FORWARD_COOKIES_TEXT N_("Forward Cookies") #define FORWARD_COOKIES_TEXT N_("Forward Cookies")
#define FORWARD_COOKIES_LONGTEXT N_("Forward Cookies across http redirections.") #define FORWARD_COOKIES_LONGTEXT N_("Forward Cookies across http redirections.")
#define USE_IE_PROXY_TEXT N_("Use Internet Explorer entered HTTP proxy server")
#define USE_IE_PROXY_LONGTEXT N_("Use Internet Explorer entered HTTP proxy " \
"server for all URL. Don't take into account bypasses settings and auto " \
"configuration scripts.")
#define REFERER_TEXT N_("HTTP referer value") #define REFERER_TEXT N_("HTTP referer value")
#define REFERER_LONGTEXT N_("Customize the HTTP referer, simulating a previous document") #define REFERER_LONGTEXT N_("Customize the HTTP referer, simulating a previous document")
...@@ -134,10 +129,6 @@ vlc_module_begin () ...@@ -134,10 +129,6 @@ vlc_module_begin ()
change_safe() change_safe()
add_bool( "http-forward-cookies", true, FORWARD_COOKIES_TEXT, add_bool( "http-forward-cookies", true, FORWARD_COOKIES_TEXT,
FORWARD_COOKIES_LONGTEXT, true ) FORWARD_COOKIES_LONGTEXT, true )
#ifdef WIN32
add_bool( "http-use-IE-proxy", false, USE_IE_PROXY_TEXT,
USE_IE_PROXY_LONGTEXT, true )
#endif
/* 'itpc' = iTunes Podcast */ /* 'itpc' = iTunes Podcast */
add_shortcut( "http", "https", "unsv", "itpc", "icyx" ) add_shortcut( "http", "https", "unsv", "itpc", "icyx" )
set_callbacks( Open, Close ) set_callbacks( Open, Close )
...@@ -395,63 +386,52 @@ static int OpenWithCookies( vlc_object_t *p_this, const char *psz_access, ...@@ -395,63 +386,52 @@ static int OpenWithCookies( vlc_object_t *p_this, const char *psz_access,
} }
#elif defined( WIN32 ) #elif defined( WIN32 )
else else
{
if( var_InheritBool( p_access, "http-use-IE-proxy" ) )
{ {
/* Try to get the proxy server address from Windows internet settings using registry. */ /* Try to get the proxy server address from Windows internet settings using registry. */
HKEY h_key; HKEY h_key;
/* Open the key */ /* Open the key */
if( RegOpenKeyEx( HKEY_CURRENT_USER, "Software\\Microsoft" \ if( RegOpenKeyEx( HKEY_CURRENT_USER, "Software\\Microsoft"
"\\Windows\\CurrentVersion\\Internet Settings", "\\Windows\\CurrentVersion\\Internet Settings",
0, KEY_READ, &h_key ) == ERROR_SUCCESS ) 0, KEY_READ, &h_key ) == ERROR_SUCCESS )
{ {
DWORD i_dataReadSize = 4; /* sizeof( DWORD ); */ DWORD len = sizeof( DWORD );
BYTE proxyEnable = 0; BYTE proxyEnable;
/* Get the proxy enable value */ /* Get the proxy enable value */
if( RegQueryValueEx( h_key, "ProxyEnable", NULL, NULL, if( RegQueryValueEx( h_key, "ProxyEnable", NULL, NULL,
&proxyEnable, &i_dataReadSize ) &proxyEnable, &len ) == ERROR_SUCCESS
== ERROR_SUCCESS ) && proxyEnable )
{
if( proxyEnable )
{
/* Proxy is enable */
char psz_key[256];
i_dataReadSize = 256;
if( RegQueryValueEx( h_key, "ProxyServer",
NULL, NULL, (unsigned char *)psz_key,
&i_dataReadSize )
== ERROR_SUCCESS )
{ {
/* Proxy is enabled */
/* Get the proxy URL : /* Get the proxy URL :
Proxy server value in the registry can be something like "address:port" Proxy server value in the registry can be something like "address:port"
or "ftp=address1:port1;http=address2:port2 ..." depending of the or "ftp=address1:port1;http=address2:port2 ..." depending of the
confirguration. */ confirguration. */
char *psz_proxy; unsigned char key[256];
psz_proxy = strstr( psz_key, "http=" );
len = sizeof( key );
if( RegQueryValueEx( h_key, "ProxyServer", NULL, NULL,
key, &len ) == ERROR_SUCCESS )
{
/* FIXME: This is lame. The string should be tokenized. */
#warning FIXME.
char *psz_proxy = strstr( (char *)key, "http=" );
if( psz_proxy != NULL ) if( psz_proxy != NULL )
{ {
psz_proxy += strlen( "http=" ); psz_proxy += 5;
char *psz_endUrl = strchr( psz_proxy, ';' ); char *end = strchr( psz_proxy, ';' );
if( psz_endUrl != NULL ) if( end != NULL )
*psz_endUrl = '\0'; *end = '\0';
} }
else else
psz_proxy = psz_key; psz_proxy = (char *)key;
/* Set proxy enable for this connection. */ /* Set proxy enable for this connection. */
p_sys->b_proxy = true; p_sys->b_proxy = true;
vlc_UrlParse( &p_sys->proxy, psz_proxy, 0 ); vlc_UrlParse( &p_sys->proxy, psz_proxy, 0 );
} }
msg_Warn( p_access, "Couldn't read in registry " \
"the proxy server address." );
}
}
else
msg_Warn( p_access, "Couldn't read in registry if the " \
"proxy is enable or not." );
} }
else else
msg_Warn( p_access, "Couldn't open internet settings key " \ msg_Dbg( p_access, "HTTP proxy disabled (MSIE)" );
"in registry." );
} }
} }
#else #else
......
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