Quellcode durchsuchen

Don't check for SRV Records if a port is specified.

Change-Id: I6e48c0092c26fc5faec05f6400b9b35d12f91902
Reviewed-on: http://gerrit.dmdirc.com/2577
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Greg Holmes <greg@dmdirc.com>
tags/0.7
Shane Mc Cormack vor 11 Jahren
Ursprung
Commit
50eaacee9e
1 geänderte Dateien mit 17 neuen und 15 gelöschten Zeilen
  1. 17
    15
      src/com/dmdirc/parser/irc/IRCParser.java

+ 17
- 15
src/com/dmdirc/parser/irc/IRCParser.java Datei anzeigen

@@ -340,23 +340,25 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
340 340
         int port = uri.getPort();
341 341
         String host = uri.getHost();
342 342
 
343
-        // Now look for SRV records.
344
-        List<SRVRecord> recordList = new ArrayList<SRVRecord>();
345
-        if (isSSL) {
346
-            // There are a few possibilities for ssl...
347
-            final String[] protocols = {"_ircs._tcp.", "_irc._tls."};
348
-            for (final String protocol : protocols) {
349
-                recordList = SRVRecord.getRecords(protocol + host);
350
-                if (!recordList.isEmpty()) {
351
-                    break;
343
+        // Look for SRV records if no port is specified.
344
+        if (port == -1) {
345
+            List<SRVRecord> recordList = new ArrayList<SRVRecord>();
346
+            if (isSSL) {
347
+                // There are a few possibilities for ssl...
348
+                final String[] protocols = {"_ircs._tcp.", "_irc._tls."};
349
+                for (final String protocol : protocols) {
350
+                    recordList = SRVRecord.getRecords(protocol + host);
351
+                    if (!recordList.isEmpty()) {
352
+                        break;
353
+                    }
352 354
                 }
355
+            } else {
356
+                recordList = SRVRecord.getRecords("_irc._tcp." + host);
357
+            }
358
+            if (!recordList.isEmpty()) {
359
+                host = recordList.get(0).getHost();
360
+                port = recordList.get(0).getPort();
353 361
             }
354
-        } else {
355
-            recordList = SRVRecord.getRecords("_irc._tcp." + host);
356
-        }
357
-        if (!recordList.isEmpty()) {
358
-            host = recordList.get(0).getHost();
359
-            port = recordList.get(0).getPort();
360 362
         }
361 363
 
362 364
         // Fix the port if required.

Laden…
Abbrechen
Speichern