mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-26 16:22:06 +01:00
No need to synchronize bindingRequired
If binding is required or not is told the client by the server within the features stanzas. Smacks guarantees that connect() blocks until the features stanzas has been received and processed.
This commit is contained in:
parent
874a22489e
commit
854489e785
1 changed files with 1 additions and 16 deletions
|
@ -215,7 +215,7 @@ public abstract class XMPPConnection {
|
||||||
*/
|
*/
|
||||||
private int port;
|
private int port;
|
||||||
|
|
||||||
private Boolean bindingRequired;
|
private boolean bindingRequired;
|
||||||
private boolean sessionSupported;
|
private boolean sessionSupported;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -452,10 +452,6 @@ public abstract class XMPPConnection {
|
||||||
*/
|
*/
|
||||||
void serverRequiresBinding() {
|
void serverRequiresBinding() {
|
||||||
bindingRequired = true;
|
bindingRequired = true;
|
||||||
// Wake up the thread that is waiting
|
|
||||||
synchronized(bindingRequired) {
|
|
||||||
bindingRequired.notify();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -469,17 +465,6 @@ public abstract class XMPPConnection {
|
||||||
|
|
||||||
String bindResourceAndEstablishSession(String resource) throws XMPPErrorException,
|
String bindResourceAndEstablishSession(String resource) throws XMPPErrorException,
|
||||||
ResourceBindingNotOfferedException, NoResponseException, NotConnectedException {
|
ResourceBindingNotOfferedException, NoResponseException, NotConnectedException {
|
||||||
synchronized (bindingRequired) {
|
|
||||||
if (!bindingRequired) {
|
|
||||||
try {
|
|
||||||
// Wait until server sends response containing the <bind> element
|
|
||||||
bindingRequired.wait(getPacketReplyTimeout());
|
|
||||||
}
|
|
||||||
catch (InterruptedException e) {
|
|
||||||
// Ignore
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!bindingRequired) {
|
if (!bindingRequired) {
|
||||||
// Server never offered resource binding, which is REQURIED in XMPP client and server
|
// Server never offered resource binding, which is REQURIED in XMPP client and server
|
||||||
|
|
Loading…
Reference in a new issue