mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-22 10:37:59 +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 Boolean bindingRequired;
|
||||
private boolean bindingRequired;
|
||||
private boolean sessionSupported;
|
||||
|
||||
/**
|
||||
|
@ -452,10 +452,6 @@ public abstract class XMPPConnection {
|
|||
*/
|
||||
void serverRequiresBinding() {
|
||||
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,
|
||||
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) {
|
||||
// Server never offered resource binding, which is REQURIED in XMPP client and server
|
||||
|
|
Loading…
Reference in a new issue