︙ | | | ︙ | |
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
|
static OFArray OF_GENERIC(OFString *) *
parseNetStackArray(OFString *string)
{
if (![string hasPrefix: @"["] || ![string hasSuffix: @"]"])
return nil;
string = [string substringWithRange: OFRangeMake(1, string.length - 2)];
return [string componentsSeparatedByString: @"|"];
}
#endif
@implementation OFDNSResolverSettings
- (void)dealloc
|
|
|
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
|
static OFArray OF_GENERIC(OFString *) *
parseNetStackArray(OFString *string)
{
if (![string hasPrefix: @"["] || ![string hasSuffix: @"]"])
return nil;
string = [string substringWithRange: OFMakeRange(1, string.length - 2)];
return [string componentsSeparatedByString: @"|"];
}
#endif
@implementation OFDNSResolverSettings
- (void)dealloc
|
︙ | | | ︙ | |
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
|
options: OFStringSkipEmptyComponents];
if (components.count < 2)
continue;
address = components.firstObject;
hosts = [components objectsInRange:
OFRangeMake(1, components.count - 1)];
for (OFString *host in hosts) {
OFMutableArray *addresses =
[staticHosts objectForKey: host];
if (addresses == nil) {
addresses = [OFMutableArray array];
|
|
|
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
|
options: OFStringSkipEmptyComponents];
if (components.count < 2)
continue;
address = components.firstObject;
hosts = [components objectsInRange:
OFMakeRange(1, components.count - 1)];
for (OFString *host in hosts) {
OFMutableArray *addresses =
[staticHosts objectForKey: host];
if (addresses == nil) {
addresses = [OFMutableArray array];
|
︙ | | | ︙ | |
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
|
if (components.count < 2) {
objc_autoreleasePoolPop(pool2);
continue;
}
option = components.firstObject;
arguments = [components objectsInRange:
OFRangeMake(1, components.count - 1)];
if ([option isEqual: @"nameserver"]) {
if (arguments.count != 1) {
objc_autoreleasePoolPop(pool2);
continue;
}
|
|
|
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
|
if (components.count < 2) {
objc_autoreleasePoolPop(pool2);
continue;
}
option = components.firstObject;
arguments = [components objectsInRange:
OFMakeRange(1, components.count - 1)];
if ([option isEqual: @"nameserver"]) {
if (arguments.count != 1) {
objc_autoreleasePoolPop(pool2);
continue;
}
|
︙ | | | ︙ | |
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
|
OFArray *hosts;
if (components.count < 2)
continue;
address = components.firstObject;
hosts = [components objectsInRange:
OFRangeMake(1, components.count - 1)];
for (OFString *host in hosts) {
OFMutableArray *addresses =
[staticHosts objectForKey: host];
if (addresses == nil) {
addresses = [OFMutableArray array];
|
|
|
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
|
OFArray *hosts;
if (components.count < 2)
continue;
address = components.firstObject;
hosts = [components objectsInRange:
OFMakeRange(1, components.count - 1)];
for (OFString *host in hosts) {
OFMutableArray *addresses =
[staticHosts objectForKey: host];
if (addresses == nil) {
addresses = [OFMutableArray array];
|
︙ | | | ︙ | |
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
|
[self setDefaults];
#if defined(OF_WINDOWS)
# ifdef OF_HAVE_FILES
OFWindowsRegistryKey *key = [[OFWindowsRegistryKey localMachineKey]
openSubkeyAtPath: @"SYSTEM\\CurrentControlSet\\Services\\"
@"Tcpip\\Parameters"
securityAndAccessRights: KEY_QUERY_VALUE];
path = [[[key stringForValueNamed: @"DataBasePath"]
stringByAppendingPathComponent: @"hosts"]
stringByExpandingWindowsEnvironmentStrings];
if (path != nil)
[self parseHosts: path];
# endif
|
|
>
|
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
|
[self setDefaults];
#if defined(OF_WINDOWS)
# ifdef OF_HAVE_FILES
OFWindowsRegistryKey *key = [[OFWindowsRegistryKey localMachineKey]
openSubkeyAtPath: @"SYSTEM\\CurrentControlSet\\Services\\"
@"Tcpip\\Parameters"
accessRights: KEY_QUERY_VALUE
options: 0];
path = [[[key stringForValueNamed: @"DataBasePath"]
stringByAppendingPathComponent: @"hosts"]
stringByExpandingWindowsEnvironmentStrings];
if (path != nil)
[self parseHosts: path];
# endif
|
︙ | | | ︙ | |