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
825a182a
Commit
825a182a
authored
Jul 02, 2020
by
Ivan Vilata-i-Balaguer
Browse files
Make it explicit that DoH requests are for IPv4 addresses only.
parent
90bd9c92
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/client.cpp
View file @
825a182a
...
...
@@ -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
;
...
...
src/doh.cpp
View file @
825a182a
...
...
@@ -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
;
...
...
src/doh.h
View file @
825a182a
...
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
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