12122017-01-27 19:53:00 +0100Python module: assign something useful to the per-query data store 'qdata'2018-05-02 11:09:25 +0200111Unclassifiedunboundserver1.7.0AllAllASSIGNEDhttps://github.com/NLnetLabs/unbound/pull/4P5enhancement---1nlnetlabs.bugtrackerunbound-teamcathyageorgeoldest_to_newest36020nlnetlabs.bugtracker2017-01-27 19:53:54 +0100The methods `operate` and `inform_super` both have a parameter named `qdata` which is described as "per query data, here you can store your own data".
However, the python module implementation passes `None` as argument value. There's no way for the python code to assign something else to the per-query data store or modify `None`.
Please consider initializing the per-query data store as `dict`. This would allow the python module script to add custom items.
@github I've prepared a possible patch. Please have a look at: https://github.com/episource/unbound/compare/9a7dfb16f205907413db80eb126c98c08620cef8...episource:dev/pythonmod-data/main
The proposed patch also changes the initialization of the `mod_env` global variable from `None` to a `dict` instance. Certainly, `mod_env` could be ommited completly: 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.36981nlnetlabs.bugtracker2017-03-12 14:59:52 +0100Diff url has changed. The diff against current master can be found here:
https://github.com/episource/unbound/compare/master...episource:dev/pythonmod-data/master71612nlnetlabs.bugtracker2018-05-01 13:20:39 +0200I've created a github pull request for this: https://github.com/NLnetLabs/unbound/pull/471623george2018-05-02 11:09:25 +0200Hi episource,
We are willing to merge your code to unbound's source.
Currently we are releasing 1.7.1, so this code after internal review will be headed for the next release (probably 1.7.2).
Thanks for the contribution!
Best regards,
George