cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[curl:bugs] #1278 Parse rtmp token utf-8 character

From: Gorilla Maguila <gorillamaguila_at_users.sf.net>
Date: Wed, 11 Sep 2013 22:39:21 +0000

Well being true that it's nt a valid URL, curl supports librtmp and in librtmp parameters internally are passed with white spaces.

So in the end you are telling me that that librtmp should handle url encoded characters? what if the token or another paramater actually need %23 characters instead of # for example token=%23abc instead of token=#abc ?

---
** [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:04 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.

donate! Page updated May 06, 2013.
web site info

File upload with ASP.NET