aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
index a1bd5ccf..128e1187 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
@@ -396,8 +396,11 @@ public class XmppConnection implements Runnable {
throw new SecurityException();
}
}
- if (startXmpp(localSocket))
+ if (startXmpp(localSocket)) {
break; // successfully connected to server that speaks xmpp
+ } else {
+ localSocket.close();
+ }
} catch (final SecurityException e) {
throw e;
} catch (InterruptedException e) {