diff options
author | Niels Vorgaard Christensen <vorgaard.c@math.ku.dk> | 2009-01-01 15:42:09 +0000 |
---|---|---|
committer | Niels Vorgaard Christensen <vorgaard.c@math.ku.dk> | 2009-01-01 15:42:09 +0000 |
commit | ed75705f86a14bfd255aa5183803e4a6c5ce90c8 (patch) | |
tree | 6b079063468d299011bfcdc1e13b3ecb3d7ab43f | |
parent | 131f262634da90d97879d8de32a0eee90942179f (diff) | |
download | xine-lib-ed75705f86a14bfd255aa5183803e4a6c5ce90c8.tar.gz xine-lib-ed75705f86a14bfd255aa5183803e4a6c5ce90c8.tar.bz2 |
libmms does not handle percent-encoded uri
libmms will always fail to request media with URIs containing percent-encoded
characters. This is because the path component in the MMS URI should be
decoded before it is sent to the server.
http://download.microsoft.com/download/9/5/E/95EF66AF-9026-4BB0-A41D-A4F81802D92C/%5BMS-MMSP%5D.pdf
(page 48)
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/input/mms.c | 14 |
2 files changed, 12 insertions, 3 deletions
@@ -15,6 +15,7 @@ xine-lib (1.1.16) 2008-??-?? * Recognise Xv "blitter" adaptors for port selection purposes. NOTE: you will need to remove ~/.xine/catalog.cache when upgrading from xine-lib 1.1.15 or older if you wish to use this extra option. + * Fix MMS media requests where the URI contains %-encoded characters. xine-lib (1.1.15) 2008-08-14 * Security fixes: diff --git a/src/input/mms.c b/src/input/mms.c index ab1983955..b2d00a46e 100644 --- a/src/input/mms.c +++ b/src/input/mms.c @@ -290,7 +290,7 @@ static int send_command (mms_t *this, int command, #ifdef USE_ICONV static iconv_t string_utf16_open() { - return iconv_open("UTF-16LE", nl_langinfo(CODESET)); + return iconv_open("UTF-16LE", "UTF-8"); } static void string_utf16_close(iconv_t url_conv) { @@ -771,10 +771,17 @@ mms_t *mms_connect (xine_stream_t *stream, const char *url, int bandwidth) { /* command 0x5 */ { mms_buffer_t command_buffer; - char *path = this->uri; - size_t pathlen = strlen(path); + char *path, *unescaped; + size_t pathlen; + + unescaped = strdup (this->uri); + if (!unescaped) + goto fail; + _x_mrl_unescape (unescaped); /* remove the first '/' */ + path = unescaped; + pathlen = strlen (path); if (pathlen > 1) { path++; pathlen--; @@ -785,6 +792,7 @@ mms_t *mms_connect (xine_stream_t *stream, const char *url, int bandwidth) { mms_buffer_put_32 (&command_buffer, 0x00000000); /* ?? */ mms_buffer_put_32 (&command_buffer, 0x00000000); /* ?? */ string_utf16 (url_conv, this->scmd_body + command_buffer.pos, path, pathlen); + free (unescaped); if (!send_command (this, 5, 1, 0xffffffff, pathlen * 2 + 12)) goto fail; } |