better work around for not processing race condition stanza

This commit is contained in:
Daniel Gultsch 2024-02-07 10:07:53 +01:00
parent 7455e99761
commit 7fe8be1adc
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2

View file

@ -1232,6 +1232,12 @@ public class XmppConnection implements Runnable {
+ "'"); + "'");
return; return;
} }
if (Thread.currentThread().isInterrupted()) {
Log.d(
Config.LOGTAG,
account.getJid().asBareJid() + "Not processing iq. Thread was interrupted");
return;
}
if (packet instanceof JinglePacket jinglePacket && isBound) { if (packet instanceof JinglePacket jinglePacket && isBound) {
if (this.jingleListener != null) { if (this.jingleListener != null) {
this.jingleListener.onJinglePacketReceived(account, jinglePacket); this.jingleListener.onJinglePacketReceived(account, jinglePacket);
@ -1308,11 +1314,18 @@ public class XmppConnection implements Runnable {
+ "'"); + "'");
return; return;
} }
if (Thread.currentThread().isInterrupted()) {
Log.d(
Config.LOGTAG,
account.getJid().asBareJid()
+ "Not processing message. Thread was interrupted");
return;
}
this.messageListener.onMessagePacketReceived(account, packet); this.messageListener.onMessagePacketReceived(account, packet);
} }
private void processPresence(final Tag currentTag) throws IOException { private void processPresence(final Tag currentTag) throws IOException {
PresencePacket packet = (PresencePacket) processPacket(currentTag, PACKET_PRESENCE); final PresencePacket packet = (PresencePacket) processPacket(currentTag, PACKET_PRESENCE);
if (!packet.valid()) { if (!packet.valid()) {
Log.e( Log.e(
Config.LOGTAG, Config.LOGTAG,
@ -1323,6 +1336,13 @@ public class XmppConnection implements Runnable {
+ "'"); + "'");
return; return;
} }
if (Thread.currentThread().isInterrupted()) {
Log.d(
Config.LOGTAG,
account.getJid().asBareJid()
+ "Not processing presence. Thread was interrupted");
return;
}
this.presenceListener.onPresencePacketReceived(account, packet); this.presenceListener.onPresencePacketReceived(account, packet);
} }