aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java
diff options
context:
space:
mode:
authorDamian Minkov <damencho@jitsi.org>2013-12-16 12:51:49 +0200
committerDamian Minkov <damencho@jitsi.org>2013-12-16 15:40:02 +0200
commit50000b16f1669dfda8d33c3ca3f43ec3094d275c (patch)
tree880fd5f7d55beb8522920fdff158e3324c3dcca1 /src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java
parent3a83d08ffa0e631e5e51aca028173b89b4edd0d9 (diff)
downloadjitsi-50000b16f1669dfda8d33c3ca3f43ec3094d275c.zip
jitsi-50000b16f1669dfda8d33c3ca3f43ec3094d275c.tar.gz
jitsi-50000b16f1669dfda8d33c3ca3f43ec3094d275c.tar.bz2
Avoids second attempt to initialize a xmpp connection if several threads call register method.
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.java7
1 files changed, 7 insertions, 0 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 039a29c..b664ec2 100644
--- a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java
@@ -645,6 +645,13 @@ public class ProtocolProviderServiceJabberImpl
{
synchronized(initializationLock)
{
+ // if a thread is waiting for initializationLock and enters
+ // lets check whether someone hasn't already tried login and
+ // have succeeded,
+ // should prevent "Trace possible duplicate connections" prints
+ if(isRegistered())
+ return;
+
JabberLoginStrategy loginStrategy = createLoginStrategy();
userCredentials = loginStrategy.prepareLogin(authority, reasonCode);
if(!loginStrategy.loginPreparationSuccessful())