server list/client list connection less message seems to need a mutex at the server

This commit is contained in:
Volker Fischer 2020-07-11 09:28:44 +02:00
parent 3872206f29
commit 0f9b422d0f
3 changed files with 11 additions and 9 deletions

View File

@ -24,8 +24,6 @@
- bug fix: grouping faders in the client should be proportional (see discussion in #202, #419)
TODO server list/client list connection less message seems to need a mutex at the server
TODO improve settings management -> move settings class in client/server classes, move actual settings variables
TODO improve interaction between use of inifile and command line parameters (edited) #120
TODO Save and restore mixer state (fader / mute / solo...) #377

View File

@ -630,14 +630,16 @@ void CServer::OnNewConnection ( int iChID,
// send welcome message (if enabled)
MutexWelcomeMessage.lock();
if ( !strWelcomeMessage.isEmpty() )
{
// create formatted server welcome message and send it just to
// the client which just connected to the server
const QString strWelcomeMessageFormated =
"<b>Server Welcome Message:</b> " + strWelcomeMessage;
if ( !strWelcomeMessage.isEmpty() )
{
// create formatted server welcome message and send it just to
// the client which just connected to the server
const QString strWelcomeMessageFormated =
"<b>Server Welcome Message:</b> " + strWelcomeMessage;
vecChannels[iChID].CreateChatTextMes ( strWelcomeMessageFormated );
vecChannels[iChID].CreateChatTextMes ( strWelcomeMessageFormated );
}
}
MutexWelcomeMessage.unlock();

View File

@ -456,8 +456,10 @@ public slots:
void OnCLReqVersionAndOS ( CHostAddress InetAddr )
{ ConnLessProtocol.CreateCLVersionAndOSMes ( InetAddr ); }
// the CreateChannelList() function access vecChannels which as to be mutexed
// since the normal server thread my change that at a random time
void OnCLReqConnClientsList ( CHostAddress InetAddr )
{ ConnLessProtocol.CreateCLConnClientsListMes ( InetAddr, CreateChannelList() ); }
{ QMutexLocker locker ( &Mutex ); ConnLessProtocol.CreateCLConnClientsListMes ( InetAddr, CreateChannelList() ); }
void OnCLRegisterServerReceived ( CHostAddress InetAddr,
CHostAddress LInetAddr,