<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>Re: [Live-devel] Race condition bug fix</title>
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
pre
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I agree that in the case of two reads to
build a request, my code does not pass the correct length, however there is
still a problem. Sorry I did not explain it fully in my original mail.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>In our use of the server, the client often
makes two requests for a pair of streams from the server. Therefore two
requests arrive very closely in time. The second starts processing after the
first is read but before resetRequestBuffer() resets the fRequestBytesAlreadySeen.
So the second request is added to the end of the first in the fRequestBuffer
and parseRTSPRequestString is called with a pointer to the beginning of the
buffer (which now has both requests, first then second). My patch partially solves
the problem in this case because our requests are always satisfied by one read
and using ptr will pass parseRTSPRequestString the second request.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Perhaps the correct protection for this lies
at a higher level where we can prevent the next request from being handled
until the resetRequestBuffer is complete?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<p class=MsoNormal style='margin-bottom:12.0pt'><em><i><font size=2 color=navy
face="Times New Roman"><span style='font-size:10.0pt;color:navy'>Geoff</span></font></i></em><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'><o:p></o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><em><i><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'>=======================</span></font></i></em><font color=navy><span
style='color:navy'><o:p></o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><em><i><font
size=1 color=navy face=Arial><span style='font-size:7.5pt;font-family:Arial;
color:navy'>CONFIDENTIALITY NOTICE: This e-mail message, including any
attachments, is for the sole use of the intended recipient(s) and may contain
confidential and privileged information. Any unauthorized review, use,
disclosure, or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply e-mail and destroy all copies of
the original message.</span></font></i></em><o:p></o:p></p>
</div>
<div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> live-devel-bounces@ns.live555.com
[mailto:live-devel-bounces@ns.live555.com] <b><span style='font-weight:bold'>On
Behalf Of </span></b>Ross Finlayson<br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, September 12,
2007 9:01 PM<br>
<b><span style='font-weight:bold'>To:</span></b> LIVE555 Streaming Media -
development & use<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [Live-devel] Race
condition bug fix</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>The following fix prevents a bug when two requests are
processed in close proximity.</span></font><o:p></o:p></p>
</blockquote>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>No, the original code was correct. It's possible that an incoming
RTSP request will require more than one socket read in order to obtain all the
data for the request. In that case, the length of the request data - as
passed to "parseRTSPRequestString()" - must be "fRequestBytesAlreadySeen",
not "bytesRead".<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>What specifically was causing you problems with the original
code? Can you describe a specific sequence of incoming RTSP requests that
was causing problems??<o:p></o:p></span></font></p>
</div>
<pre><font size=2 face="Courier New"><span style='font-size:10.0pt'><x-sigsep>-- <o:p></o:p></span></font></pre>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
</x-sigsep>Ross Finlayson<br>
Live Networks, Inc.<br>
http://www.live555.com/<o:p></o:p></span></font></p>
</div>
</div>
</div>
</body>
</html>