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

Also use endpoint template argument in addrs->endpoints conversion.

In case someone wants to extract the class template and use it e.g. for UDP
parent aafcdafe
......@@ -633,11 +633,11 @@ Client::State::fetch_via_self( Rq request, const UserAgentMetaData& meta
return Session::create(move(con), cancel, yield);
// Transforms addresses to TCP endpoints with the given port.
template<class Addrs>
// Transforms addresses to endpoints with the given port.
template<class Addrs, class Endpoint>
class AddrsAsEndpoints {
using value_type = TcpLookup::endpoint_type;
using value_type = Endpoint;
using addrs_iterator = typename Addrs::const_iterator;
AddrsAsEndpoints(const Addrs& addrs, unsigned short port)
......@@ -735,7 +735,7 @@ Client::State::resolve_tcp_doh( const std::string& host
answers4.insert( answers4.end()
, std::make_move_iterator(answers6.begin())
, std::make_move_iterator(answers6.end()));
AddrsAsEndpoints<doh::Answers> eps{answers4, *portn_o};
AddrsAsEndpoints<doh::Answers, TcpLookup::endpoint_type> eps{answers4, *portn_o};
return TcpLookup::create(eps.begin(), eps.end(), host, port);
Supports Markdown
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