Projects

Ticket #43: dss-bind-on-all-ip.patch

File dss-bind-on-all-ip.patch, 1.7 KB (added by bsa@…, 3 years ago)

Solves the problem on Linux where Darwin binds to all IP adresses instread of making use of bind_ip_addr in streamingserver.xml

  • DarwinStreamingSrvr6.0.

    old new  
    565565{ 
    566566    //function finds all IP addresses on this machine, and binds 1 RTP / RTCP 
    567567    //socket pair to a port pair on each address. 
    568      
     568    //but only to IP adresses defined in <PREF NAME="bind_ip_addr" ></PREF> 
     569 
    569570    UInt32 theNumAllocatedPairs = 0; 
     571 
     572    // default in streamingserver.xml is <PREF NAME="bind_ip_addr" >0</PREF> 
     573    StrPtrLen tmpNullValue("0",1); 
     574 
    570575    for (UInt32 theNumPairs = 0; theNumPairs < SocketUtils::GetNumIPAddrs(); theNumPairs++) 
    571576    { 
    572         UDPSocketPair* thePair = fSocketPool->CreateUDPSocketPair(SocketUtils::GetIPAddr(theNumPairs), 0); 
    573                 if (thePair != NULL) 
    574                 { 
    575             theNumAllocatedPairs++; 
    576                         thePair->GetSocketA()->RequestEvent(EV_RE); 
    577                         thePair->GetSocketB()->RequestEvent(EV_RE); 
    578                 } 
     577        if (QTSSModuleUtils::FindStringInAttributeList(fSrvrPrefs, qtssPrefsRTSPIPAddr, SocketUtils::GetIPAddrStr( theNumPairs)) || QTSSModuleUtils::FindStringInAttributeList(fSrvrPrefs, qtssPrefsRTSPIPAddr, &tmpNullValue)) 
     578        { 
     579            UDPSocketPair* thePair = fSocketPool->CreateUDPSocketPair(SocketUtils::GetIPAddr(theNumPairs), 0); 
     580            if (thePair != NULL) 
     581            { 
     582                theNumAllocatedPairs++; 
     583                thePair->GetSocketA()->RequestEvent(EV_RE); 
     584                thePair->GetSocketB()->RequestEvent(EV_RE); 
     585            } 
    579586        } 
     587    } 
    580588    //only return an error if we couldn't allocate ANY pairs of sockets 
    581589    if (theNumAllocatedPairs == 0) 
    582590        {