Differences From Artifact [8f4fd230d2]:
- File src/OFDNSResolver.m — part of check-in [22700e6082] at 2018-10-06 20:21:47 on branch trunk — OFDNSResolver: Add sync resolve socket addresses (user: js, size: 58216) [annotate] [blame] [check-ins using]
To Artifact [f094c42133]:
- File
src/OFDNSResolver.m
— part of check-in
[6e9ee122eb]
at
2018-10-07 02:06:46
on branch trunk
— Remove resolver.m
Instead, OFDNSResolver is used for everything now. (user: js, size: 59067) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
30 31 32 33 34 35 36 37 38 39 40 41 42 43 | #import "OFFile.h" #import "OFLocale.h" #import "OFNumber.h" #import "OFPair.h" #import "OFString.h" #import "OFTimer.h" #import "OFUDPSocket.h" #ifdef OF_WINDOWS # import "OFWindowsRegistryKey.h" #endif #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" | > | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | #import "OFFile.h" #import "OFLocale.h" #import "OFNumber.h" #import "OFPair.h" #import "OFString.h" #import "OFTimer.h" #import "OFUDPSocket.h" #import "OFUDPSocket+Private.h" #ifdef OF_WINDOWS # import "OFWindowsRegistryKey.h" #endif #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" |
︙ | ︙ | |||
1780 1781 1782 1783 1784 1785 1786 1787 | objectAtIndex: query->_nameServersIndex]; query->_usedNameServer = of_socket_address_parse_ip(nameServer, 53); switch (query->_usedNameServer.family) { #ifdef OF_HAVE_IPV6 case OF_SOCKET_ADDRESS_FAMILY_IPV6: if (_IPv6Socket == nil) { _IPv6Socket = [[OFUDPSocket alloc] init]; | > > > | < > > > | < | 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 | objectAtIndex: query->_nameServersIndex]; query->_usedNameServer = of_socket_address_parse_ip(nameServer, 53); switch (query->_usedNameServer.family) { #ifdef OF_HAVE_IPV6 case OF_SOCKET_ADDRESS_FAMILY_IPV6: if (_IPv6Socket == nil) { of_socket_address_t address = of_socket_address_parse_ip(@"::", 0); _IPv6Socket = [[OFUDPSocket alloc] init]; [_IPv6Socket of_bindToAddress: &address]; [_IPv6Socket setBlocking: false]; } sock = _IPv6Socket; break; #endif case OF_SOCKET_ADDRESS_FAMILY_IPV4: if (_IPv4Socket == nil) { of_socket_address_t address = of_socket_address_parse_ip(@"0.0.0.0", 0); _IPv4Socket = [[OFUDPSocket alloc] init]; [_IPv4Socket of_bindToAddress: &address]; [_IPv4Socket setBlocking: false]; } sock = _IPv4Socket; break; default: @throw [OFInvalidArgumentException exception]; |
︙ | ︙ | |||
2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 | runLoopMode: (of_run_loop_mode_t)runLoopMode target: (id)target selector: (SEL)selector context: (id)userContext { void *pool = objc_autoreleasePoolPush(); OFDNSResolver_AsyncResolveSocketAddressesContext *context; context = [[[OFDNSResolver_AsyncResolveSocketAddressesContext alloc] initWithHost: host target: target selector: selector context: userContext] autorelease]; | > > > > > > > > > > > > > > > > > > > > > > | 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 | runLoopMode: (of_run_loop_mode_t)runLoopMode target: (id)target selector: (SEL)selector context: (id)userContext { void *pool = objc_autoreleasePoolPush(); OFDNSResolver_AsyncResolveSocketAddressesContext *context; @try { of_socket_address_t address = of_socket_address_parse_ip(host, 0); OFData *addresses; void (*method)(id, SEL, OFDNSResolver *, OFString *, OFData *, id, id); if (addressFamily != OF_SOCKET_ADDRESS_FAMILY_ANY && address.family != addressFamily) @throw [OFInvalidArgumentException exception]; addresses = [OFData dataWithItems: &address itemSize: sizeof(address) count: 1]; method = (void (*)(id, SEL, OFDNSResolver *, OFString *, OFData *, id, id))[target methodForSelector: selector]; method(target, selector, self, host, addresses, userContext, nil); } @catch (OFInvalidFormatException *e) { } context = [[[OFDNSResolver_AsyncResolveSocketAddressesContext alloc] initWithHost: host target: target selector: selector context: userContext] autorelease]; |
︙ | ︙ |