Don't connect to any address record if SRV records exist
This commit is contained in:
parent
393e75930b
commit
de9b58c4a6
1 changed files with 11 additions and 12 deletions
|
@ -255,12 +255,17 @@
|
||||||
free(cDomainToASCII);
|
free(cDomainToASCII);
|
||||||
}
|
}
|
||||||
|
|
||||||
@try {
|
SRVLookup = [XMPPSRVLookup
|
||||||
SRVLookup = [XMPPSRVLookup
|
lookupWithDomain: domainToASCII];
|
||||||
lookupWithDomain: domainToASCII];
|
enumerator = [SRVLookup objectEnumerator];
|
||||||
enumerator = [SRVLookup objectEnumerator];
|
|
||||||
|
|
||||||
while ((candidate = [enumerator nextObject]) != nil) {
|
// If there are no SRV records connect via A/AAAA record
|
||||||
|
if ((candidate = [enumerator nextObject]) == nil)
|
||||||
|
[sock connectToHost: domainToASCII
|
||||||
|
port: port];
|
||||||
|
// Iterate over SRV records
|
||||||
|
else {
|
||||||
|
do {
|
||||||
@try {
|
@try {
|
||||||
[sock connectToHost: [candidate target]
|
[sock connectToHost: [candidate target]
|
||||||
port: [candidate port]];
|
port: [candidate port]];
|
||||||
|
@ -271,14 +276,8 @@
|
||||||
} @catch (OFConnectionFailedException *e) {
|
} @catch (OFConnectionFailedException *e) {
|
||||||
[e release];
|
[e release];
|
||||||
}
|
}
|
||||||
}
|
} while ((candidate = [enumerator nextObject]) != nil);
|
||||||
} @catch (OFAddressTranslationFailedException *e) {
|
|
||||||
[e release];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!candidate)
|
|
||||||
[sock connectToHost: domainToASCII
|
|
||||||
port: port];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[self XMPP_startStream];
|
[self XMPP_startStream];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue