diff options
author | Damian Minkov <damencho@jitsi.org> | 2012-04-09 15:29:43 +0000 |
---|---|---|
committer | Damian Minkov <damencho@jitsi.org> | 2012-04-09 15:29:43 +0000 |
commit | bf7d41d620643420559d25bf222f47d203e05cc9 (patch) | |
tree | 33094c927a854688be6f350fba488eb6fe39d091 /src/net/java/sip/communicator | |
parent | f355167ed08b16228f1be0e1b0e5caf2f9b860e0 (diff) | |
download | jitsi-bf7d41d620643420559d25bf222f47d203e05cc9.zip jitsi-bf7d41d620643420559d25bf222f47d203e05cc9.tar.gz jitsi-bf7d41d620643420559d25bf222f47d203e05cc9.tar.bz2 |
Tries to fix a deadlock that can occur on double detecting connection closed, by smack and by our network detection.
Diffstat (limited to 'src/net/java/sip/communicator')
3 files changed, 26 insertions, 5 deletions
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java index 8302d6e..aca2943 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java @@ -1944,10 +1944,15 @@ public class ProtocolProviderServiceJabberImpl return; } } - // if we are already unregistered, there will not be a new fire - // if not we will clean and provider will fire its - // provider state change - unregister(true); + // fire that a connection failed, the reconnection mechanism + // will look after us and will clean us, other wise we can do + // a dead lock (connection closed is called + // within xmppConneciton and calling disconnect again can lock it) + fireRegistrationStateChanged( + getRegistrationState(), + RegistrationState.CONNECTION_FAILED, + RegistrationStateChangeEvent.REASON_NOT_SPECIFIED, + null); } /** diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/extensions/keepalive/KeepAliveManager.java b/src/net/java/sip/communicator/impl/protocol/jabber/extensions/keepalive/KeepAliveManager.java index 5f99a18..f37c44a 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/extensions/keepalive/KeepAliveManager.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/extensions/keepalive/KeepAliveManager.java @@ -197,6 +197,15 @@ public class KeepAliveManager logger.trace("provider not registered. " +"won't send keep alive for " + parentProvider.getAccountID().getDisplayName()); + + parentProvider.unregister(false); + + parentProvider.fireRegistrationStateChanged( + parentProvider.getRegistrationState(), + RegistrationState.CONNECTION_FAILED, + RegistrationStateChangeEvent.REASON_SERVER_NOT_FOUND, + null); + return; } diff --git a/src/net/java/sip/communicator/util/NetworkUtils.java b/src/net/java/sip/communicator/util/NetworkUtils.java index 7f1aabc..d0d543c 100644 --- a/src/net/java/sip/communicator/util/NetworkUtils.java +++ b/src/net/java/sip/communicator/util/NetworkUtils.java @@ -1416,7 +1416,14 @@ public class NetworkUtils { // reread system dns configuration ResolverConfig.refresh(); - DnsUtilActivator.refreshResolver(); + try + { + DnsUtilActivator.refreshResolver(); + } + catch(Throwable t) + { + logger.error("Error reloading dns util activator"); + } if(parallelResolver instanceof ParallelResolver) { //needs a separate lock object because the parallelResolver could |