aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-11-19 12:20:31 +0100
committerDaniel Gultsch <daniel@gultsch.de>2016-11-19 12:20:31 +0100
commit8132480b825f7a116a05fc720935f6c6b81b7baf (patch)
tree1b78250c460e30670da1a0171775cf951ed2c0fa /src/main
parent3bf2876e0931a064587ca5e560b5ccde18977b86 (diff)
close socket after failed stream open
Diffstat (limited to 'src/main')
-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) {