From f82922df02372ca26b0f5f5e2eb634143264fdc0 Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Fri, 4 Oct 2019 01:42:04 +0200 Subject: [PATCH] Adjust to ObjFW changes --- ObjXMPP.oc | 2 +- src/XMPPConnection.m | 15 +++++++-------- src/XMPPFileStorage.m | 5 ++--- src/XMPPSCRAMAuth.m | 4 ++-- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/ObjXMPP.oc b/ObjXMPP.oc index 7c6788b..675f92e 100644 --- a/ObjXMPP.oc +++ b/ObjXMPP.oc @@ -1,3 +1,3 @@ -package_description 1 +package_format 1 package_depends_on ObjOpenSSL LIBS="-lobjxmpp $LIBS" diff --git a/src/XMPPConnection.m b/src/XMPPConnection.m index b7f7f07..14eae75 100644 --- a/src/XMPPConnection.m +++ b/src/XMPPConnection.m @@ -297,9 +297,7 @@ - (void)resolver: (OFDNSResolver *)resolver didResolveDomainName: (OFString *)domainName - answerRecords: (OFDictionary *)answerRecords - authorityRecords: (OFDictionary *)authorityRecords - additionalRecords: (OFDictionary *)additionalRecords + response: (OFDNSResponse *)response exception: (id)exception { OFMutableArray *records = [OFMutableArray array]; @@ -313,7 +311,7 @@ } for (OFDNSResourceRecord *record in - [answerRecords objectForKey: domainName]) + [response.answerRecords objectForKey: domainName]) if ([record isKindOfClass: [OFSRVDNSResourceRecord class]]) [records addObject: record]; @@ -349,11 +347,12 @@ else { OFString *SRVDomain = [_domainToASCII stringByPrependingString: @"_xmpp-client._tcp."]; - [[OFThread DNSResolver] - asyncResolveHost: SRVDomain + OFDNSRequest *request = [OFDNSRequest + requestWithHost: SRVDomain recordClass: OF_DNS_RESOURCE_RECORD_CLASS_IN - recordType: OF_DNS_RESOURCE_RECORD_TYPE_SRV - delegate: self]; + recordType: OF_DNS_RESOURCE_RECORD_TYPE_SRV]; + [[OFThread DNSResolver] asyncPerformRequest: request + delegate: self]; } objc_autoreleasePoolPop(pool); diff --git a/src/XMPPFileStorage.m b/src/XMPPFileStorage.m index 64c60f7..ed27952 100644 --- a/src/XMPPFileStorage.m +++ b/src/XMPPFileStorage.m @@ -29,7 +29,6 @@ #import #import #import -#import #import @@ -46,7 +45,7 @@ self = [super init]; @try { - OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; + void *pool = objc_autoreleasePoolPush(); _file = [file copy]; @try { @@ -56,7 +55,7 @@ _data = [[OFMutableDictionary alloc] init]; } - [pool release]; + objc_autoreleasePoolPop(pool); } @catch (id e) { [self release]; @throw e; diff --git a/src/XMPPSCRAMAuth.m b/src/XMPPSCRAMAuth.m index 9d9ba7f..d1befc8 100644 --- a/src/XMPPSCRAMAuth.m +++ b/src/XMPPSCRAMAuth.m @@ -208,7 +208,7 @@ - (OFData *)continueWithData: (OFData *)data { - OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; + void *pool = objc_autoreleasePoolPush(); OFData *ret; if (!_serverSignature) @@ -217,7 +217,7 @@ ret = [self xmpp_parseServerFinalMessage: data]; [ret retain]; - [pool release]; + objc_autoreleasePoolPop(pool); return [ret autorelease]; }