Commit 882422ab authored by Sam Hocevar's avatar Sam Hocevar

* Added User-Agent header in the HTTP input.

  * Fixed an input segfault which occured using ES input.
parent 5d011ad3
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
/* "(" PROGRAM_BUILD ") (" PROGRAM_OPTIONS ")\n" */ \ /* "(" PROGRAM_BUILD ") (" PROGRAM_OPTIONS ")\n" */ \
"Copyright 1996-2001 VideoLAN\n" "Copyright 1996-2001 VideoLAN\n"
#define COPYRIGHT_MESSAGE "VideoLAN Client - version @VLC_VERSION@" \ #define COPYRIGHT_MESSAGE "VideoLAN Client - version @VLC_VERSION@" \
" @VLC_CODENAME@ - (C)1996-2001 VideoLAN\n" " @VLC_CODENAME@ - (C)1996-2001 VideoLAN"
#define VERSION "@VLC_VERSION@" #define VERSION "@VLC_VERSION@"
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* decoders. * decoders.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input.c,v 1.140 2001/10/03 13:14:05 sam Exp $ * $Id: input.c,v 1.141 2001/10/03 15:10:55 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -1173,17 +1173,22 @@ static void HTTPOpen( input_thread_t * p_input ) ...@@ -1173,17 +1173,22 @@ static void HTTPOpen( input_thread_t * p_input )
p_input->stream.b_seekable = 0; p_input->stream.b_seekable = 0;
p_input->stream.b_pace_control = 1; /* TCP/IP... */ p_input->stream.b_pace_control = 1; /* TCP/IP... */
# define HTTP_USERAGENT "User-Agent: " COPYRIGHT_MESSAGE "\r\n"
# define HTTP_END "\r\n"
/* Prepare GET ... */ /* Prepare GET ... */
if( psz_proxy != NULL ) if( psz_proxy != NULL )
{ {
snprintf( psz_buffer, sizeof(psz_buffer), snprintf( psz_buffer, sizeof(psz_buffer),
"GET http://%s:%d/%s HTTP/1.0\r\n\r\n", psz_server, "GET http://%s:%d/%s HTTP/1.0\r\n"
i_port, psz_path ); HTTP_USERAGENT HTTP_END,
psz_server, i_port, psz_path );
} }
else else
{ {
snprintf( psz_buffer, sizeof(psz_buffer), snprintf( psz_buffer, sizeof(psz_buffer),
"GET /%s HTTP/1.0\r\nHost: %s\r\n\r\n", "GET /%s HTTP/1.0\r\nHost: %s\r\n"
HTTP_USERAGENT HTTP_END,
psz_path, psz_server ); psz_path, psz_server );
} }
psz_buffer[sizeof(psz_buffer) - 1] = '\0'; psz_buffer[sizeof(psz_buffer) - 1] = '\0';
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_programs.c: es_descriptor_t, pgrm_descriptor_t management * input_programs.c: es_descriptor_t, pgrm_descriptor_t management
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: input_programs.c,v 1.62 2001/10/02 16:46:59 massiot Exp $ * $Id: input_programs.c,v 1.63 2001/10/03 15:10:55 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -76,6 +76,10 @@ int input_InitStream( input_thread_t * p_input, size_t i_data_len ) ...@@ -76,6 +76,10 @@ int input_InitStream( input_thread_t * p_input, size_t i_data_len )
} }
memset( p_input->stream.p_demux_data, 0, i_data_len ); memset( p_input->stream.p_demux_data, 0, i_data_len );
} }
else
{
p_input->stream.p_demux_data = NULL;
}
return 0; return 0;
} }
...@@ -191,6 +195,10 @@ pgrm_descriptor_t * input_AddProgram( input_thread_t * p_input, ...@@ -191,6 +195,10 @@ pgrm_descriptor_t * input_AddProgram( input_thread_t * p_input,
memset( p_input->stream.pp_programs[i_pgrm_index]->p_demux_data, 0, memset( p_input->stream.pp_programs[i_pgrm_index]->p_demux_data, 0,
i_data_len ); i_data_len );
} }
else
{
p_input->stream.pp_programs[i_pgrm_index]->p_demux_data = NULL;
}
return p_input->stream.pp_programs[i_pgrm_index]; return p_input->stream.pp_programs[i_pgrm_index];
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* and spawn threads. * and spawn threads.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: main.c,v 1.116 2001/10/01 16:18:49 massiot Exp $ * $Id: main.c,v 1.117 2001/10/03 15:10:55 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -304,7 +304,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) ...@@ -304,7 +304,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
return( errno ); return( errno );
} }
intf_MsgImm( COPYRIGHT_MESSAGE ); intf_MsgImm( COPYRIGHT_MESSAGE "\n" );
/* /*
* Read configuration * Read configuration
......
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