Index: src/XMPPConnection.m ================================================================== --- src/XMPPConnection.m +++ src/XMPPConnection.m @@ -346,12 +346,11 @@ @try { [_socket connectToHost: [candidate target] port: [candidate port]]; break; - } @catch (OFAddressTranslationFailedException - *e) { + } @catch (OFResolveHostFailedException *e) { } @catch (OFConnectionFailedException *e) { } } while ((candidate = [enumerator nextObject]) != nil); } else /* No SRV records -> fall back to A / AAAA record */ Index: src/XMPPSRVLookup.m ================================================================== --- src/XMPPSRVLookup.m +++ src/XMPPSRVLookup.m @@ -36,11 +36,11 @@ #include #include #import "XMPPSRVLookup.h" -#import +#import OF_ASSUME_NONNULL_BEGIN @interface XMPPSRVLookup () - (void)XMPP_lookup; @@ -116,11 +116,11 @@ @throw [OFInitializationFailedException exceptionWithClass: [self class]]; _target = [[OFString alloc] initWithCString: buffer - encoding: [OFLocalization encoding]]; + encoding: [OFLocale encoding]]; } @catch (id e) { [self release]; @throw e; } @@ -193,29 +193,38 @@ int answerLen, resourceRecordCount, i; ns_rr resourceRecord; ns_msg handle; if (res_ninit(&_resState)) - @throw [OFAddressTranslationFailedException - exceptionWithHost: _domain]; + @throw [OFResolveHostFailedException + exceptionWithHost: _domain + recordClass: OF_DNS_RESOURCE_RECORD_CLASS_IN + recordType: OF_DNS_RESOURCE_RECORD_TYPE_SRV + error: OF_DNS_RESOLVER_ERROR_UNKNOWN]; answer = [self allocMemoryWithSize: pageSize]; - answerLen = res_nsearch(&_resState, [request - cStringWithEncoding: [OFLocalization encoding]], + answerLen = res_nsearch(&_resState, + [request cStringWithEncoding: [OFLocale encoding]], ns_c_in, ns_t_srv, answer, (int)pageSize); if ((answerLen == -1) && ((h_errno == HOST_NOT_FOUND) || (h_errno == NO_DATA))) return; if (answerLen < 1 || answerLen > pageSize) - @throw [OFAddressTranslationFailedException - exceptionWithHost: _domain]; + @throw [OFResolveHostFailedException + exceptionWithHost: _domain + recordClass: OF_DNS_RESOURCE_RECORD_CLASS_IN + recordType: OF_DNS_RESOURCE_RECORD_TYPE_SRV + error: OF_DNS_RESOLVER_ERROR_UNKNOWN]; if (ns_initparse(answer, answerLen, &handle)) - @throw [OFAddressTranslationFailedException - exceptionWithHost: _domain]; + @throw [OFResolveHostFailedException + exceptionWithHost: _domain + recordClass: OF_DNS_RESOURCE_RECORD_CLASS_IN + recordType: OF_DNS_RESOURCE_RECORD_TYPE_SRV + error: OF_DNS_RESOLVER_ERROR_UNKNOWN]; resourceRecordCount = ns_msg_count(handle, ns_s_an); for (i = 0; i < resourceRecordCount; i++) { if (ns_parserr(&handle, ns_s_an, i, &resourceRecord)) continue;