mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-15 20:12:04 +01:00
sendStanzaWithResponseCallback(): remove listener right away
I'm not sure why i've put the removeAsyncStanzaListener() call into the finally block. If callback.processStanza(Stanza) takes a long time (or even blocks), then it would appear to the "no response" handling Runnable as if there was no response, when in fact there was one.
This commit is contained in:
parent
187fe37cd7
commit
b142060f9e
1 changed files with 1 additions and 3 deletions
|
@ -1494,6 +1494,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
|
||||||
final StanzaListener packetListener = new StanzaListener() {
|
final StanzaListener packetListener = new StanzaListener() {
|
||||||
@Override
|
@Override
|
||||||
public void processStanza(Stanza packet) throws NotConnectedException, InterruptedException {
|
public void processStanza(Stanza packet) throws NotConnectedException, InterruptedException {
|
||||||
|
removeAsyncStanzaListener(this);
|
||||||
try {
|
try {
|
||||||
XMPPErrorException.ifHasErrorThenThrow(packet);
|
XMPPErrorException.ifHasErrorThenThrow(packet);
|
||||||
callback.processStanza(packet);
|
callback.processStanza(packet);
|
||||||
|
@ -1503,9 +1504,6 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
|
||||||
exceptionCallback.processException(e);
|
exceptionCallback.processException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally {
|
|
||||||
removeAsyncStanzaListener(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
removeCallbacksService.schedule(new Runnable() {
|
removeCallbacksService.schedule(new Runnable() {
|
||||||
|
|
Loading…
Reference in a new issue