aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/plugin
diff options
context:
space:
mode:
authorDamian Minkov <damencho@jitsi.org>2014-09-30 10:08:08 +0300
committerDamian Minkov <damencho@jitsi.org>2014-09-30 10:17:48 +0300
commitc826ba7370a946956605c908ac28eed03d9e8913 (patch)
treefa15e4c188813ee683f47b02b6d488ca54820c0e /src/net/java/sip/communicator/plugin
parent3ab235a34442144dd6d3f1fb1672908f4e562dd3 (diff)
downloadjitsi-c826ba7370a946956605c908ac28eed03d9e8913.zip
jitsi-c826ba7370a946956605c908ac28eed03d9e8913.tar.gz
jitsi-c826ba7370a946956605c908ac28eed03d9e8913.tar.bz2
Adds new RegistrationStateChangeEvent and avoid reconnecting providers when server connection fails due to an error of received input. Buggy server or wrong input saved on server can keep provider reconnecting forever.
Diffstat (limited to 'src/net/java/sip/communicator/plugin')
-rw-r--r--src/net/java/sip/communicator/plugin/reconnectplugin/ReconnectPluginActivator.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/net/java/sip/communicator/plugin/reconnectplugin/ReconnectPluginActivator.java b/src/net/java/sip/communicator/plugin/reconnectplugin/ReconnectPluginActivator.java
index 8e63cdb..97c0bac 100644
--- a/src/net/java/sip/communicator/plugin/reconnectplugin/ReconnectPluginActivator.java
+++ b/src/net/java/sip/communicator/plugin/reconnectplugin/ReconnectPluginActivator.java
@@ -689,7 +689,13 @@ public class ReconnectPluginActivator
{
ProtocolProviderService pp = (ProtocolProviderService)evt.getSource();
- if(evt.getNewState().equals(RegistrationState.CONNECTION_FAILED))
+ boolean isServerReturnedErroneousInputEvent =
+ evt.getNewState().equals(RegistrationState.CONNECTION_FAILED)
+ && evt.getReasonCode() == RegistrationStateChangeEvent
+ .REASON_SERVER_RETURNED_ERRONEOUS_INPUT;
+
+ if(evt.getNewState().equals(RegistrationState.CONNECTION_FAILED)
+ && !isServerReturnedErroneousInputEvent)
{
if(!hasAtLeastOneSuccessfulConnection(pp))
{
@@ -773,11 +779,13 @@ public class ReconnectPluginActivator
traceCurrentPPState();
}
}
- else if(evt.getNewState().equals(RegistrationState.UNREGISTERED))
+ else if(evt.getNewState().equals(RegistrationState.UNREGISTERED)
+ || isServerReturnedErroneousInputEvent)
{
// Removes from list of autoreconnect only if the unregister
// event is by user request
- if(evt.isUserRequest())
+ if(evt.isUserRequest()
+ || isServerReturnedErroneousInputEvent)
autoReconnEnabledProviders.remove(pp);
if(!unregisteringProviders.contains(pp)