[vlc-commits] mmsh: fix URLs with query and no path
Rémi Denis-Courmont
git at videolan.org
Thu Aug 27 20:38:20 CEST 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Aug 27 19:53:30 2015 +0300| [b092aef5ed275d4313a3497941c3044dff1459ef] | committer: Rémi Denis-Courmont
mmsh: fix URLs with query and no path
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b092aef5ed275d4313a3497941c3044dff1459ef
---
modules/access/mms/mmsh.c | 16 ++++++++++------
modules/access/mms/mmstu.c | 2 +-
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/modules/access/mms/mmsh.c b/modules/access/mms/mmsh.c
index 1d04e71..4241b21 100644
--- a/modules/access/mms/mmsh.c
+++ b/modules/access/mms/mmsh.c
@@ -105,7 +105,7 @@ int MMSHOpen( access_t *p_access )
if( psz_proxy )
{
p_sys->b_proxy = true;
- vlc_UrlParse( &p_sys->proxy, psz_proxy, 0 );
+ vlc_UrlParse( &p_sys->proxy, psz_proxy, '?' );
free( psz_proxy );
}
else
@@ -114,7 +114,7 @@ int MMSHOpen( access_t *p_access )
if( http_proxy )
{
p_sys->b_proxy = true;
- vlc_UrlParse( &p_sys->proxy, http_proxy, 0 );
+ vlc_UrlParse( &p_sys->proxy, http_proxy, '?' );
}
}
@@ -136,7 +136,7 @@ int MMSHOpen( access_t *p_access )
}
/* open a tcp connection */
- vlc_UrlParse( &p_sys->url, p_access->psz_location, 0 );
+ vlc_UrlParse( &p_sys->url, p_access->psz_location, '?' );
if( ( p_sys->url.psz_host == NULL ) ||
( *p_sys->url.psz_host == '\0' ) )
{
@@ -531,11 +531,13 @@ static int OpenConnection( access_t *p_access )
if( p_sys->b_proxy )
{
- net_Printf( p_access, p_sys->fd, "GET http://%s:%d%s HTTP/1.0\r\n",
+ net_Printf( p_access, p_sys->fd, "GET http://%s:%d%s%s%s HTTP/1.0\r\n",
p_sys->url.psz_host, p_sys->url.i_port,
( (p_sys->url.psz_path == NULL) ||
(*p_sys->url.psz_path == '\0') ) ?
- "/" : p_sys->url.psz_path );
+ "/" : p_sys->url.psz_path,
+ p_sys->url.psz_option ? "?" : "",
+ p_sys->url.psz_option ? p_sys->url.psz_option : "" );
/* Proxy Authentication */
if( p_sys->proxy.psz_username && *p_sys->proxy.psz_username )
@@ -557,11 +559,13 @@ static int OpenConnection( access_t *p_access )
}
else
{
- net_Printf( p_access, p_sys->fd, "GET %s HTTP/1.0\r\n"
+ net_Printf( p_access, p_sys->fd, "GET %s%s%s HTTP/1.0\r\n"
"Host: %s:%d\r\n",
( (p_sys->url.psz_path == NULL) ||
(*p_sys->url.psz_path == '\0') ) ?
"/" : p_sys->url.psz_path,
+ p_sys->url.psz_option ? "?" : "",
+ p_sys->url.psz_option ? p_sys->url.psz_option : "",
p_sys->url.psz_host, p_sys->url.i_port );
}
return VLC_SUCCESS;
diff --git a/modules/access/mms/mmstu.c b/modules/access/mms/mmstu.c
index 662c4e5..a0e5cec 100644
--- a/modules/access/mms/mmstu.c
+++ b/modules/access/mms/mmstu.c
@@ -105,7 +105,7 @@ int MMSTUOpen( access_t *p_access )
vlc_mutex_init( &p_sys->lock_netwrite );
/* *** Parse URL and get server addr/port and path *** */
- vlc_UrlParse( &p_sys->url, p_access->psz_location, 0 );
+ vlc_UrlParse( &p_sys->url, p_access->psz_location, '?' );
if( p_sys->url.psz_host == NULL || *p_sys->url.psz_host == '\0' )
{
msg_Err( p_access, "invalid server name" );
More information about the vlc-commits
mailing list