|
@@ -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.
|