From 909959bc6dca97b8abd8cb04c6ca2909f911743f Mon Sep 17 00:00:00 2001 From: paulc Date: Tue, 22 Sep 2009 11:57:04 +0000 Subject: [PATCH] Unlock the session mutex while attempting to push the data to the session user. git-svn-id: http://yate.null.ro/svn/yate/trunk@2851 acf43c95-373e-0410-b603-e72c3f656dc1 --- modules/server/ciscosm.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/modules/server/ciscosm.cpp b/modules/server/ciscosm.cpp index 026cff00..9ac3be7e 100644 --- a/modules/server/ciscosm.cpp +++ b/modules/server/ciscosm.cpp @@ -1366,20 +1366,24 @@ void SessionManager::userNotice(bool up) m_upUsers = 0; } -// Method that look for an user to process the message +// Method that looks for an user to process the message // When the user is found we stop looking void SessionManager::handlePDU(DataBlock& data) { u_int8_t* buf = data.data(4,2); u_int16_t protType = 0; protType = (buf[0] << 8) + buf[1]; - Lock mylock(this); - ObjList* obj = m_users.skipNull(); - for (; obj; obj = obj->skipNext()) { - UserPointer* user = static_cast(obj->get()); - if (protType == (*user)->protocol() && (*user)->checkMessage(data)) + lock(); + ListIterator iter(m_users); + while (UserPointer* user = static_cast(iter.get())) { + if ((*user)->protocol() != protType) + continue; + unlock(); + if ((*user)->checkMessage(data)) return; + lock(); } + unlock(); } void SessionManager::changeState(State newState)