Differences From Artifact [15c765674a]:
- File
src/OFDNSResolver.m
— part of check-in
[064dbe5127]
at
2018-12-11 22:57:46
on branch trunk
— Include an exception in delegate methods
Otherwise, there would be two methods for every operation: One for
success and one for failure. It also makes it easy to forget about
handling failure, so it's better to always pass an optional exception. (user: js, size: 60197) [annotate] [blame] [check-ins using]
To Artifact [411a1eb381]:
- File
src/OFDNSResolver.m
— part of check-in
[0f3ae90eef]
at
2018-12-18 21:17:28
on branch trunk
— Use OFData instead of a buffer for async UDP sends
This avoids the entire problem of keeping the buffer alive until the
send finished. (user: js, size: 60148) [annotate] [blame] [check-ins using]
︙ | |||
1808 1809 1810 1811 1812 1813 1814 | 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 | - - - - + + + | sock = _IPv4Socket; break; default: @throw [OFInvalidArgumentException exception]; } |
︙ | |||
1866 1867 1868 1869 1870 1871 1872 | 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 | - + | callback(query->_target, query->_selector, self, query->_domainName, nil, nil, nil, query->_context, exception); } - (bool)socket: (OF_KINDOF(OFUDPSocket *))sock didReceiveIntoBuffer: (void *)buffer_ length: (size_t)length |
︙ | |||
1888 1889 1890 1891 1892 1893 1894 | 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 | - + | ID = [OFNumber numberWithUInt16: (buffer[0] << 8) | buffer[1]]; query = [[[_queries objectForKey: ID] retain] autorelease]; if (query == nil) return true; |
︙ |