[h323plus] Twice H323Connection::Unlock() call issue
Iurii Gordiienko
hordi at ukr.net
Fri Dec 25 08:59:42 EST 2015
Hi,
I have found a bug with twice H323Connection::Unlock() call if we have an connection issue.
Take a look:
1.We are running connection.SendSignalSetup function from H225CallThread::Main() and if it returns any reason!=H323Connection::EndedByCallerAbort we will Unlock the connection.
void H225CallThread::Main() { PTRACE(3, "H225\tStarted call thread");
if (connection.Lock()) { H323Connection::CallEndReason reason = connection.SendSignalSetup(alias, address);
// Special case, if we aborted the call then already will be unlocked if (reason != H323Connection::EndedByCallerAbort) connection.Unlock();
// bla-bla-bla }
2.But we have case when connection.SendSignalSetup returns non H323Connection::EndedByCallerAbort reason but has own unlocked state - for this case PTLIB will unlock the mutex twice with assert (as minimum) message.
H323Connection::SendSignalSetup(const PString & alias,
const H323TransportAddress & address) { //bla-bla-bla
// Release the mutex as can deadlock trying to clear call during connect. Unlock();
PBoolean connectFailed = false; if (!signallingChannel->IsOpen()) { signallingChannel->SetWriteTimeout(100); connectFailed = !signallingChannel->Connect(); }
// See if transport connect failed, abort if so. if (connectFailed) { connectionState = NoConnectionActive; switch (signallingChannel->GetErrorNumber()) { case ENETUNREACH : return EndedByUnreachable; case ECONNREFUSED : return EndedByNoEndPoint; case ETIMEDOUT : return EndedByHostOffline; } return EndedByConnectFail; }
}
Thanks -- Iurii Gordiienko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.packetizer.com/pipermail/h323plus/attachments/20151225/5791371a/attachment-0001.html>
More information about the h323plus
mailing list