X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Faccess%2Fhttp.c;h=4d78ac021ecf4fbd1a434e1d9e61326169379cfd;hb=9da6dd53dab766aec020176861fcd63c606619b6;hp=79073bf9bb36de41ff68a4cb10ed3946373d0129;hpb=acd55c477e4c12311b8b276947f3b8bf06fb4103;p=vlc diff --git a/modules/access/http.c b/modules/access/http.c index 79073bf9bb..4d78ac021e 100644 --- a/modules/access/http.c +++ b/modules/access/http.c @@ -53,8 +53,8 @@ #include -#ifdef HAVE_PROXY_H -# include "proxy.h" +#ifdef HAVE_LIBPROXY +# include #endif /***************************************************************************** * Module descriptor @@ -95,12 +95,12 @@ static void Close( vlc_object_t * ); #define FORWARD_COOKIES_TEXT N_("Forward Cookies") #define FORWARD_COOKIES_LONGTEXT N_("Forward Cookies across http redirections ") -vlc_module_begin(); - set_description( N_("HTTP input") ); - set_capability( "access", 0 ); - set_shortname( N_( "HTTP(S)" ) ); - set_category( CAT_INPUT ); - set_subcategory( SUBCAT_INPUT_ACCESS ); +vlc_module_begin () + set_description( N_("HTTP input") ) + set_capability( "access", 0 ) + set_shortname( N_( "HTTP(S)" ) ) + set_category( CAT_INPUT ) + set_subcategory( SUBCAT_INPUT_ACCESS ) add_string( "http-proxy", NULL, NULL, PROXY_TEXT, PROXY_LONGTEXT, false ); @@ -114,16 +114,16 @@ vlc_module_begin(); RECONNECT_LONGTEXT, true ); add_bool( "http-continuous", 0, NULL, CONTINUOUS_TEXT, CONTINUOUS_LONGTEXT, true ); - add_bool( "http-forward-cookies", 0, NULL, FORWARD_COOKIES_TEXT, + add_bool( "http-forward-cookies", true, NULL, FORWARD_COOKIES_TEXT, FORWARD_COOKIES_LONGTEXT, true ); - add_obsolete_string("http-user"); - add_obsolete_string("http-pwd"); - add_shortcut( "http" ); - add_shortcut( "https" ); - add_shortcut( "unsv" ); - add_shortcut( "itpc" ); /* iTunes Podcast */ - set_callbacks( Open, Close ); -vlc_module_end(); + add_obsolete_string("http-user") + add_obsolete_string("http-pwd") + add_shortcut( "http" ) + add_shortcut( "https" ) + add_shortcut( "unsv" ) + add_shortcut( "itpc" ) /* iTunes Podcast */ + set_callbacks( Open, Close ) +vlc_module_end () /***************************************************************************** * Local prototypes @@ -326,7 +326,7 @@ static int OpenWithCookies( vlc_object_t *p_this, vlc_array_t *cookies ) vlc_UrlParse( &p_sys->proxy, psz, 0 ); free( psz ); } -#ifdef HAVE_PROXY_H +#ifdef HAVE_LIBPROXY else { pxProxyFactory *pf = px_proxy_factory_new(); @@ -440,6 +440,7 @@ connect: if( p_sys->url.psz_username && p_sys->url.psz_password && p_sys->auth.psz_nonce && p_sys->auth.i_nonce == 0 ) { + Disconnect( p_access ); goto connect; } snprintf( psz_msg, 250, @@ -457,6 +458,7 @@ connect: if( psz_password ) p_sys->url.psz_password = strdup( psz_password ); free( psz_login ); free( psz_password ); + Disconnect( p_access ); goto connect; } else @@ -640,7 +642,7 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len ) access_sys_t *p_sys = p_access->p_sys; int i_read; - if( p_sys->fd < 0 ) + if( p_sys->fd == -1 ) { p_access->info.b_eof = true; return 0; @@ -1019,8 +1021,8 @@ static int Connect( access_t *p_access, int64_t i_tell ) p_access->info.i_pos = i_tell; p_access->info.b_eof = false; - /* Open connection */ + assert( p_sys->fd == -1 ); /* No open sockets (leaking fds is BAD) */ p_sys->fd = net_ConnectTCP( p_access, srv.psz_host, srv.i_port ); if( p_sys->fd == -1 ) { @@ -1408,6 +1410,8 @@ static int Request( access_t *p_access, int64_t i_tell ) p_sys->i_icy_meta = atoi( p ); if( p_sys->i_icy_meta < 0 ) p_sys->i_icy_meta = 0; + if( p_sys->i_icy_meta > 0 ) + p_sys->b_icecast = true; msg_Warn( p_access, "ICY metaint=%d", p_sys->i_icy_meta ); }