Differences From Artifact [7061e87e9f]:
- File src/OFDNSResolver.m — part of check-in [b6cb3addd0] at 2020-06-28 15:03:23 on branch trunk — Use OF_DIRECT(_MEMBERS) where appropriate (user: js, size: 32889) [annotate] [blame] [check-ins using] [more...]
To Artifact [abd3a40827]:
- File
src/OFDNSResolver.m
— part of check-in
[25c985fec1]
at
2020-08-25 00:11:24
on branch trunk
— OFNumber: Remove (u)int{8,16,32,64} methods
Since C guarantees minimum sizes for char, short, int, long and long
long, these can be used instead. (user: js, size: 32902) [annotate] [blame] [check-ins using] [more...]
| ︙ | ︙ | |||
489 490 491 492 493 494 495 | _settings = [settings copy]; _delegate = [delegate retain]; queryData = [OFMutableData dataWithCapacity: 512]; /* Header */ | | | 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 | _settings = [settings copy]; _delegate = [delegate retain]; queryData = [OFMutableData dataWithCapacity: 512]; /* Header */ tmp = OF_BSWAP16_IF_LE(_ID.unsignedShortValue); [queryData addItems: &tmp count: 2]; /* RD */ tmp = OF_BSWAP16_IF_LE(1u << 8); [queryData addItems: &tmp count: 2]; |
| ︙ | ︙ | |||
810 811 812 813 814 815 816 |
{
void *pool = objc_autoreleasePoolPush();
OFNumber *ID;
OFDNSResolverContext *context;
/* Random, unused ID */
do {
| | | 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 |
{
void *pool = objc_autoreleasePoolPush();
OFNumber *ID;
OFDNSResolverContext *context;
/* Random, unused ID */
do {
ID = [OFNumber numberWithUnsignedShort: of_random16()];
} while ([_queries objectForKey: ID] != nil);
if (query.domainName.UTF8StringLength > 253)
@throw [OFOutOfRangeException exception];
if (_settings->_nameServers.count == 0) {
id exception = [OFDNSQueryFailedException
|
| ︙ | ︙ | |||
909 910 911 912 913 914 915 | OFNumber *ID; OFDNSResolverContext *context; if (length < 2) /* We can't get the ID to get the context. Ignore packet. */ return true; | | | 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 |
OFNumber *ID;
OFDNSResolverContext *context;
if (length < 2)
/* We can't get the ID to get the context. Ignore packet. */
return true;
ID = [OFNumber numberWithUnsignedShort: (buffer[0] << 8) | buffer[1]];
context = [[[_queries objectForKey: ID] retain] autorelease];
if (context == nil)
return true;
if (context->_TCPSocket != nil) {
if ([_TCPQueries objectForKey: context->_TCPSocket] != context)
|
| ︙ | ︙ |