[Live-devel] Range header parsing

Rob Casey rob.casey at swishgroup.com.au
Thu Aug 17 05:28:47 PDT 2006


Mea culpa - Thanks for the reply.
 
Regards,
Rob
 

________________________________

From: live-devel-bounces at ns.live555.com on behalf of Ross Finlayson
Sent: Thu 17/08/2006 10:04 PM
To: LIVE555 Streaming Media - development & use
Subject: Re: [Live-devel] Range header parsing



	I would note that within the parseRangeHeader function (in the file liveMedia/RTSPServer.cpp), the Range header is parsed expecting spaces to be present between the elements of the NPT specification.  See below:
	
	    590   float start, end;
	    591   if (sscanf(fields, "npt = %f - %f", &start, &end) == 2) {
	    592     rangeStart = start;
	    593     rangeEnd = end;
	    594   } else if (sscanf(fields, "npt = %f -", &start) == 1) {
	    595     rangeStart = start;
	    596   } else {
	    597     return False; // The header is malformed
	    598   }
	
	Is there a reason for the parsing of NPT information in this manner?


Yes, because it *allows*, but does not *require*, white space to be present in the input.

Note the following, from "man sscanf()":
   "White space (such as
     blanks, tabs, or newlines) in the format string match any amount of white
     space, including none, in the input."


	  The specification of NPT within RFC2326 does not appear to include spaces between NPT elements.  And I would additionally note that even when Range headers are returned by the liveMedia library, these do not include spaces between NPT elements.


However, because of the way that "scanf()" works, these should be parsed OK by the existing code.
-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 5322 bytes
Desc: not available
Url : http://lists.live555.com/pipermail/live-devel/attachments/20060817/69579e3b/attachment.bin 


More information about the live-devel mailing list