-
-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Python module: assign something useful to the per-query data store 'qdata' #4
Merged
wcawijngaards
merged 1 commit into
NLnetLabs:master
from
episource:dev/pythonmod-data/master
Jun 18, 2019
Merged
Python module: assign something useful to the per-query data store 'qdata' #4
wcawijngaards
merged 1 commit into
NLnetLabs:master
from
episource:dev/pythonmod-data/master
Jun 18, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Apr 30, 2018
If you are willing to accept all of the pull requests #4, #5, #6, you could also consider merging dev/all-merged/master instead: All three patches have been merged into this single branch. |
The python module used to assign None to the per-query (qdata argument) and per-module (mod_env variable) data stores. Hence, there was no obvious way for python code to use these data stores. This commit initializes both data stores with a dict instance.
wtoorop
added a commit
that referenced
this pull request
May 1, 2019
Fix test code for call change for XoT.
jedisct1
added a commit
to jedisct1/unbound
that referenced
this pull request
Jun 29, 2019
* nlnet/master: (22 commits) Nicer spelling and layout. - For NLnetLabs#45, check that 127.0.0.1 and ::1 are not used in unbound.conf when do-not-query-localhost is turned on, or at default on, unbound-checkconf prints a warning if it is found in forward-addr or stub-addr statements. - Fix memleak in unit test, reported from the clang 8.0 static analyzer. - Fix python dict reference and double free in config. - Merge PR NLnetLabs#6: Python module: support multiple instances - Merge PR NLnetLabs#5: Python module: define constant MODULE_RESTART_NEXT - Merge PR NLnetLabs#4: Python module: assign something useful to the per-query data store 'qdata' Noted in Changelog. - Added documentation to the ipset files (for doxygen output). - make depend - Fix to make unbound-control with ipset, remove unused variable, use unsigned type because of comparison, and assign null instead of compare with it. Remade lex and yacc output. - PR NLnetLabs#28: IPSet module, by Kevin Chou. Created a module to support the ipset that could add the domain's ip to a list easily. Needs libmnl, and --enable-ipset and config it, doc/README.ipset.md. - Fix to omit RRSIGs from addition to the ipset. - Fix for NLnetLabs#24: Fix abort due to scan of auth zone masters using old address from previous scan. - Fix NLnetLabs#39: In libunbound, leftover logfile is close()d unpredictably. - Master contains version 1.9.3 in development. fix segmentation fault rollback the code bugfix performance improvement edit config parser to support ipset Add support for ipset Document how to configure multiple python modules Support multiple python module instances ...
Closed
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The methods
operate
andinform_super
both have a parameter namedqdata
which is described as "per query data, here you can store your own data".However, the python module implementation passes
qdata=None
as argument value. There's no way for the python code to assign something else to the per-query data store or modifyNone
.Please consider initializing the per-query data store as
dict
(this pull request). This would allow the python module script to add custom items.The proposed patch also changes the initialization of the
mod_env
global variable fromNone
to adict
instance. Certainly,mod_env
could be omitted completely: If needed, a global variable could be created from the python module's code as well. I see no need for storing the data in the python module's internal C data structures.I've been successfully using this patch with unbound-1.6.0, 1.6.1, 1.6.4 and 1.7.0.
See also: https://www.nlnetlabs.nl/bugs-script/show_bug.cgi?id=1212
(Pull-Requests were disabled when I created this ticket)