diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-11-19 12:20:31 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2016-11-19 12:20:31 +0100 |
commit | 8132480b825f7a116a05fc720935f6c6b81b7baf (patch) | |
tree | 1b78250c460e30670da1a0171775cf951ed2c0fa | |
parent | 3bf2876e0931a064587ca5e560b5ccde18977b86 (diff) |
close socket after failed stream open
-rw-r--r-- | src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java | 5 |
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) { |