ObjFW  Diff

Differences From Artifact [3c9332d43f]:

To Artifact [f7027f3fe4]:


24
25
26
27
28
29
30
31

32
33
34
35
36
37
38
39
40
41
42
43

44
45
46
47
48
49
50
51
52
53

@interface OFDNS: OFObject <OFApplicationDelegate>
@end

OF_APPLICATION_DELEGATE(OFDNS)

@implementation OFDNS
-	(void)DNSResolver: (OFDNSResolver *)resolver

  didReceiveAnswerRecords: (OFArray *)answerRecords
	 authorityRecords: (OFArray *)authorityRecords
	additionalRecords: (OFArray *)additionalRecords
		  context: (id)context
		exception: (id)exception
{
	if (exception != nil) {
		[of_stderr writeFormat: @"Failed to resolve: %@\n", exception];
		[OFApplication terminateWithStatus: 1];
	}

	[of_stdout writeFormat: @"Answer records: %@\n"

				@"Authority records: %@\n"
				@"Additional records: %@\n",
				answerRecords, authorityRecords,
				additionalRecords];

	[OFApplication terminate];
}

- (void)applicationDidFinishLaunching
{







|
>
|
|
|
|
|






|
>


|







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

@interface OFDNS: OFObject <OFApplicationDelegate>
@end

OF_APPLICATION_DELEGATE(OFDNS)

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

	[of_stdout writeFormat: @"FQDN: %@\n"
				@"Answer records: %@\n"
				@"Authority records: %@\n"
				@"Additional records: %@\n",
				domainName, answerRecords, authorityRecords,
				additionalRecords];

	[OFApplication terminate];
}

- (void)applicationDidFinishLaunching
{
79
80
81
82
83
84
85
86
87
88
89
90
91
92
		[resolver setNameServers:
		    [OFArray arrayWithObject: [arguments objectAtIndex: 3]]];

	[resolver asyncResolveHost: [arguments objectAtIndex: 0]
		       recordClass: recordClass
			recordType: recordType
			    target: self
			  selector: @selector(DNSResolver:
					didReceiveAnswerRecords:
					authorityRecords:additionalRecords:
					context:exception:)
			   context: nil];
}
@end







|
<
|
|



81
82
83
84
85
86
87
88

89
90
91
92
93
		[resolver setNameServers:
		    [OFArray arrayWithObject: [arguments objectAtIndex: 3]]];

	[resolver asyncResolveHost: [arguments objectAtIndex: 0]
		       recordClass: recordClass
			recordType: recordType
			    target: self
			  selector: @selector(DNSResolver:didResolveDomainName:

					answerRecords:authorityRecords:
					additionalRecords:context:exception:)
			   context: nil];
}
@end