X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Faccess%2Fhttp.c;h=1c6962dceb1069852ac8cd8ea77e91fffa239149;hb=5a13b475ceef886157d0d87decab17a3b0e354f8;hp=3979cd85aa7ca2c49accbb353752bcab392fc16a;hpb=bd369da1d68b20977347b1d0d09d20f8155d94b1;p=vlc diff --git a/modules/access/http.c b/modules/access/http.c index 3979cd85aa..1c6962dceb 100644 --- a/modules/access/http.c +++ b/modules/access/http.c @@ -2,7 +2,7 @@ * http.c: HTTP access plug-in ***************************************************************************** * Copyright (C) 2001, 2002 VideoLAN - * $Id: http.c,v 1.17 2002/12/12 15:10:58 gbazin Exp $ + * $Id: http.c,v 1.24 2003/02/20 01:52:45 sigmunau Exp $ * * Authors: Christophe Massiot * @@ -26,6 +26,7 @@ *****************************************************************************/ #include #include +#include #include #include @@ -36,6 +37,10 @@ # include #endif +#ifdef HAVE_SYS_TIME_H +# include +#endif + #ifdef HAVE_UNISTD_H # include #elif defined( _MSC_VER ) && defined( _WIN32 ) && !defined( UNDER_CE ) @@ -73,7 +78,7 @@ static ssize_t Read ( input_thread_t *, byte_t *, size_t ); #define PROXY_TEXT N_("specify an HTTP proxy") #define PROXY_LONGTEXT N_( \ "Specify an HTTP proxy to use. It must be in the form " \ - "http://myproxy.mydomain:myport . If none is specified, the HTTP_PROXY" \ + "http://myproxy.mydomain:myport. If none is specified, the HTTP_PROXY " \ "environment variable will be tried." ) #define CACHING_TEXT N_("caching value in ms") @@ -82,9 +87,9 @@ static ssize_t Read ( input_thread_t *, byte_t *, size_t ); "value should be set in miliseconds units." ) vlc_module_begin(); - add_category_hint( N_("http"), NULL ); - add_string( "http-proxy", NULL, NULL, PROXY_TEXT, PROXY_LONGTEXT ); - add_integer( "http-caching", 4 * DEFAULT_PTS_DELAY / 1000, NULL, CACHING_TEXT, CACHING_LONGTEXT ); + add_category_hint( N_("http"), NULL, VLC_FALSE ); + add_string( "http-proxy", NULL, NULL, PROXY_TEXT, PROXY_LONGTEXT, VLC_FALSE ); + add_integer( "http-caching", 4 * DEFAULT_PTS_DELAY / 1000, NULL, CACHING_TEXT, CACHING_LONGTEXT, VLC_TRUE ); set_description( _("HTTP access module") ); set_capability( "access", 0 ); add_shortcut( "http" ); @@ -437,6 +442,14 @@ static int Open( vlc_object_t *p_this ) while( *psz_parser && *psz_parser != ':' && *psz_parser != '/' ) { + if( *psz_parser == '[' ) + { + /* IPv6 address */ + while( *psz_parser && *psz_parser != ']' ) + { + psz_parser++; + } + } psz_parser++; } @@ -573,7 +586,7 @@ static int Open( vlc_object_t *p_this ) p_access_data->socket_desc.i_type = NETWORK_TCP; snprintf( p_access_data->psz_buffer, MAX_QUERY_SIZE, - "GET http://%s:%d/%s\r\n HTTP/1.0\r\n", + "GET http://%s:%d/%s HTTP/1.0\r\n", psz_server_addr, i_server_port, psz_path ); } else @@ -600,6 +613,7 @@ static int Open( vlc_object_t *p_this ) vlc_mutex_lock( &p_input->stream.stream_lock ); p_input->stream.b_pace_control = VLC_TRUE; p_input->stream.b_seekable = VLC_TRUE; + p_input->stream.b_connected = VLC_TRUE; p_input->stream.p_selected_area->i_tell = 0; p_input->stream.p_selected_area->i_size = 0; p_input->stream.i_method = INPUT_METHOD_NETWORK;