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: Daniel Stenberg <bagder_at_users.sf.net>
Date: Wed, 11 Sep 2013 22:04:22 +0000

Wrong as in not a valid URL (or actually a URI as the specs say).

Spaces aren't part of URIs, they should either not be there at all or be encoded as %20.

'#' marks a "fragment". RFC3986 details how they work, chapter 3.5 mentions fragments and they say "Fragment identifier semantics are independent of the URI scheme and thus cannot be redefined by scheme specifications."

curl is very liberal in what it accepts so don't expect that to be a very good judge of what's a "legal" URL and what isn't. If the code treats %23 wrongly, then I suspect that's an error since a URL should be able to use letters url encoded fine

---
** [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 05:48 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