Differences From Artifact [84af245824]:
- File
utils/ofdns/OFDNS.m
— part of check-in
[d69f7bc1ff]
at
2019-10-06 16:27:12
on branch trunk
— Rename OFDNSRequest -> OFDNSQuery
This is now in alignment with the terminology of the RFC. (user: js, size: 2691) [annotate] [blame] [check-ins using]
To Artifact [0a1cb7aeaf]:
- File
utils/ofdns/OFDNS.m
— part of check-in
[ee592cf603]
at
2019-10-07 00:07:55
on branch trunk
— OFDNSResolver: Major refactor
This temporarily doesn't use the search domains anymore and makes CNAMEs
slightly more inefficient. The next commits will fix both. (user: js, size: 2568) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
25 26 27 28 29 30 31 | @interface OFDNS: OFObject <OFApplicationDelegate, OFDNSResolverDelegate> @end OF_APPLICATION_DELEGATE(OFDNS) @implementation OFDNS | | | | | | < < < | | 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 56 57 | @interface OFDNS: OFObject <OFApplicationDelegate, OFDNSResolverDelegate> @end OF_APPLICATION_DELEGATE(OFDNS) @implementation OFDNS - (void)resolver: (OFDNSResolver *)resolver didPerformQuery: (OFDNSQuery *)query response: (OFDNSResponse *)response exception: (id)exception { if (exception != nil) { [of_stderr writeFormat: @"Failed to resolve: %@\n", exception]; [OFApplication terminateWithStatus: 1]; } [of_stdout writeFormat: @"%@\n", response]; [OFApplication terminate]; } - (void)applicationDidFinishLaunching { OFArray OF_GENERIC(OFString *) *arguments = [OFApplication arguments]; of_dns_class_t DNSClass = OF_DNS_CLASS_ANY; of_dns_resource_record_type_t recordType = OF_DNS_RESOURCE_RECORD_TYPE_ALL; OFDNSQuery *query; OFDNSResolver *resolver; #ifdef OF_HAVE_SANDBOX OFSandbox *sandbox = [[OFSandbox alloc] init]; |
︙ | ︙ | |||
78 79 80 81 82 83 84 | resolver = [OFDNSResolver resolver]; if (arguments.count >= 2) recordType = of_dns_resource_record_type_parse( [arguments objectAtIndex: 1]); if (arguments.count >= 3) | < | | | | | 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | resolver = [OFDNSResolver resolver]; if (arguments.count >= 2) recordType = of_dns_resource_record_type_parse( [arguments objectAtIndex: 1]); if (arguments.count >= 3) DNSClass = of_dns_class_parse([arguments objectAtIndex: 2]); if (arguments.count >= 4) { resolver.configReloadInterval = 0; resolver.nameServers = [arguments objectsInRange: of_range(3, 1)]; } query = [OFDNSQuery queryWithDomainName: [arguments objectAtIndex: 0] DNSClass: DNSClass recordType: recordType]; [resolver asyncPerformQuery: query delegate: self]; } @end |