Ticket #3720: no-master-connect2.patch

File no-master-connect2.patch, 1.1 KB (added by anonymous, 5 years ago)
  • libs/libmyth/mythcontext.cpp

     
    857857    QString server = gContext->GetSetting("MasterServerIP", "localhost"); 
    858858    int port = gContext->GetNumSetting("MasterServerPort", 6543); 
    859859 
    860     if (!d->eventSock) 
    861         d->eventSock = new MythSocket(); 
     860    if (!d->eventSock)  
     861    { 
     862        // if I'm the master backend, don't create a socket for events,  
     863        // This could lead to a case where recusively send myself events. 
     864        if (!IsMasterBackend()) 
     865            d->eventSock = new MythSocket(); 
     866    } 
    862867 
    863868    if (!d->serverSock) 
    864869        d->serverSock = ConnectServer(d->eventSock, server, port, blockingClient); 
     
    25442549{ 
    25452550    (void)sock; 
    25462551 
    2547     while (d->eventSock->state() == MythSocket::Connected && 
     2552    while (d->eventSock &&  
     2553           d->eventSock->state() == MythSocket::Connected && 
    25482554           d->eventSock->bytesAvailable() > 0) 
    25492555    { 
    25502556        QStringList strlist;