<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:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle18
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle19
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle20
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 2.0cm 70.85pt 2.0cm;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FI" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-GB">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">We found out that,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"> Request: SETUP rtsp://…:554/proxyStream/track1 RTSP/1.0\r\n<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"> CSeq: 17410\r\n<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"> Transport: RTP/AVP;multicast<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"> User-Agent: RTSP Agent\r\n<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"> \r\n<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">…halts all parallel RTP streams from same proxy server (and when client repeatedly tries to reconnect paralyzes streaming completely). It seems that RTSPServer.cpp doesn’t validate clientRTPPortNum on client setup and
patch below prevents the problem. I guess that there should be implemented better parameter validation?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">--- a/liveMedia/RTSPServer.cpp<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">+++ b/liveMedia/RTSPServer.cpp<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">@@ -299,7 +299,7 @@ void RTSPServer::RTSPClientConnection<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">@@ -112,39 +112,7 @@ index 1c33dd7..60ea00c 100644<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"> }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"> void RTSPServer::RTSPClientConnection<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-@@ -1456,16 +1456,21 @@ void RTSPServer::RTSPClientSession<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">- } else {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">- switch (streamingMode) {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">- case RTP_UDP: {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-- snprintf((char*)ourClientConnection->fResponseBuffer, sizeof ourClientConnection->fResponseBuffer,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-- "RTSP/1.0 200 OK\r\n"
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-- "CSeq: %s\r\n" <o:p>
</o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-- "%s" <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-- "Transport: RTP/AVP;unicast;destination=%s;source=%s;client_port=%d-%d;server_port=%d-%d\r\n"
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-- "Session: %08X%s\r\n\r\n",<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-- ourClientConnection->fCurrentCSeq,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-- dateHeader(),<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-- destAddrStr.val(), sourceAddrStr.val(), ntohs(clientRTPPort.num()), ntohs(clientRTCPPort.num()), ntohs(serverRTPPort.num()), ntohs(serverRTCPPort.num()),<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-- fOurSessionId, timeoutParameterString);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-+ if (clientRTPPortNum != 0) {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-+ snprintf((char*)ourClientConnection->fResponseBuffer, sizeof ourClientConnection->fResponseBuffer,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-+ "RTSP/1.0 200 OK\r\n"
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-+ "CSeq: %s\r\n"
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-+ "%s" <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-+ "Transport: RTP/AVP;unicast;destination=%s;source=%s;client_port=%d-%d;server_port=%d-%d\r\n"
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-+ "Session: %08X%s\r\n\r\n",<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-+ ourClientConnection->fCurrentCSeq,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-+ dateHeader(),<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-+ destAddrStr.val(), sourceAddrStr.val(), ntohs(clientRTPPort.num()), ntohs(clientRTCPPort.num()), ntohs(serverRTPPort.num()), ntohs(serverRTCPPort.num()),<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-+ fOurSessionId, timeoutParameterString);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-+ } else {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-+ // client port needs to be defined<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-+ ourClientConnection->handleCmd_unsupportedTransport();<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-+ }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">- break;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">- }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">- case RTP_TCP: {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">-@@ -1582,7 +1587,7 @@ void RTSPServer::RTSPClientSession<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">--<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Best regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Juho Ylikorpi<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Node Solutions Ltd<o:p></o:p></span></p>
<p class="MsoNormal">Itäinen Pitkäkatu 4 C (PharmaCity)<o:p></o:p></p>
<p class="MsoNormal">FI-20520 TURKU<o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB">FINLAND<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Tel. +358 2 4802 8550<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Mob. +358 40 544 7406<o:p></o:p></span></p>
<p class="MsoNormal"><a href="http://node.solutions/"><span lang="EN-GB">http://node.solutions/</span></a><span lang="EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal"><a href="mailto:juho.ylikorpi@node.solutions">juho.ylikorpi@node.solutions</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>