[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-protocol-cvs
Subject:    [Protocol-cvs] rtsp rtspclnt.cpp,1.41.2.26,1.41.2.27
From:       ping () helixcommunity ! org
Date:       2004-11-19 21:49:43
[Download RAW message or body]

Update of /cvsroot/protocol/rtsp
In directory cvs-new:/tmp/cvs-serv17478

Modified Files:
      Tag: hxclient_1_1_6_neptune
	rtspclnt.cpp 
Log Message:
- fixed crash when invalud UDP port/range specified in player preference, the client \
                will now switch to TCP if TCP is enabled (b#129139)
- added several null-pointer check asserts



Index: rtspclnt.cpp
===================================================================
RCS file: /cvsroot/protocol/rtsp/rtspclnt.cpp,v
retrieving revision 1.41.2.26
retrieving revision 1.41.2.27
diff -u -d -r1.41.2.26 -r1.41.2.27
--- rtspclnt.cpp	13 Nov 2004 00:52:08 -0000	1.41.2.26
+++ rtspclnt.cpp	19 Nov 2004 21:49:41 -0000	1.41.2.27
@@ -1683,11 +1683,15 @@
 
 		IHXUDPSocket* pUDPSocket = (IHXUDPSocket*)
 		    (*m_pUDPSocketStreamMap)[streamNumber];
-		pUDPSocket->GetLocalPort(nUDPPort);
-
 		IHXUDPSocket* pRTCPSocket = (IHXUDPSocket*)
 		    (*m_pRTCPSocketStreamMap)[streamNumber];
 
+                // We should not get here if we fail to initialize the UDP sockets \
in  +                // InitSockets().
+                // We will either switch to TCP or error out if TCP is not \
available. +                HX_ASSERT(pUDPSocket && pRTCPSocket);
+		pUDPSocket->GetLocalPort(nUDPPort);
+
 		if (HXR_OK != 
 		    ((RTPUDPTransport*)pTrans)->init(
 			m_pContext,
@@ -3376,7 +3380,9 @@
         for(i=m_streamInfoList.Begin();i!=m_streamInfoList.End();++i)
         {
 	    pStreamInfo = (RTSPStreamInfo*)(*i);
-     
+
+            bGotSocket = FALSE;
+
     	    CHXSimpleList::Iterator lIterator = pUDPPortList->Begin();
 	    for (; lIterator != pUDPPortList->End(); ++lIterator)
 	    {		
@@ -3411,6 +3417,13 @@
 		    break;
 	        }
 	    }
+
+            // bail out if we failed to create UDP sockets, HXR_NET_UDP is returned
+            // so we will attempt to switch to TCP if it's enabled
+            if (!bGotSocket)
+            {
+                hr = HXR_NET_UDP;
+            }
         }
 
         m_currentTransport = UDPMode;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic