Fix completely broken exception handling in -[connect].
This commit is contained in:
parent
95fe343184
commit
35957ae3c3
1 changed files with 8 additions and 9 deletions
|
@ -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];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue