diff options
author | Mikkel Krautz <mikkel@krautz.dk> | 2016-05-15 18:45:57 +0300 |
---|---|---|
committer | Mikkel Krautz <mikkel@krautz.dk> | 2016-06-24 01:03:12 +0300 |
commit | b1285fc5e330d72e7904220184ee9db8c64b9564 (patch) | |
tree | 2a2070fa2a8d4a0d4c6e99f6bcdbb4ee6ab3a6e0 /src/murmur/MurmurIce.cpp | |
parent | cfb535aa15e23df6b5407d0762a4b1576b29e2e8 (diff) |
Ensure all ACL write operations hold qrwlVoiceThread.
Diffstat (limited to 'src/murmur/MurmurIce.cpp')
-rw-r--r-- | src/murmur/MurmurIce.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/murmur/MurmurIce.cpp b/src/murmur/MurmurIce.cpp index 4fc6dc15e..0ff6de4f3 100644 --- a/src/murmur/MurmurIce.cpp +++ b/src/murmur/MurmurIce.cpp @@ -1611,11 +1611,16 @@ static void impl_Server_addUserToGroup(const ::Murmur::AMD_Server_addUserToGroup return; } - ::Group *g = channel->qhGroups.value(qsgroup); - if (! g) - g = new ::Group(channel, qsgroup); + { + QWriteLocker wl(&server->qrwlVoiceThread); + + ::Group *g = channel->qhGroups.value(qsgroup); + if (! g) + g = new ::Group(channel, qsgroup); + + g->qsTemporary.insert(- session); + } - g->qsTemporary.insert(- session); server->clearACLCache(user); cb->ice_response(); @@ -1632,11 +1637,16 @@ static void impl_Server_removeUserFromGroup(const ::Murmur::AMD_Server_removeUse return; } - ::Group *g = channel->qhGroups.value(qsgroup); - if (! g) - g = new ::Group(channel, qsgroup); + { + QWriteLocker qrwl(&server->qrwlVoiceThread); + + ::Group *g = channel->qhGroups.value(qsgroup); + if (!g) + g = new ::Group(channel, qsgroup); + + g->qsTemporary.remove(-session); + } - g->qsTemporary.remove(- session); server->clearACLCache(user); cb->ice_response(); |