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