Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jenny Ryan
ouinet
Commits
6b954814
Commit
6b954814
authored
Jul 02, 2020
by
Ivan Vilata-i-Balaguer
Browse files
Use alias for TCP endpoint type.
parent
ce905b1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/client.cpp
View file @
6b954814
...
...
@@ -675,6 +675,8 @@ Client::State::resolve_tcp_doh( const std::string& host
,
Cancel
&
cancel
,
Yield
yield
)
{
using
TcpEndpoint
=
typename
TcpLookup
::
endpoint_type
;
boost
::
string_view
portsv
(
port
);
auto
portn_o
=
parse
::
number
<
unsigned
short
>
(
portsv
);
if
(
!
portn_o
)
return
or_throw
<
TcpLookup
>
(
yield
,
asio
::
error
::
invalid_argument
);
...
...
@@ -683,7 +685,7 @@ Client::State::resolve_tcp_doh( const std::string& host
{
sys
::
error_code
e
;
auto
addr
=
asio
::
ip
::
make_address
(
host
,
e
);
if
(
!
e
)
return
TcpLookup
::
create
(
Tcp
Lookup
::
e
ndpoint
_type
{
move
(
addr
),
*
portn_o
},
host
,
port
);
if
(
!
e
)
return
TcpLookup
::
create
(
Tcp
E
ndpoint
{
move
(
addr
),
*
portn_o
},
host
,
port
);
}
// TODO: When to disable queries for IPv4 or IPv6 addresses?
...
...
@@ -735,7 +737,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
,
Tcp
Lookup
::
e
ndpoint
_type
>
eps
{
answers4
,
*
portn_o
};
AddrsAsEndpoints
<
doh
::
Answers
,
Tcp
E
ndpoint
>
eps
{
answers4
,
*
portn_o
};
return
TcpLookup
::
create
(
eps
.
begin
(),
eps
.
end
(),
host
,
port
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment