[Sofaswitch-svn] [commit] r425 - sofaswitch/trunk/sofa/src
Author: derek Date: Wed Jul 2 23:52:27 2008 New Revision: 425 Modified: sofaswitch/trunk/sofa/src/messages.cxx Log: Tidy up locks in creation of identities. Now, we correctly set them, so there is no deadlock on faulty initialisation. Modified: sofaswitch/trunk/sofa/src/messages.cxx ============================================================================== --- sofaswitch/trunk/sofa/src/messages.cxx (original) +++ sofaswitch/trunk/sofa/src/messages.cxx Wed Jul 2 23:52:27 2008 @@ -220,6 +220,7 @@ if (!keepGoing) { PTRACE(4, "initialize end - keepgoing is false "); + goodConnection.Signal(); return; } @@ -234,49 +235,50 @@ PTRACE(5, "ok - we have a good connection"); goodConnection.Signal(); + if (!messagesSocket.SetOption(TCP_NODELAY, 1, IPPROTO_TCP)) { PTRACE(1, "SetOption(TCP_NODELAY) failed: " << messagesSocket.GetErrorText()); - if (!keepGoing) { - PTRACE(4, "initialize end TCP_NODELAY- keepgoing is false"); - return; - } + keepGoing = false; + PTRACE(4, "initialize end TCP_NODELAY- keepgoing is false"); + writeSourceId.Signal(); + return; } if (!messagesSocket.SetOption(SO_KEEPALIVE, 1)) { PTRACE(3, "SetOption(keepalive) failed: " << messagesSocket.GetErrorText()); - if (!keepGoing) { - PTRACE(3, "initialize end SO_KEEPALIVE- keepgoing is false"); - return; - } + keepGoing = false; + PTRACE(3, "initialize end SO_KEEPALIVE- keepgoing is false"); + writeSourceId.Signal(); + return; } #ifdef TCP_KEEPIDLE if (!messagesSocket.SetOption(TCP_KEEPIDLE, 10, IPPROTO_TCP)) { PTRACE(1, "SetOption(TCP_KEEPIDLE 2) failed: " << messagesSocket.GetErrorText()); - if (!keepGoing) { - PTRACE(3, "initialize end TCP_KEEPIDLE 2- keepgoing is false"); - return; - } + keepGoing = false; + PTRACE(3, "initialize end TCP_KEEPIDLE 2- keepgoing is false"); + writeSourceId.Signal(); + return; } #endif #ifdef TCP_KEEPCNT if (!messagesSocket.SetOption(TCP_KEEPCNT, 2, IPPROTO_TCP)) { PTRACE(1, "SetOption(TCP_KEEPCNT 2) failed: " << messagesSocket.GetErrorText()); - if (!keepGoing) { - PTRACE(3, "initialize TCP_KEEPCNT 2 end - keepgoing is false"); - return; - } - } + keepGoing = false; + PTRACE(3, "initialize TCP_KEEPCNT 2 end - keepgoing is false"); + writeSourceId.Signal(); + return; + } #endif #ifdef TCP_KEEPINTVL if (!messagesSocket.SetOption(TCP_KEEPINTVL, 10, IPPROTO_TCP)) { PTRACE(1, "SetOption(TCP_KEEPINTVL 2) failed: " << messagesSocket.GetErrorText()); - if (!keepGoing) { - PTRACE(3, "initialize end TCP_KEEPINTVL 2- keepgoing is false"); - return; - } + keepGoing = false; + PTRACE(3, "initialize end TCP_KEEPINTVL 2- keepgoing is false"); + writeSourceId.Signal(); + return; } #endif
participants (1)
-
SofaSWITCH SVN