mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-21 19:42:05 +01:00
Merge branch '4.4'
This commit is contained in:
commit
f6de30c218
1 changed files with 9 additions and 5 deletions
|
@ -172,14 +172,15 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
|
|||
|
||||
client = BOSHClient.create(cfgBuilder.build());
|
||||
|
||||
client.addBOSHClientConnListener(new BOSHConnectionListener());
|
||||
client.addBOSHClientResponseListener(new BOSHPacketReader());
|
||||
|
||||
// Initialize the debugger
|
||||
// Initialize the debugger before addBOSHClientResponseListener(new BOSHPacketReader());
|
||||
// BOSHPacketReader may hold and send response prior to display of the request i.e. <response/> before <challenge/>
|
||||
if (debugger != null) {
|
||||
initDebugger();
|
||||
}
|
||||
|
||||
client.addBOSHClientConnListener(new BOSHConnectionListener());
|
||||
client.addBOSHClientResponseListener(new BOSHPacketReader());
|
||||
|
||||
// Send the session creation request
|
||||
client.send(ComposableBody.builder()
|
||||
.setNamespaceDefinition("xmpp", XMPP_BOSH_NS)
|
||||
|
@ -359,10 +360,11 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
|
|||
CloseableUtil.maybeClose(reader, LOGGER);
|
||||
CloseableUtil.maybeClose(writer, LOGGER);
|
||||
|
||||
// set readerConsumer = null before reader to avoid NPE reference
|
||||
readerConsumer = null;
|
||||
readerPipe = null;
|
||||
reader = null;
|
||||
writer = null;
|
||||
readerConsumer = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -440,6 +442,8 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
|
|||
if (event.getBody() != null) {
|
||||
try {
|
||||
writer.write(event.getBody().toXML());
|
||||
// Fix all BOSH sent debug messages not shown
|
||||
writer.flush();
|
||||
} catch (Exception e) {
|
||||
// Ignore
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue