<!doctype html public "-//W3C//DTD W3 HTML//EN">
<html><head><style type="text/css"><!--
blockquote, dl, ul, ol, li { padding-top: 0 ; padding-bottom: 0 }
--></style><title>Re: [Live-devel] Range header
parsing</title></head><body>
<blockquote type="cite" cite><font size="-1">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:<br>
<br>
590 float start, end;<br>
591 if (sscanf(fields, "npt = %f -
%f", &start, &end) == 2) {<br>
592 rangeStart = start;<br>
593 rangeEnd = end;<br>
594 } else if (sscanf(fields, "npt
= %f -", &start) == 1) {<br>
595 rangeStart = start;<br>
596 } else {<br>
597 return False; // The
header is malformed<br>
598 }<br>
<br>
Is there a reason for the parsing of NPT information in this
manner?</font></blockquote>
<div><br></div>
<div>Yes, because it *allows*, but does not *require*, white space to
be present in the input.</div>
<div><br></div>
<div>Note the following, from "man sscanf()":</div>
<div> "White space (such as</div>
<div> blanks, tabs, or newlines) in the format
string match any amount of white</div>
<div> space, including none, in the
input."</div>
<div><br></div>
<blockquote type="cite" cite><font size="-1"> 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.</font></blockquote>
<div><br></div>
<div>However, because of the way that "scanf()" works, these
should be parsed OK by the existing code.</div>
<x-sigsep><pre>--
</pre></x-sigsep>
<div><br>
Ross Finlayson<br>
Live Networks, Inc.<br>
http://www.live555.com/</div>
</body>
</html>