Adjust to ObjFW changes
This commit is contained in:
parent
a623ca01d8
commit
1061c08262
2 changed files with 20 additions and 12 deletions
|
@ -348,8 +348,7 @@ OF_ASSUME_NONNULL_END
|
||||||
connectToHost: [candidate target]
|
connectToHost: [candidate target]
|
||||||
port: [candidate port]];
|
port: [candidate port]];
|
||||||
break;
|
break;
|
||||||
} @catch (OFAddressTranslationFailedException
|
} @catch (OFResolveHostFailedException *e) {
|
||||||
*e) {
|
|
||||||
} @catch (OFConnectionFailedException *e) {
|
} @catch (OFConnectionFailedException *e) {
|
||||||
}
|
}
|
||||||
} while ((candidate = [enumerator nextObject]) != nil);
|
} while ((candidate = [enumerator nextObject]) != nil);
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
|
|
||||||
#import "XMPPSRVLookup.h"
|
#import "XMPPSRVLookup.h"
|
||||||
|
|
||||||
#import <ObjFW/OFLocalization.h>
|
#import <ObjFW/OFLocale.h>
|
||||||
|
|
||||||
OF_ASSUME_NONNULL_BEGIN
|
OF_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ OF_ASSUME_NONNULL_END
|
||||||
|
|
||||||
_target = [[OFString alloc]
|
_target = [[OFString alloc]
|
||||||
initWithCString: buffer
|
initWithCString: buffer
|
||||||
encoding: [OFLocalization encoding]];
|
encoding: [OFLocale encoding]];
|
||||||
} @catch (id e) {
|
} @catch (id e) {
|
||||||
[self release];
|
[self release];
|
||||||
@throw e;
|
@throw e;
|
||||||
|
@ -195,12 +195,15 @@ OF_ASSUME_NONNULL_END
|
||||||
ns_msg handle;
|
ns_msg handle;
|
||||||
|
|
||||||
if (res_ninit(&_resState))
|
if (res_ninit(&_resState))
|
||||||
@throw [OFAddressTranslationFailedException
|
@throw [OFResolveHostFailedException
|
||||||
exceptionWithHost: _domain];
|
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];
|
answer = [self allocMemoryWithSize: pageSize];
|
||||||
answerLen = res_nsearch(&_resState, [request
|
answerLen = res_nsearch(&_resState,
|
||||||
cStringWithEncoding: [OFLocalization encoding]],
|
[request cStringWithEncoding: [OFLocale encoding]],
|
||||||
ns_c_in, ns_t_srv, answer, (int)pageSize);
|
ns_c_in, ns_t_srv, answer, (int)pageSize);
|
||||||
|
|
||||||
if ((answerLen == -1) && ((h_errno == HOST_NOT_FOUND) ||
|
if ((answerLen == -1) && ((h_errno == HOST_NOT_FOUND) ||
|
||||||
|
@ -208,12 +211,18 @@ OF_ASSUME_NONNULL_END
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (answerLen < 1 || answerLen > pageSize)
|
if (answerLen < 1 || answerLen > pageSize)
|
||||||
@throw [OFAddressTranslationFailedException
|
@throw [OFResolveHostFailedException
|
||||||
exceptionWithHost: _domain];
|
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))
|
if (ns_initparse(answer, answerLen, &handle))
|
||||||
@throw [OFAddressTranslationFailedException
|
@throw [OFResolveHostFailedException
|
||||||
exceptionWithHost: _domain];
|
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);
|
resourceRecordCount = ns_msg_count(handle, ns_s_an);
|
||||||
for (i = 0; i < resourceRecordCount; i++) {
|
for (i = 0; i < resourceRecordCount; i++) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue