Commit graph

114 commits

Author SHA1 Message Date
R. Christian McDonald
55a28d6946
cleanup callbacks that might have been registered by Python script 2023-01-19 16:30:47 -05:00
Christian McDonald
cfd3bcb21e eliminate unnecessary Python reloading which causes memory leaks 2023-01-13 16:39:28 -05:00
W.C.A. Wijngaards
4517dcd439 - Fix python module install path detection. 2023-01-09 15:03:38 +01:00
George Thessalonikefs
4e305e644b - Complementary fix for distutils.sysconfig deprecation in Python 3.10
to commit 62c5039ab9.
2022-11-09 11:41:28 +01:00
Yorgos Thessalonikefs
c4e51a4cfe
PROXYv2 downstream support (#760) 2022-10-03 15:29:47 +02:00
W.C.A. Wijngaards
f6753a0f10 - Fix the novel ghost domain issues CVE-2022-30698 and CVE-2022-30699. 2022-08-01 13:24:40 +02:00
George Thessalonikefs
daf316ea1b - Fix #417: prefetch and ECS causing cache corruption when used
together.
2022-05-12 00:56:01 +02:00
W.C.A. Wijngaards
99a3f5ee85 - Fix pythonmod for change in iter_dp_is_useless function prototype. 2022-03-01 10:27:24 +01:00
George Thessalonikefs
f857af873e - Update ratelimit code for recent serviced_query changes and more
accurate ratelimit calculation.
2022-01-29 23:49:38 +01:00
W.C.A. Wijngaards
2921ce9e61 - Fix to make python module opt_list use opt_list_in. 2021-11-29 11:57:45 +01:00
Wouter Wijngaards
9645228f03
Merge pull request #570 from rex4539/typos
Fix typos
2021-11-29 11:39:48 +01:00
Tom Carpay
e899b4cefe Make explicit whether edns options are parsed from queries or responses 2021-11-15 13:40:51 +00:00
Dimitris Apostolou
c21d6af617
Fix typos 2021-11-13 16:56:15 +02:00
W.C.A. Wijngaards
2f828ec720 - For #519: yacc and lex. And fix python bindings, and test program
unbound-dnstap-socket.
2021-08-12 15:12:55 +02:00
W.C.A. Wijngaards
f62994f6ea - Fix #506: Python Module Seems to Leak Memory if it Experiences an
Unhandled Exception.
2021-07-02 09:42:31 +02:00
W.C.A. Wijngaards
79209823ac - Fix a number of warnings reported by the gcc analyzer. 2021-06-18 18:12:26 +02:00
George Thessalonikefs
a13d935153 - Reformat pythonmod/pythonmod_utils.{c,h}. 2021-03-22 18:45:31 +01:00
W.C.A. Wijngaards
3b24d845ff - Fix doxygen and pydoc warnings. 2021-02-18 11:39:06 +01:00
Victor Stinner
92d01d8265 Fix #426: Replace _Py_fopen() with fopen() in pythonmod.c
The private _Py_fopen() function has been removed in Python 3.10.

Fix build on Python 3.10.
2021-02-16 11:27:52 +01:00
W.C.A. Wijngaards
e0d426ebb1 - Fix for Python 3.9, no longer use deprecated functions of
PyEval_CallObject (now PyObject_Call), PyEval_InitThreads (now
  none), PyParser_SimpleParseFile (now Py_CompileString).
2021-02-09 10:38:55 +01:00
W.C.A. Wijngaards
1aa7168c6a - For #391: more double casts in python start time calculation. 2021-01-08 09:55:55 +01:00
W.C.A. Wijngaards
ee2545d939 - For #391: fix indentation. 2021-01-08 09:53:52 +01:00
W.C.A. Wijngaards
3e03e2c26d - For #391: use struct timeval* start_time for callback information. 2021-01-08 09:47:46 +01:00
Frank Riley
e3abd772f7 Add start_time to reply callbacks so modules can compute the response time. 2021-01-01 15:44:21 -07:00
W.C.A. Wijngaards
811cf6db0c - Fix missing prototypes in the code. 2020-12-11 14:34:39 +01:00
W.C.A. Wijngaards
ca39cfd6ae - Fix #333: Unbound Segmentation Fault w/ log_info Functions From
Python Mod.
2020-10-22 08:47:40 +02:00
W.C.A. Wijngaards
c8390e390d - Fix python documentation warning on functions.rst inplace_cb_reply. 2020-10-19 10:41:03 +02:00
George Thessalonikefs
d55084ea9e - Fix that if there are reply callbacks for the given rcode, those
are called per reply and a new message created if that was modified
  by the call.
- Pass the comm_reply information to the inplace_cb_reply* functions
  during the mesh state and update the documentation on that.
2020-10-15 17:17:59 +02:00
George Thessalonikefs
a912786ca9 - Update documentation in python example code. 2020-08-26 11:59:09 +02:00
W.C.A. Wijngaards
8f2b9b461b dlv removal, remove DLV references from man page and pythonmod interface. 2020-08-05 10:25:56 +02:00
W.C.A. Wijngaards
c0c722cd97 DLV removal 2020-08-04 09:05:09 +02:00
Torbjörn Lönnemark
9af8080f2b Fix python module len() implementations
They were all missing the 'self.' prefix when accessing the 'obj'
instance variable, causing the following exception when attempting to
call len() on (for example) a ReplyInfo_RRSet:

  File "/usr/lib/python3.7/site-packages/unboundmodule.py", line 377, in __len__
    def __len__(self): return obj.rrset_count
NameError: name 'obj' is not defined
2020-07-22 03:13:00 +02:00
W.C.A. Wijngaards
8833d44d01 - Fix python examples/calc.py for eval, reported by X41 D-Sec. 2019-11-20 15:07:09 +01:00
W.C.A. Wijngaards
d3b3d64ef3 - Remove warning about unknown cast-function-type warning pragma. 2019-08-16 12:52:58 +02:00
W.C.A. Wijngaards
78b2f1cc20 - Fix python dict reference and double free in config. 2019-06-18 17:25:08 +02:00
W.C.A. Wijngaards
63b2628a18 Merge branch 'dev/all-merged/master' of git://github.com/episource/unbound into episource-dev/all-merged/master 2019-06-18 17:07:57 +02:00
W.C.A. Wijngaards
310396190b - Fix #31: swig 4.0 and python module. 2019-05-16 11:06:01 +02:00
George Thessalonikefs
d1150541bb - Update python documentation for init_standard().
- Typos.


git-svn-id: file:///svn/unbound/trunk@5157 be551aaa-1e26-0410-a405-d3ace91eadb9
2019-04-11 15:03:04 +00:00
Wouter Wijngaards
4eac399dfd - Fix #17: Add python module example from Jan Janak, that is a
plugin for the Unbound DNS resolver to resolve DNS records in
  multicast DNS [RFC 6762] via Avahi.


git-svn-id: file:///svn/unbound/trunk@5151 be551aaa-1e26-0410-a405-d3ace91eadb9
2019-04-08 14:34:58 +00:00
Philipp Serr
efb3697332 Merge branch 'dev/pythonmod-multi-instance/v1.9.0' into dev/all-merged/master 2019-03-02 14:35:19 +01:00
Philipp Serr
56a174bb0f Merge branch 'dev/pythonmod-data/v1.9.0' into dev/all-merged/master 2019-03-02 14:34:58 +01:00
Philipp Serr
b248654aab Support multiple python module instances
This commit adds proper support for multiple instances of the python
module: When more than one instance is added to the module list, the
first instance loads the first script specified in the `python:`
configuration section. The second instance loads the second script,
and so on.

When there are more module instances in the module list than there are
scripts in the `python:` section, an error is raised during
initialization and unbound won't start. When more scripts than module
instances are provided, the surplus scripts are ignored.
2019-03-02 14:32:48 +01:00
Philipp Serr
7cc4ff05ad Initialize per-query qdata and per-module mod_env
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.
2019-03-02 09:26:57 +01:00
Philipp Serr
b4a9031cdb Add module_restart_next definition to swig file 2019-03-02 09:25:14 +01:00
Wouter Wijngaards
a62c1135fe - Remove memory leak on pythonmod python2 script file init.
- Remove swig gcc8 python function cast warnings, they are ignored.


git-svn-id: file:///svn/unbound/trunk@5127 be551aaa-1e26-0410-a405-d3ace91eadb9
2019-02-28 09:12:54 +00:00
Wouter Wijngaards
ba0cad0bc3 Fixup for python 2
git-svn-id: file:///svn/unbound/trunk@5126 be551aaa-1e26-0410-a405-d3ace91eadb9
2019-02-27 14:22:55 +00:00
Wouter Wijngaards
7c1f9699d8 - Fix for python module on Windows, fix fopen.
git-svn-id: file:///svn/unbound/trunk@5125 be551aaa-1e26-0410-a405-d3ace91eadb9
2019-02-27 14:14:08 +00:00
Wouter Wijngaards
079253670e - Fix pythonmod include and sockaddr_un ifdefs for compile on
Windows, and for libunbound.


git-svn-id: file:///svn/unbound/trunk@5118 be551aaa-1e26-0410-a405-d3ace91eadb9
2019-02-20 15:19:58 +00:00
Wouter Wijngaards
438634b718 nicer python error log errors.
git-svn-id: file:///svn/unbound/trunk@4970 be551aaa-1e26-0410-a405-d3ace91eadb9
2018-11-22 13:47:37 +00:00
Wouter Wijngaards
d21cb609a8 - review fixes for python module.
git-svn-id: file:///svn/unbound/trunk@4969 be551aaa-1e26-0410-a405-d3ace91eadb9
2018-11-22 13:31:21 +00:00