ObjFW  Diff

Differences From Artifact [4afca1f112]:

  • File src/OFDNSResolverSettings.m — part of check-in [9d802a786d] at 2025-01-01 12:58:18 on branch trunk — Update copyright (user: js size: 18560) [more...]

To Artifact [7bd9c124e7]:

  • File src/OFDNSResolverSettings.m — part of check-in [4ffe12226e] at 2025-03-11 01:36:31 on branch trunk — Add -[OFString unsignedIntValue] (user: js size: 18277)

337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352


353
354
355
356
357
358
359
360
361

362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
337
338
339
340
341
342
343


344






345
346
347
348

349
350


351

352





353
354

355
356
357
358
359
360
361







-
-

-
-
-
-
-
-
+
+


-


-
-

-
+
-
-
-
-
-


-







}

# ifndef OF_WINDOWS
- (void)parseResolvConfOption: (OFString *)option
{
	@try {
		if ([option hasPrefix: @"ndots:"]) {
			unsigned long long number;

			option = [option substringFromIndex: 6];
			number = option.unsignedLongLongValue;

			if (number > UINT_MAX)
				@throw [OFOutOfRangeException exception];

			_minNumberOfDotsInAbsoluteName = (unsigned int)number;
			_minNumberOfDotsInAbsoluteName =
			    option.unsignedIntValue;
		} else if ([option hasPrefix: @"timeout:"]) {
			option = [option substringFromIndex: 8];

			_timeout = option.unsignedLongLongValue;
		} else if ([option hasPrefix: @"attempts:"]) {
			unsigned long long number;

			option = [option substringFromIndex: 9];
			number = option.unsignedLongLongValue;
			_maxAttempts = option.unsignedIntValue;

			if (number > UINT_MAX)
				@throw [OFOutOfRangeException exception];

			_maxAttempts = (unsigned int)number;
		} else if ([option hasPrefix: @"reload-period:"]) {
			option = [option substringFromIndex: 14];

			_configReloadInterval = option.unsignedLongLongValue;
		} else if ([option isEqual: @"tcp"])
			_forcesTCP = true;
	} @catch (OFInvalidFormatException *e) {
	}
}