Skip to content

Commit

Permalink
Merge pull request #10 from finaldie/0.9
Browse files Browse the repository at this point in the history
Merge branch 0.9 into master
  • Loading branch information
finaldie committed Jan 6, 2019
2 parents 0216c7d + d2266aa commit 6e982b8
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 73 deletions.
111 changes: 57 additions & 54 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,57 @@
* 2019-01-01 0.8.3
* Upgrade `skull` to 1.4.3
* Refine python style
* 2019-01-01 0.8.2
* Upgrade `skull` to 1.4.2
* Refine code structure
* 2018-12-23 0.8.1
* Upgrade `skull` to 1.4.1
* Upgrade `proto` to proto3
* Make background service job more accurate
* 2018-08-20 0.7.3
* Upgrade `skull` to 1.3.1
* 2018-08-05 0.7.2
* Upgrade `skull` to 1.2.3
* 2018-07-25 0.7.1
* Upgrade `skull` to 1.2.2
* 2018-07-21 0.6.3
* Bug fixes and fully adopt `skull` 1.2.1
* 2018-07-21 0.6.2
* Bug fixes
* 2018-07-19 0.6.1
* Upgrade `skull` to 1.2
* 2017-08-20 0.5.1
* Upgrade `skull` to 1.1
* Support ENV variable `SKULL_DNS_NS` to override name server
* Docker Integration
* 2017-06-22 0.4.3
* Upgrade `skull` to 1.0-rc3
* 2017-06-19 0.4.2
* Fix dependency issue in ubuntu 16.04
* Add more logs for peer information
* Upgrade `skull` to 1.0-rc2
* Refine log format of response module
* 2017-01-08 0.4.1
* Optimize ranking algo
* Upgrade skull-engine to latest version
* 2016-12-18 0.3.3
* Tune the service parameters, optimize the performance
* 2016-12-18 0.3.2
* Upgrade skull-engine to 0.9.6
* 2016-12-15 0.3.1
* Upgrade skull-engine to 0.9.5
* Optimize the system performance
* Add status job and fix cleanup job errors
* Adjust latency factor to 1.05
* 2016-12-12 0.2.2
* Fix AAAA record conversion issue
* 2016-12-06 0.2.1
* Optimize AAAA record
* 2016-11-30 0.1.1
* Optimize A record
* Http latency detection
* 2016-11-16 0.1.0
* Initialization Version
- 2019-01-02 0.9.1
- Refine logs
- Upgrade `skull` to 1.5.1
- 2019-01-01 0.8.3
- Upgrade `skull` to 1.4.3
- Refine python style
- 2019-01-01 0.8.2
- Upgrade `skull` to 1.4.2
- Refine code structure
- 2018-12-23 0.8.1
- Upgrade `skull` to 1.4.1
- Upgrade `proto` to proto3
- Make background service job more accurate
- 2018-08-20 0.7.3
- Upgrade `skull` to 1.3.1
- 2018-08-05 0.7.2
- Upgrade `skull` to 1.2.3
- 2018-07-25 0.7.1
- Upgrade `skull` to 1.2.2
- 2018-07-21 0.6.3
- Bug fixes and fully adopt `skull` 1.2.1
- 2018-07-21 0.6.2
- Bug fixes
- 2018-07-19 0.6.1
- Upgrade `skull` to 1.2
- 2017-08-20 0.5.1
- Upgrade `skull` to 1.1
- Support ENV variable `SKULL_DNS_NS` to override name server
- Docker Integration
- 2017-06-22 0.4.3
- Upgrade `skull` to 1.0-rc3
- 2017-06-19 0.4.2
- Fix dependency issue in ubuntu 16.04
- Add more logs for peer information
- Upgrade `skull` to 1.0-rc2
- Refine log format of response module
- 2017-01-08 0.4.1
- Optimize ranking algo
- Upgrade skull-engine to latest version
- 2016-12-18 0.3.3
- Tune the service parameters, optimize the performance
- 2016-12-18 0.3.2
- Upgrade skull-engine to 0.9.6
- 2016-12-15 0.3.1
- Upgrade skull-engine to 0.9.5
- Optimize the system performance
- Add status job and fix cleanup job errors
- Adjust latency factor to 1.05
- 2016-12-12 0.2.2
- Fix AAAA record conversion issue
- 2016-12-06 0.2.1
- Optimize AAAA record
- 2016-11-30 0.1.1
- Optimize A record
- Http latency detection
- 2016-11-16 0.1.0
- Initialization Version
11 changes: 7 additions & 4 deletions src/modules/dns_ask/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from skull import logger
from skull.txn import Txn

from common import *
from common.proto import service_dns_query_req_pto


Expand Down Expand Up @@ -34,7 +33,7 @@ def module_release():
#
# @return - True if no error
# - False if error occurred
def module_run(txn):
def module_run(txn: Txn):
logger.debug("dns_ask module run")

sharedData = txn.data()
Expand All @@ -50,13 +49,17 @@ def module_run(txn):
if ret == Txn.IO_OK:
return True
else:
logger.error("DNS_E1", "Dns iocall failed, ret: {}".format(ret))
logger.error(
"DNS_E1", "Dns call failed, ret: {}".format(ret),
'Check the parameters')
return False


def _dns_response(txn, iostatus, api_name, request_msg, response_msg):
if iostatus != Txn.IO_OK:
logger.error("DNS_E2", "Dns response IO error: {}".format(iostatus))
logger.error(
"DNS_E2", "Dns response IO error: {}".format(iostatus),
'')
return False

sharedData = txn.data()
Expand Down
2 changes: 1 addition & 1 deletion src/modules/ranking/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def _ranking_response(txn, iostatus, api_name, request_msg, response_msg):
scoringResults, CFG_LOW_LATENCY_BAR, CFG_LATENCY_FACTOR)

logger.info(
"{Ranking}",
"Ranking",
"question: {} ,total: {} ,filtered {} ,Results: {}".format(
request_msg.question, len(scoringResults), filtered,
rankingResults))
Expand Down
2 changes: 1 addition & 1 deletion src/modules/ranking/ranking.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def rank(scoringResults, low_latency_bar, latency_factor):
rankingResults.append(scoringRecord)
else:
logger.info(
"{RankingUtil}",
"RankingUtil",
"Ranking terminated at latency: {}, factor: {}, base: {}".
format(latency, factor, baseRecordLatency))
break
Expand Down
19 changes: 7 additions & 12 deletions src/modules/response/module.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import pprint
import time

from dnslib import DNSRecord
from dnslib import QTYPE
from dnslib import RR
from dnslib import A
from dnslib import AAAA
from dnslib import AAAA, QTYPE, RR, A, DNSRecord
from skull import logger
from skull.txn import Txn

Expand Down Expand Up @@ -62,10 +58,9 @@ def module_pack(txn, txndata):
if txn.status() != Txn.TXN_OK:
logger.error(
'ModulePack',
'Error occurred, no answer for question: {} ,Peer: {}:{} {} ,type:\
{}'
.format(question, peerName, peerPort, peerType,
qtype), 'Please check previous errors/exceptions')
'no answer for question: {} ,Peer: {}:{} {} ,type: {}'.format(
question, peerName, peerPort, peerType,
qtype), 'Please check previous errors/exceptions')

# Increase error counter
module_counter.error.inc(1)
Expand Down Expand Up @@ -106,9 +101,9 @@ def module_pack(txn, txndata):
logger.info(
'ModulePack',
'Peer: {}:{} {} ,Duration: {:.3f} ms ,filtered: {} ,Question: {} '
',type: {}, {} Answers: {}'
.format(peerName, peerPort, peerType, duration, nFiltered,
question, qtype, nAnswers, ips))
',type: {}, {} Answers: {}'.format(peerName, peerPort, peerType,
duration, nFiltered, question,
qtype, nAnswers, ips))

txndata.append(bytes(answer.pack()))

Expand Down

0 comments on commit 6e982b8

Please sign in to comment.