From 6d6bbc0a5d1a6591cc93db75edf85e232cece3c6 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 1 Sep 2018 10:07:40 +0200 Subject: [PATCH] removed synchronized in favor of another interrupted check in startXmpp() --- .../java/eu/siacs/conversations/xmpp/XmppConnection.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index cdbf6927f..8da5a50ce 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -176,6 +176,8 @@ public class XmppConnection implements Runnable { private volatile Thread mThread; private CountDownLatch mStreamCountDownLatch; + + public XmppConnection(final Account account, final XmppConnectionService service) { this.account = account; this.mXmppConnectionService = service; @@ -437,7 +439,7 @@ public class XmppConnection implements Runnable { * * @return true if server returns with valid xmpp, false otherwise */ - private synchronized boolean startXmpp(Socket socket) throws Exception { + private boolean startXmpp(Socket socket) throws Exception { if (Thread.currentThread().isInterrupted()) { throw new InterruptedException(); } @@ -452,6 +454,9 @@ public class XmppConnection implements Runnable { tagWriter.beginDocument(); sendStartStream(); final Tag tag = tagReader.readTag(); + if (Thread.currentThread().isInterrupted()) { + throw new InterruptedException(); + } return tag != null && tag.isStart("stream"); } -- 2.45.2