Commit 825a182a authored by Ivan Vilata-i-Balaguer's avatar Ivan Vilata-i-Balaguer
Browse files

Make it explicit that DoH requests are for IPv4 addresses only.

parent 90bd9c92
......@@ -686,7 +686,7 @@ Client::State::resolve_tcp_doh( const std::string& host
if (!e) return TcpLookup::create(TcpLookup::endpoint_type{move(addr), *portn_o}, host, port);
}
auto rq_o = doh::build_request(host, ep);
auto rq_o = doh::build_request_ipv4(host, ep); // TODO: IPv6
if (!rq_o) return or_throw<TcpLookup>(yield, asio::error::invalid_argument);
sys::error_code ec;
......
......@@ -109,8 +109,8 @@ dns_query(const std::string& name)
}
boost::optional<Request>
build_request( const std::string& name
, const Endpoint& ep)
build_request_ipv4( const std::string& name
, const Endpoint& ep)
{
auto dq_o = dns_query(name);
if (!dq_o) return boost::none;
......
......@@ -37,12 +37,12 @@ using Endpoint = std::string;
// Return none if the base URL is invalid.
boost::optional<Endpoint> endpoint_from_base(const std::string&);
// Return a DoH request for the given `name`
// Return a DoH request for IPv4 (type A) addresses of the given `name`,
// to be sent to the given DoH `endpoint`.
//
// Return none if the name is invalid.
boost::optional<Request> build_request( const std::string& name
, const Endpoint&);
boost::optional<Request> build_request_ipv4( const std::string& name
, const Endpoint&);
// Return the addresses in the answers for the given host
// in the given response.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment