Changeset 02d88eb79a in mythtv


Ignore:
Timestamp:
Nov 6, 2013, 2:00:00 PM (11 years ago)
Author:
Stuart Morgan <smorgan@…>
Branches:
fixes/0.27
Children:
4e1342491d
Parents:
dfe53966f
git-author:
Stuart Morgan <smorgan@…> (11/06/13 14:00:00)
git-committer:
Stuart Morgan <smorgan@…> (11/08/13 15:41:22)
Message:

Simplify MythCoreContext::GetMasterHostPrefix?(). It's a waste of time to get the IP/port from the socket when we can be using the values from the settings instead, if we're not already connected to the master we will soon be connecting anyway to conduct the file transfer.
(cherry picked from commit 22b48f435a97b6b973a2e0dea9e89548350bc01e)

Refs #11937

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mythtv/libs/libmythbase/mythcorecontext.cpp

    rdfe53966f r02d88eb79a  
    704704                                             const QString &path)
    705705{
    706     QString ret;
    707 
    708     if (IsMasterHost())
    709     {
    710         return GenMythURL(GetSetting("MasterServerIP"),
    711                           GetNumSetting("MasterServerPort", 6543),
    712                           path,
    713                           storageGroup);
    714     }
    715 
    716     QMutexLocker locker(&d->m_sockLock);
    717     if (!d->m_serverSock || !d->m_serverSock->IsConnected() ||
    718         !d->m_eventSock || !d->m_eventSock->IsConnected())
    719     {
    720         bool blockingClient = GetNumSetting("idleTimeoutSecs",0) > 0;
    721         ConnectToMasterServer(blockingClient);
    722     }
    723 
    724     if (d->m_serverSock)
    725     {
    726 
    727          ret = GenMythURL(d->m_serverSock->GetPeerAddress().toString(),
    728                           d->m_serverSock->GetPeerPort(),
    729                           path,
    730                           storageGroup);
    731     }
    732    
    733     return ret;
     706    return GenMythURL(GetSetting("MasterServerIP"),
     707                        GetNumSetting("MasterServerPort", 6543),
     708                        path,
     709                        storageGroup);
    734710}
    735711
Note: See TracChangeset for help on using the changeset viewer.