Differences From Artifact [9a8423f14c]:
- File src/OFDNSResolver.m — part of check-in [458420998c] at 2021-04-19 21:54:35 on branch new-naming-convention — Rename a few more constants (user: js, size: 32503) [annotate] [blame] [check-ins using] [more...]
To Artifact [6722a88381]:
- File
src/OFDNSResolver.m
— part of check-in
[ec07db28ed]
at
2022-03-24 17:18:27
on branch trunk
— OFDNSResolver: Make canBlock = false opportunistic
Some platforms just don't support non-blocking UDP sockets, but it
should still be possible to resolve DNS names on those. (user: js, size: 32743) [annotate] [blame] [check-ins using] [more...]
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008-2022 Jonathan Schleifer <js@nil.im> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in * the packaging of this file. * |
︙ | ︙ | |||
35 36 37 38 39 40 41 42 43 44 45 46 47 48 | #import "OFUDPSocket+Private.h" #import "OFDNSQueryFailedException.h" #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" #import "OFInvalidServerReplyException.h" #import "OFOutOfRangeException.h" #import "OFTruncatedDataException.h" #ifndef SOCK_DNS # define SOCK_DNS 0 #endif | > | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | #import "OFUDPSocket+Private.h" #import "OFDNSQueryFailedException.h" #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" #import "OFInvalidServerReplyException.h" #import "OFNotImplementedException.h" #import "OFOutOfRangeException.h" #import "OFTruncatedDataException.h" #ifndef SOCK_DNS # define SOCK_DNS 0 #endif |
︙ | ︙ | |||
743 744 745 746 747 748 749 | if (_IPv6Socket == nil) { OFSocketAddress address = OFSocketAddressParseIPv6(@"::", 0); _IPv6Socket = [[OFUDPSocket alloc] init]; [_IPv6Socket of_bindToAddress: &address extraType: SOCK_DNS]; | > | > > > > | > > > | 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 | if (_IPv6Socket == nil) { OFSocketAddress address = OFSocketAddressParseIPv6(@"::", 0); _IPv6Socket = [[OFUDPSocket alloc] init]; [_IPv6Socket of_bindToAddress: &address extraType: SOCK_DNS]; @try { _IPv6Socket.canBlock = false; } @catch (OFNotImplementedException *e) { /* Can't do anything about it... */ } _IPv6Socket.delegate = self; } sock = _IPv6Socket; break; #endif case OFSocketAddressFamilyIPv4: if (_IPv4Socket == nil) { OFSocketAddress address = OFSocketAddressParseIPv4(@"0.0.0.0", 0); _IPv4Socket = [[OFUDPSocket alloc] init]; [_IPv4Socket of_bindToAddress: &address extraType: SOCK_DNS]; @try { _IPv4Socket.canBlock = false; } @catch (OFNotImplementedException *e) { /* Can't do anything about it... */ } _IPv4Socket.delegate = self; } sock = _IPv4Socket; break; default: @throw [OFInvalidArgumentException exception]; |
︙ | ︙ |