Hi <br><br>I've correct as you said, it work. Thanks.<br><br>Shiyong Zhang<br><br><div class="gmail_quote">2012/4/9 Ross Finlayson <span dir="ltr"><<a href="mailto:finlayson@live555.com">finlayson@live555.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="im"><blockquote type="cite">In function  RTPInterface::handleRead (version 2012/04/04),<br>
<br>225  if (fNextTCPReadStreamSocketNum < 0) {<br>226       // Normal case: read from the (datagram) 'groupsock':<br>227       readSuccess = fGS->handleRead(buffer, bufferMaxSize, bytesRead, fromAddress);<br>

228       } else {<br>         ...<br>242    fNextTCPReadSize -= bytesRead;<br>243    if (curBytesRead == 0 && curBytesToRead > 0) {<br>244      packetReadWasIncomplete = True;<br>245      return True;<br>246    } else if (curBytesRead < 0) {<br>

247      bytesRead = 0;<br>248      readSuccess = False;<br>249    } else {<br>250      readSuccess = True;<br>251    }<br>252    fNextTCPReadStreamSocketNum = -1; // default, for next time<br>         ...<br><br>Pay attension to line 252, variable fNextTCPReadStreamSocketNum is reset to -1 when handRead succeed(readSuccess=True). But at this time it is possible for condition fNextTCPReadSize > 0. if there are still bytes in TCP, and fNextTCPReadStreamSocketNum was reset to -1</blockquote>
<div><br></div></div>Yes, you have discovered a bug.  Thank you.</div><div><br></div><div>Note, however, that the bug will show up only if the condition in the "if" statement on line 232:</div><div><span style="white-space:pre-wrap">   if (</span><span style="white-space:pre-wrap">totBytesToRead > bufferMaxSize</span><span style="white-space:pre-wrap">) totBytesToRead = bufferMaxSize;</span></div>
<div>is true.  I.e., the bug will show up only if "<span style="white-space:pre-wrap">totBytesToRead > bufferMaxSize</span>".  (Because otherwise, upon exiting the "while" loop,  the condition on line 243 will be true, and we'll return without getting to line 252.)</div>
<div><br></div><div>But nonetheless, there is a bug.  You should be able to fix it by replacing line 243</div><div class="im"><div><span style="white-space:pre-wrap">      if (curBytesRead == 0 && curBytesToRead > 0) {</span></div>
</div><div>with</div><div><span style="white-space:pre-wrap">   if (fNextTCPReadSize > 0) {</span></div><div><br></div><div>If this doesn't fix the problem, then please let us know.  Otherwise, this fix will be included in the next release of the software.</div>
<div><br></div><div>Thank you again.</div><br><font color="#888888"><br><div>
<span style="border-collapse:separate;color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><span style="border-collapse:separate;color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium">Ross Finlayson<br>
Live Networks, Inc.<br><a href="http://www.live555.com/" target="_blank">http://www.live555.com/</a></span></span>
</div>
<br></font></div><br>_______________________________________________<br>
live-devel mailing list<br>
<a href="mailto:live-devel@lists.live555.com">live-devel@lists.live555.com</a><br>
<a href="http://lists.live555.com/mailman/listinfo/live-devel" target="_blank">http://lists.live555.com/mailman/listinfo/live-devel</a><br>
<br></blockquote></div><br>