]> git.sesse.net Git - vlc/blobdiff - modules/access/http.c
* include/configuration.h: added a new flag to the configuration stucture to
[vlc] / modules / access / http.c
index 3979cd85aa7ca2c49accbb353752bcab392fc16a..1c6962dceb1069852ac8cd8ea77e91fffa239149 100644 (file)
@@ -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 <massiot@via.ecp.fr>
  *
@@ -26,6 +26,7 @@
  *****************************************************************************/
 #include <stdlib.h>
 #include <string.h>
+#include <sys/time.h>
 #include <vlc/vlc.h>
 #include <vlc/input.h>
 
 #   include <fcntl.h>
 #endif
 
+#ifdef HAVE_SYS_TIME_H
+#    include <sys/time.h>
+#endif
+
 #ifdef HAVE_UNISTD_H
 #   include <unistd.h>
 #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;