/*****************************************************************************
* ftp.c:
*****************************************************************************
- * Copyright (C) 2001, 2002 VideoLAN
- * $Id: ftp.c,v 1.14 2003/03/30 18:14:35 gbazin Exp $
+ * Copyright (C) 2001-2003 VideoLAN
+ * $Id: ftp.c,v 1.21 2003/09/10 21:09:05 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
-#include <string.h>
#include <errno.h>
#include <fcntl.h>
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int Open ( vlc_object_t * );
-static void Close ( vlc_object_t * );
+static int Open ( vlc_object_t * );
+static void Close ( vlc_object_t * );
-static int Read ( input_thread_t * p_input, byte_t * p_buffer,
+static ssize_t Read ( input_thread_t * p_input, byte_t * p_buffer,
size_t i_len );
-static void Seek ( input_thread_t *, off_t );
+static void Seek ( input_thread_t *, off_t );
static ssize_t NetRead ( input_thread_t *, input_socket_t *, byte_t *, size_t );
/*****************************************************************************
* Module descriptor
*****************************************************************************/
-#define CACHING_TEXT N_("caching value in ms")
+#define CACHING_TEXT N_("Caching value in ms")
#define CACHING_LONGTEXT N_( \
"Allows you to modify the default caching value for ftp streams. This " \
"value should be set in miliseconds units." )
socket_desc.i_server_port = p_url->i_server_port;
socket_desc.psz_bind_addr = "";
socket_desc.i_bind_port = 0;
+ socket_desc.i_ttl = 0;
p_input->p_private = (void*)&socket_desc;
if( !( p_network = module_Need( p_input, "network", psz_network ) ) )
{
goto exit_error;
}
-#ifdef HAVE_ATOLL
p_access->i_filesize = atoll( psz_arg + 4 );
-#else
- {
- int64_t i_size = 0;
- char *psz_parser = psz_arg + 4;
-
- while( *psz_parser == ' ' ) psz_parser++;
-
- while( psz_parser[0] >= '0' && psz_parser[0] <= '9' )
- {
- i_size *= 10;
- i_size += psz_parser[0] - '0';
- }
- p_access->i_filesize = i_size;
- }
-#endif
msg_Dbg( p_input, "file size: "I64Fd, p_access->i_filesize );
FREE( psz_arg );
vlc_mutex_unlock( &p_input->stream.stream_lock );
}
-static int Read ( input_thread_t * p_input, byte_t * p_buffer,
+static ssize_t Read ( input_thread_t * p_input, byte_t * p_buffer,
size_t i_len )
{
access_t *p_access = (access_t*)p_input->p_access_data;
access_t *p_access = (access_t*)p_input->p_access_data;
va_list args;
char *psz_buffer;
-#if !defined(HAVE_VASPRINTF) || defined(SYS_DARWIN)
+#if !defined(HAVE_VASPRINTF) || defined(SYS_DARWIN) || defined(SYS_BEOS)
size_t i_size;
#endif
va_start( args, psz_fmt );
-#if defined(HAVE_VASPRINTF) && !defined(SYS_DARWIN)
+#if defined(HAVE_VASPRINTF) && !defined(SYS_DARWIN) && !defined(SYS_BEOS)
vasprintf( &psz_buffer, psz_fmt, args );
#else
i_size = strlen( psz_fmt ) + 2048;
socket_desc.i_server_port = i_port;
socket_desc.psz_bind_addr = "";
socket_desc.i_bind_port = 0;
+ socket_desc.i_ttl = 0;
p_input->p_private = (void*)&socket_desc;
if( !( p_network = module_Need( p_input, "network", "" ) ) )
{