From: George Thessalonikefs Date: Thu, 11 Apr 2019 15:03:04 +0000 (+0000) Subject: - Update python documentation for init_standard(). X-Git-Tag: final-svn-state~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1150541bbfb21b4b41ce8bd57a71dc039255a36;p=thirdparty%2Funbound.git - Update python documentation for init_standard(). - Typos. git-svn-id: file:///svn/unbound/trunk@5157 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 03d613990..253a1429f 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,7 @@ +11 April 2019: George + - Update python documentation for init_standard(). + - Typos. + 11 April 2019: Wouter - Fix that auth zone uses correct network type for sockets for SOA serial probes. This fixes that probes fail because earlier diff --git a/doc/unbound.conf.5.in b/doc/unbound.conf.5.in index 0567c4d34..eff757e67 100644 --- a/doc/unbound.conf.5.in +++ b/doc/unbound.conf.5.in @@ -828,7 +828,7 @@ Can be given multiple times, for different domains. .TP .B qname\-minimisation: \fI Send minimum amount of information to upstream servers to enhance privacy. -Only sent minimum required labels of the QNAME and set QTYPE to A when +Only send minimum required labels of the QNAME and set QTYPE to A when possible. Best effort approach; full QNAME and original QTYPE will be sent when upstream replies with a RCODE other than NOERROR, except when receiving NXDOMAIN from a DNSSEC signed zone. Default is yes. diff --git a/pythonmod/doc/examples/example0-1.py b/pythonmod/doc/examples/example0-1.py index 5ae48d166..7904f73a5 100644 --- a/pythonmod/doc/examples/example0-1.py +++ b/pythonmod/doc/examples/example0-1.py @@ -1,8 +1,11 @@ - def init(id, cfg): log_info("pythonmod: init called, module id is %d port: %d script: %s" % (id, cfg.port, cfg.python_script)) return True +def init_standard(id, env): + log_info("pythonmod: init called, module id is %d port: %d script: %s" % (id, env.cfg.port, env.cfg.python_script)) + return True + def deinit(id): log_info("pythonmod: deinit called, module id is %d" % id) return True diff --git a/pythonmod/doc/examples/example0.rst b/pythonmod/doc/examples/example0.rst index 8fff41f33..693972a14 100644 --- a/pythonmod/doc/examples/example0.rst +++ b/pythonmod/doc/examples/example0.rst @@ -54,6 +54,25 @@ Script file must contain four compulsory functions: return True +.. function:: init_standard(id, env) + + Initialize module internals, like database etc. + Called just once on module load. + + *Preferred* over the init() function above as this function's signature is the + same as the C counterpart and allows for extra functionality during init. + The previously accessible configuration options can now be found in env.cfg. + + :param id: module identifier (integer) + :param env: :class:`module_env` module environment + +:: + + def init_standard(id, env): + log_info("pythonmod: init called, module id is %d port: %d script: %s" % (id, env.cfg.port, env.cfg.python_script)) + return True + + .. function:: deinit(id) Deinitialize module internals. diff --git a/pythonmod/examples/edns.py b/pythonmod/examples/edns.py index 37ce9e279..ca1bb8da7 100644 --- a/pythonmod/examples/edns.py +++ b/pythonmod/examples/edns.py @@ -78,7 +78,7 @@ def init_standard(id, env): extra functionality during init. ..note:: This function is preferred by unbound over the old init function. ..note:: The previously accessible configuration options can now be found in - env.cgf. + env.cfg. """ log_info("python: inited script {}".format(env.cfg.python_script)) diff --git a/pythonmod/examples/inplace_callbacks.py b/pythonmod/examples/inplace_callbacks.py index 776add8c2..768c2d013 100644 --- a/pythonmod/examples/inplace_callbacks.py +++ b/pythonmod/examples/inplace_callbacks.py @@ -275,7 +275,7 @@ def init_standard(id, env): ..note:: This function is preferred by unbound over the old init function. ..note:: The previously accessible configuration options can now be found in - env.cgf. + env.cfg. """ log_info("python: inited script {}".format(env.cfg.python_script)) diff --git a/util/data/msgreply.h b/util/data/msgreply.h index a455c4d2b..8d75f9b12 100644 --- a/util/data/msgreply.h +++ b/util/data/msgreply.h @@ -157,7 +157,7 @@ struct reply_info { time_t prefetch_ttl; /** - * Reply TTL extended with serve exipred TTL, to limit time to serve + * Reply TTL extended with serve expired TTL, to limit time to serve * expired message. */ time_t serve_expired_ttl;