mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-12-22 20:47:57 +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() {
|
||||
@Override
|
||||
public void processStanza(Stanza packet) throws NotConnectedException, InterruptedException {
|
||||
removeAsyncStanzaListener(this);
|
||||
try {
|
||||
XMPPErrorException.ifHasErrorThenThrow(packet);
|
||||
callback.processStanza(packet);
|
||||
|
@ -1503,9 +1504,6 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
|
|||
exceptionCallback.processException(e);
|
||||
}
|
||||
}
|
||||
finally {
|
||||
removeAsyncStanzaListener(this);
|
||||
}
|
||||
}
|
||||
};
|
||||
removeCallbacksService.schedule(new Runnable() {
|
||||
|
|
Loading…
Reference in a new issue