Skip to content

Commit 69dcf0d

Browse files
committed
fix: Do not send presence unavailable after a failure.
Attempts to address jitsi/jitsi-videobridge#2052 by not sending presence unavailable when disconnecting due to a connection failure. If the TCP connection is alive then the server will notice that it's closed. If it isn't alive then it won't matter anyway.
1 parent bebfb15 commit 69dcf0d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

jicoco/src/main/java/org/jitsi/xmpp/mucclient/MucClient.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ private Callable<Boolean> getConnectAndLoginCallable()
658658
// login (because the locally cached SASL mechanisms supported by the server are empty). We
659659
// disconnect in order to trigger a re-connect and clear that state on the next attempt.
660660
logger.warn("Failed to login. Disconnecting to trigger a re-connect.", e);
661-
xmppConnection.disconnect();
661+
xmppConnection.disconnect(null);
662662
return true;
663663
}
664664

@@ -871,7 +871,14 @@ public void pingFailed()
871871
// This is a weird situation that we have seen in the past when using VPN.
872872
// Everything stays like this forever as the socket remains open on the OS level
873873
// and it is never dropped. We will trigger reconnect just in case.
874-
xmppConnection.disconnect();
874+
try
875+
{
876+
xmppConnection.disconnect(null);
877+
}
878+
catch (Exception e)
879+
{
880+
logger.warn("Exception while disconnecting");
881+
}
875882
}
876883
}
877884
}

0 commit comments

Comments
 (0)