Index: src/OFDNSResolver.h ================================================================== --- src/OFDNSResolver.h +++ src/OFDNSResolver.h @@ -178,13 +178,13 @@ * @brief The minimum number of dots for a name to be considered absolute. */ @property (nonatomic) unsigned int minNumberOfDotsInAbsoluteName; /** - * @brief Whether the resolver uses TCP to talk to a name server. + * @brief Whether the resolver forces TCP to talk to a name server. */ -@property (nonatomic) bool usesTCP; +@property (nonatomic) bool forcesTCP; /** * @brief The interval in seconds in which the config should be reloaded. * * Setting this to 0 disables config reloading. Index: src/OFDNSResolver.m ================================================================== --- src/OFDNSResolver.m +++ src/OFDNSResolver.m @@ -676,18 +676,18 @@ { _settings->_minNumberOfDotsInAbsoluteName = minNumberOfDotsInAbsoluteName; } -- (bool)usesTCP +- (bool)forcesTCP { - return _settings->_usesTCP; + return _settings->_forcesTCP; } -- (void)setUsesTCP: (bool)usesTCP +- (void)setForcesTCP: (bool)forcesTCP { - _settings->_usesTCP = usesTCP; + _settings->_forcesTCP = forcesTCP; } - (OFTimeInterval)configReloadInterval { return _settings->_configReloadInterval; @@ -721,11 +721,11 @@ forMode: runLoopMode]; nameServer = [context->_settings->_nameServers objectAtIndex: context->_nameServersIndex]; - if (context->_settings->_usesTCP) { + if (context->_settings->_forcesTCP) { OFEnsure(context->_TCPSocket == nil); context->_TCPSocket = [[OFTCPSocket alloc] init]; [_TCPQueries setObject: context forKey: context->_TCPSocket]; @@ -946,14 +946,14 @@ /* TC */ if (buffer[2] & 0x02) { OFRunLoopMode runLoopMode; - if (context->_settings->_usesTCP) + if (context->_settings->_forcesTCP) @throw [OFTruncatedDataException exception]; - context->_settings->_usesTCP = true; + context->_settings->_forcesTCP = true; runLoopMode = [OFRunLoop currentRunLoop].currentMode; [self of_sendQueryForContext: context runLoopMode: runLoopMode]; return false; } Index: src/OFDNSResolverSettings.h ================================================================== --- src/OFDNSResolverSettings.h +++ src/OFDNSResolverSettings.h @@ -29,15 +29,15 @@ OFArray OF_GENERIC(OFString *) *_nameServers; OFString *_Nullable _localDomain; OFArray OF_GENERIC(OFString *) *_searchDomains; OFTimeInterval _timeout; unsigned int _maxAttempts, _minNumberOfDotsInAbsoluteName; - bool _usesTCP; + bool _forcesTCP; OFTimeInterval _configReloadInterval; @protected OFDate *_lastConfigReload; } - (void)reload; @end OF_ASSUME_NONNULL_END Index: src/OFDNSResolverSettings.m ================================================================== --- src/OFDNSResolverSettings.m +++ src/OFDNSResolverSettings.m @@ -215,11 +215,11 @@ copy->_searchDomains = [_searchDomains copy]; copy->_timeout = _timeout; copy->_maxAttempts = _maxAttempts; copy->_minNumberOfDotsInAbsoluteName = _minNumberOfDotsInAbsoluteName; - copy->_usesTCP = _usesTCP; + copy->_forcesTCP = _forcesTCP; copy->_configReloadInterval = _configReloadInterval; copy->_lastConfigReload = [_lastConfigReload copy]; } @catch (id e) { [copy release]; @throw e; @@ -243,11 +243,11 @@ _searchDomains = nil; _timeout = 2; _maxAttempts = 3; _minNumberOfDotsInAbsoluteName = 1; - _usesTCP = false; + _forcesTCP = false; #ifndef OF_NINTENDO_3DS _configReloadInterval = 2; #else _configReloadInterval = 0; #endif @@ -345,11 +345,11 @@ } else if ([option hasPrefix: @"reload-period:"]) { option = [option substringFromIndex: 14]; _configReloadInterval = option.unsignedLongLongValue; } else if ([option isEqual: @"tcp"]) - _usesTCP = true; + _forcesTCP = true; } @catch (OFInvalidFormatException *e) { } } - (void)parseResolvConf: (OFString *)path Index: tests/OFDNSResolverTests.m ================================================================== --- tests/OFDNSResolverTests.m +++ tests/OFDNSResolverTests.m @@ -57,15 +57,15 @@ [OFStdOut writeFormat: @"[OFDNSResolver] Min number of dots in absolute name: %u\n", resolver.minNumberOfDotsInAbsoluteName]; - [OFStdOut writeFormat: @"[OFDNSResolver] Uses TCP: %u\n", - resolver.usesTCP]; + [OFStdOut writeFormat: @"[OFDNSResolver] Forces TCP: %u\n", + resolver.forcesTCP]; [OFStdOut writeFormat: @"[OFDNSResolver] Config reload interval: %lf\n", resolver.configReloadInterval]; objc_autoreleasePoolPop(pool); } @end