/*****************************************************************************
* Preamble
*****************************************************************************/
-#define _GNU_SOURCE
-#include <stdlib.h>
#include <vlc/vlc.h>
#include <vlc_access.h>
#include "mmsh.h"
/* TODO:
- * - http_proxy
* - authentication
*/
/* Check proxy */
/* TODO reuse instead http-proxy from http access ? */
psz_proxy = var_CreateGetString( p_access, "mmsh-proxy" );
+ if( !*psz_proxy )
+ {
+ char *psz_http_proxy = config_GetPsz( p_access, "http-proxy" );
+ if( psz_http_proxy && *psz_http_proxy )
+ {
+ free( psz_proxy );
+ psz_proxy = psz_http_proxy;
+ var_SetString( p_access, "mmsh-proxy", psz_proxy );
+ }
+ else
+ {
+ free( psz_http_proxy );
+ }
+ }
if( *psz_proxy )
{
p_sys->b_proxy = VLC_TRUE;
p_sys->p_packet = NULL;
E_( GenerateGuid )( &p_sys->guid );
- OpenConnection( p_access );
+ if( OpenConnection( p_access ) )
+ return VLC_EGENERIC;
net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL,
"Accept: */*\r\n"
}
return VLC_EGENERIC;
}
+
static void GetHeader( access_t *p_access )
{
access_sys_t *p_sys = p_access->p_sys;
return VLC_EGENERIC;
}
- OpenConnection( p_access );
+ if( OpenConnection( p_access ) )
+ return VLC_EGENERIC;
net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL,
"Accept: */*\r\n"