|
|
cURL Mailing List Monthly Index Single Mail
curl-tracker Archives
[curl:bugs] #1278 Parse rtmp token utf-8 character
From: Daniel Stenberg <bagder_at_users.sf.net>
Date: Thu, 12 Sep 2013 18:32:47 +0000
Urgh. How annoying.
Yes, a URL should only require valid URL characters to be part of the string and spaces and #-letters are not. I claim librtmp is broken in this aspect. But I also acknowledge that me saying this doesn't help you with this problem one bit.
I first considered that perhaps the bug is in libcurl and perhaps we should url-decode the URL string before we pass it to RTMP_SetupURL() but I'm not convinced that is the correct route either as for example http://rtmpdump.mplayerhq.hu/librtmp.3.html shows how to use the function and it encourages an illegal URL to be used. I'm a bit concerned that URL-decoding before passing it to librtmp may have some other side-effects I haven't really thought about even if it would allow %23 to be used instead of the literal #...
--- ** [bugs:#1278] Parse rtmp token utf-8 character ** **Status:** open **Labels:** rtmp token utf-8 character **Created:** Wed Sep 11, 2013 03:58 PM UTC by Gorilla Maguila **Last Updated:** Wed Sep 11, 2013 10:39 PM UTC **Owner:** Daniel Stenberg Steps to reproduce: ~~~~~~ $curl "rtmp://live.iguide.to/edge swfUrl=http://player.ilive.to/player_ilive_2.swf pageUrl=http://www.ilive.to playpath=nz7l9vc5nv1og7b token=#e87JDUJD264YED687 live=1" ~~~~~~ Output: ~~~~~~ ERROR: RTMP_ReadPacket, failed to read RTMP packet header curl: (2) Failed initialization ~~~~~~ The error happens due to not parsing the correct token because of "#" character. To test that I just put a printf in rtmp_setup like this: ~~~~~~ static CURLcode rtmp_setup(struct connectdata *conn) { RTMP *r = RTMP_Alloc(); if(!r) return CURLE_OUT_OF_MEMORY; RTMP_Init(r); RTMP_SetBufferMS(r, DEF_BUFTIME); printf( "CURLcode rtmp_setup %s \n", conn->data->change.url); if(!RTMP_SetupURL(r, conn->data->change.url)) { RTMP_Free(r); return CURLE_URL_MALFORMAT; } conn->proto.generic = r; return CURLE_OK; } ~~~~~~ The output is: ~~~~~~ CURLcode rtmp_setup rtmp://live.iguide.to/edge swfUrl=http://player.ilive.to/player_ilive_2.swf pageUrl=http://www.ilive.to playpath=nz7l9vc5nv1og7b token= ERROR: RTMP_ReadPacket, failed to read RTMP packet header curl: (2) Failed initialization ~~~~~~ If no "#" it's present the token it's parsed correctly: ~~~~~~ $curl "rtmp://live.iguide.to/edge swfUrl=http://player.ilive.to/player_ilive_2.swf pageUrl=http://www.ilive.to playpath=nz7l9vc5nv1og7b token=e87JDUJD264YED687 live=1" ~~~~~~ Although the rtmp response fails as it's normal: ~~~~~~ CURLcode rtmp_setup rtmp://live.iguide.to/edge swfUrl=http://player.ilive.to/player_ilive_2.swf pageUrl=http://www.ilive.to playpath=nz7l9vc5nv1og7b token=e87JDUJD264YED687 live=1: ERROR: RTMP_ReadPacket, failed to read RTMP packet header curl: (2) Failed initialization ~~~~~~ --- Sent from sourceforge.net because curl-tracker@cool.haxx.se is subscribed to https://sourceforge.net/p/curl/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/curl/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.Received on 2013-09-12 These mail archives are generated by hypermail. |
Page updated May 06, 2013.
web site info