aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWojciech Kosior <kwojtus@protonmail.com>2020-06-15 22:54:22 +0200
committerWojciech Kosior <kwojtus@protonmail.com>2020-06-15 22:54:22 +0200
commita1d391c923fae02a85a598f32c5788fbcfd57f25 (patch)
tree9569e67114e5b4f539d1661f33f90458be47b3e0 /src
parent3b7f7aa11da0ae022f66234ba5103f2878e3195d (diff)
download0tdns-a1d391c923fae02a85a598f32c5788fbcfd57f25.tar.gz
0tdns-a1d391c923fae02a85a598f32c5788fbcfd57f25.zip
give more detailed result info in responses table
Diffstat (limited to 'src')
-rwxr-xr-xsrc/perform_queries.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/perform_queries.py b/src/perform_queries.py
index fef1300..c568bf6 100755
--- a/src/perform_queries.py
+++ b/src/perform_queries.py
@@ -61,11 +61,18 @@ def resolve_call_back(mydata, status, result):
query = mydata
# debugging
print("callback called for {}".format(result.qname))
- if status==0 and result.havedata:
+ if status != 0:
+ result_info = 'internal failure: out of memory'
+ elif result.rcode == 0:
result_info = 'successful'
print("Result:",result.data.address_list)
+ elif result.rcode == 2:
+ result_info = 'no response'
+ elif result.rcode == 3:
+ result_info = 'not exists'
else:
- result_info = 'not found'
+ result_info = 'DNS error: {}'.format(result.rcode_str)
+
# write to database
try:
query.cursor.execute('''