removed synchronized in favor of another interrupted check in startXmpp()

This commit is contained in:
Daniel Gultsch 2018-09-01 10:07:40 +02:00
parent c05acccf17
commit 6d6bbc0a5d

View file

@ -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");
}