Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
DNS testing tools
Remoh
Commits
0ccf8a3e
Commit
0ccf8a3e
authored
Apr 17, 2020
by
Alexandre
Browse files
[DoH] New scope for the option --time
parent
a25182a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
homer.py
View file @
0ccf8a3e
...
...
@@ -241,6 +241,7 @@ class Request:
use_edns
=
use_edns
,
want_dnssec
=
want_dnssec
,
options
=
options
)
self
.
message
.
flags
|=
dns
.
flags
.
AD
# Ask for validation
self
.
ok
=
True
self
.
i
=
0
# request's number on the connection (default to the first)
def
trunc_data
(
self
):
self
.
data
=
self
.
message
.
to_wire
()
...
...
@@ -610,11 +611,7 @@ class ConnectionDoH(Connection):
self
.
receive
(
handle
)
handle
.
request
.
check_response
()
if
show_time
:
print
(
f
'
{
handle
.
request
.
i
:
3
d
}
'
,
end
=
' '
)
print
(
f
'(
{
handle
.
request
.
rcode
}
)'
,
end
=
' '
)
print
(
f
'
{
handle
.
pretime
*
1000
:
8.3
f
}
ms'
,
end
=
' '
)
print
(
f
'
{
handle
.
time
*
1000
:
8.3
f
}
ms'
,
end
=
' '
)
print
(
f
'
{
(
handle
.
time
-
handle
.
pretime
)
*
1000
:
8.3
f
}
ms'
)
self
.
print_time
(
handle
)
if
display_results
:
print
(
"Return code %s (%.2f ms):"
%
(
handle
.
request
.
rcode
,
(
handle
.
time
-
handle
.
pretime
)
*
1000
))
...
...
@@ -626,6 +623,13 @@ class ConnectionDoH(Connection):
for
handle
in
self
.
all_handles
:
self
.
read_result_handle
(
handle
)
def
print_time
(
self
,
handle
):
print
(
f
'
{
handle
.
request
.
i
:
3
d
}
'
,
end
=
' '
)
print
(
f
'(
{
handle
.
request
.
rcode
}
)'
,
end
=
' '
)
print
(
f
'
{
handle
.
pretime
*
1000
:
8.3
f
}
ms'
,
end
=
' '
)
print
(
f
'
{
handle
.
time
*
1000
:
8.3
f
}
ms'
,
end
=
' '
)
print
(
f
'
{
(
handle
.
time
-
handle
.
pretime
)
*
1000
:
8.3
f
}
ms'
)
def
do_test
(
self
,
request
,
synchronous
=
True
):
if
synchronous
:
handle
=
self
.
curl_handle
...
...
@@ -661,6 +665,8 @@ def print_result(connection, request, prefix=None, display_err=True):
size
=
request
.
response_size
if
(
dot
and
rcode
)
or
(
not
dot
and
rcode
==
200
):
if
not
monitoring
:
if
not
dot
and
show_time
:
connection
.
print_time
(
connection
.
curl_handle
)
if
display_results
and
(
not
check
or
verbose
):
print
(
msg
)
else
:
...
...
@@ -961,8 +967,8 @@ if not monitoring:
if
sync
and
not
multistreams
:
usage
(
"--sync cannot be used without --multistreams"
)
sys
.
exit
(
1
)
if
show_time
and
n
ot
multistreams
:
usage
(
"--time cannot be used with
out --multistreams
"
)
if
show_time
and
d
ot
:
usage
(
"--time cannot be used with
--dot
"
)
sys
.
exit
(
1
)
if
not
edns
and
not
no_ecs
:
usage
(
"ECS requires EDNS"
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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