[polari] application: Consider port for alternate server list



commit a2331c7b2322dd0a4d60a3f2ab82b680b774d076
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Sep 9 02:23:08 2016 +0200

    application: Consider port for alternate server list
    
    When we fail to connect to a network with multiple servers, we build
    a list of alternate servers for retrying, excluding the original
    server that already failed. Currently that filtering is based solely
    on the server address, in the assumption that servers would not just
    differ by port - however that's exactly the case for FreeNode, so
    to not effectively disable connection retries there, we need to take
    the port number into account as well.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771217

 src/application.js |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index 9700751..d514ec0 100644
--- a/src/application.js
+++ b/src/application.js
@@ -319,9 +319,10 @@ const Application = new Lang.Class({
         if (data)
             return data;
 
-        let params = account.dup_parameters_vardict().deep_unpack();
-        let server = params['server'].deep_unpack();
-        let accountName = params['account'].deep_unpack();
+        let params = Connections.getAccountParams(account);
+        let server = params['server'];
+        let accountName = params['account'];
+        let port = params['port'];
         Utils.debug('Failed to connect to %s with username %s'.format(server, accountName));
 
         let accountServers = [];
@@ -331,7 +332,8 @@ const Application = new Lang.Class({
         data = {
             retry: 0,
             originalAccountName: accountName,
-            alternateServers: accountServers.filter(s => s.address != server)
+            alternateServers: accountServers.filter(s => s.address != server ||
+                                                         s.port != port)
         };
         this._retryData.set(account.object_path, data);
         return data;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]