소스 검색

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 11 년 전
부모
커밋
50eaacee9e
1개의 변경된 파일17개의 추가작업 그리고 15개의 파일을 삭제
  1. 17
    15
      src/com/dmdirc/parser/irc/IRCParser.java

+ 17
- 15
src/com/dmdirc/parser/irc/IRCParser.java 파일 보기

340
         int port = uri.getPort();
340
         int port = uri.getPort();
341
         String host = uri.getHost();
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
         // Fix the port if required.
364
         // Fix the port if required.

Loading…
취소
저장