mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-22 02:27:58 +01:00
Merge branch '4.4'
This commit is contained in:
commit
6be3eb194a
3 changed files with 25 additions and 8 deletions
|
@ -77,7 +77,7 @@ public final class BOSHConfiguration extends ConnectionConfiguration {
|
||||||
}
|
}
|
||||||
|
|
||||||
public URI getURI() throws URISyntaxException {
|
public URI getURI() throws URISyntaxException {
|
||||||
String uri = https ? "https://" : "http://" + getHostString() + ":" + this.port + file;
|
String uri = (https ? "https://" : "http://") + getHostString() + ":" + this.port + file;
|
||||||
return new URI(uri);
|
return new URI(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Copyright 2009 Jive Software, 2018-2021 Florian Schmaus.
|
* Copyright 2009 Jive Software, 2018-2022 Florian Schmaus.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -2006,12 +2006,19 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
|
||||||
}, timeout, TimeUnit.MILLISECONDS);
|
}, timeout, TimeUnit.MILLISECONDS);
|
||||||
|
|
||||||
addAsyncStanzaListener(stanzaListener, replyFilter);
|
addAsyncStanzaListener(stanzaListener, replyFilter);
|
||||||
|
Runnable sendOperation = () -> {
|
||||||
try {
|
try {
|
||||||
sendStanza(stanza);
|
sendStanza(stanza);
|
||||||
}
|
}
|
||||||
catch (NotConnectedException | InterruptedException exception) {
|
catch (NotConnectedException | InterruptedException exception) {
|
||||||
future.setException(exception);
|
future.setException(exception);
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
if (SmackConfiguration.TRUELY_ASYNC_SENDS) {
|
||||||
|
Async.go(sendOperation);
|
||||||
|
} else {
|
||||||
|
sendOperation.run();
|
||||||
|
}
|
||||||
|
|
||||||
return future;
|
return future;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Copyright 2003-2007 Jive Software, 2018-2021 Florian Schmaus.
|
* Copyright 2003-2007 Jive Software, 2018-2022 Florian Schmaus.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -386,4 +386,14 @@ public final class SmackConfiguration {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If enabled, causes {@link AbstractXMPPConnection} to create a thread for every asynchronous send operation. This
|
||||||
|
* is meant to work-around a shortcoming of Smack 4.4, where certain send operations are not asynchronous even if
|
||||||
|
* they should be. This is an expert setting, do not toggle if you do not understand the consequences or have been
|
||||||
|
* told to do so. Note that it is expected that this will not be needed in future Smack versions.
|
||||||
|
*
|
||||||
|
* @since 4.4.6
|
||||||
|
*/
|
||||||
|
public static boolean TRUELY_ASYNC_SENDS = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue