diff options
author | Ingo Bauersachs <ingo@jitsi.org> | 2013-12-21 15:17:47 +0100 |
---|---|---|
committer | Ingo Bauersachs <ingo@jitsi.org> | 2013-12-21 15:17:47 +0100 |
commit | feadc3e4cce2d3b8e809804fd8f1a64580aae51f (patch) | |
tree | 106020af9928dda75779fc364bd9581991b56a08 /src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java | |
parent | 0b566e6a7826a7c67a03530c1f445e87ace79b3b (diff) | |
download | jitsi-feadc3e4cce2d3b8e809804fd8f1a64580aae51f.zip jitsi-feadc3e4cce2d3b8e809804fd8f1a64580aae51f.tar.gz jitsi-feadc3e4cce2d3b8e809804fd8f1a64580aae51f.tar.bz2 |
Prevent deadlock if a XMPP certificate validation fails
Diffstat (limited to 'src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java')
-rw-r--r-- | src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java | 11 |
1 files changed, 10 insertions, 1 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 b664ec2..d74c07e 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java @@ -2433,10 +2433,19 @@ public class ProtocolProviderServiceJabberImpl }
catch(CertificateException e)
{
- fireRegistrationStateChanged(getRegistrationState(),
+ // notify in a separate thread to avoid a deadlock when a
+ // reg state listener accesses a synchronized XMPPConnection
+ // method (like getRoster)
+ new Thread(new Runnable()
+ {
+ public void run()
+ {
+ fireRegistrationStateChanged(getRegistrationState(),
RegistrationState.UNREGISTERED,
RegistrationStateChangeEvent.REASON_USER_REQUEST,
"Not trusted certificate");
+ }
+ }).start();
throw e;
}
|