ObjFW  Diff

Differences From Artifact [1dc603e93a]:

  • File utils/ofdns/OFDNS.m — part of check-in [0afb04d93c] at 2018-12-22 00:29:42 on branch trunk — OFDNSResolver: Use a delegate for async operations

    Because there is usually only one resolver per thread, having the
    delegate as a property on the resolver would not work. It is therefore
    passed as an argument.

    This only changes the public API so far. Internally, the old target /
    selector / context pattern is still being used. This will be changed
    later. (user: js, size: 2870) [annotate] [blame] [check-ins using]

To Artifact [3ba174823c]:


27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
@end

OF_APPLICATION_DELEGATE(OFDNS)

@implementation OFDNS
-	(void)resolver: (OFDNSResolver *)resolver
  didResolveDomainName: (OFString *)domainName
	 answerRecords: (OFArray *)answerRecords
      authorityRecords: (OFArray *)authorityRecords
     additionalRecords: (OFArray *)additionalRecords
	     exception: (id)exception
{
	if (exception != nil) {
		[of_stderr writeFormat: @"Failed to resolve: %@\n", exception];
		[OFApplication terminateWithStatus: 1];
	}








|
|
|







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
@end

OF_APPLICATION_DELEGATE(OFDNS)

@implementation OFDNS
-	(void)resolver: (OFDNSResolver *)resolver
  didResolveDomainName: (OFString *)domainName
	 answerRecords: (of_dns_resolver_records_t)answerRecords
      authorityRecords: (of_dns_resolver_records_t)authorityRecords
     additionalRecords: (of_dns_resolver_records_t)additionalRecords
	     exception: (id)exception
{
	if (exception != nil) {
		[of_stderr writeFormat: @"Failed to resolve: %@\n", exception];
		[OFApplication terminateWithStatus: 1];
	}