Fix completely broken exception handling in -[connect].

This commit is contained in:
Jonathan Schleifer 2011-05-24 12:27:21 +02:00
parent 95fe343184
commit 35957ae3c3

View file

@ -201,23 +201,22 @@
[XMPPSRVEnumerator enumeratorWithDomain: server];
XMPPSRVEntry *candidate;
while ((candidate = [SRVEnumerator nextObject])) {
while ((candidate = [SRVEnumerator nextObject]) != nil) {
@try {
[sock connectToHost: [candidate target]
onPort: [candidate port]];
break;
} @catch (id e) {
if (([e class] == [OFAddressTranslationFailedException
class]) || ([e class] ==
[OFConnectionFailedException class]))
continue;
else
@throw e;
} @catch (OFAddressTranslationFailedException *e) {
[e release];
} @catch (OFConnectionFailedException *e) {
[e release];
}
}
if (!candidate)
[sock connectToHost: server
onPort: port];
[self XMPP_startStream];
[pool release];