]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: correct typos in doc, adjust regression test 6363/head
authorCharles-Henri Bruyand <charles-henri.bruyand@open-xchange.com>
Mon, 19 Mar 2018 12:38:57 +0000 (13:38 +0100)
committerCharles-Henri Bruyand <charles-henri.bruyand@open-xchange.com>
Mon, 19 Mar 2018 12:38:57 +0000 (13:38 +0100)
pdns/dnsdist-lua.hh
pdns/dnsdistdist/docs/reference/constants.rst
pdns/dnsdistdist/docs/rules-actions.rst
regression-tests.dnsdist/test_Advanced.py

index 97c6fb29f7a85e3f866fb2ab34acf7041634c4ac..19c5f39655502bfaa2faaa161b767416aa2c1a72 100644 (file)
@@ -24,7 +24,7 @@
 class LuaAction : public DNSAction
 {
 public:
-  typedef std::function<std::tuple<int, boost::optional<string> >(DNSQuestion* dr)> func_t;
+  typedef std::function<std::tuple<int, boost::optional<string> >(DNSQuestion* dq)> func_t;
   LuaAction(LuaAction::func_t func) : d_func(func)
   {}
   Action operator()(DNSQuestion* dq, string* ruleresult) const override;
index 5adcdd1e8f865826d8cc4c19642508807b760ffb..176bd11180a7c4ced661af65cbb5e9c6565304e8 100644 (file)
@@ -95,9 +95,9 @@ DNSResponseAction
 
 These constants represent an Action that can be returned from the functions invoked by :func:`addLuaResponseAction`.
 
- * ``DNSResponseAction.Allow``: let the query pass, skipping other rules
+ * ``DNSResponseAction.Allow``: let the response pass, skipping other rules
  * ``DNSResponseAction.Delay``: delay the response for the specified milliseconds (UDP-only), continue to the next rule
- * ``DNSResponseAction.Drop``: drop the query
+ * ``DNSResponseAction.Drop``: drop the response
  * ``DNSResponseAction.HeaderModify``: indicate that the query has been turned into a response
  * ``DNSResponseAction.None``: continue to the next rule
  * ``DNSResponseAction.ServFail``: return a response with a ServFail rcode
index d05f0b6009f0ec1ebe6ceae941c1532d9490af60..878645b0d60d6ef334d89af946dba2ebea523104 100644 (file)
@@ -152,7 +152,7 @@ Rule Generators
   This function works similar to using :func:`LuaAction`.
   The ``function`` should return both a :ref:`DNSAction` and its argument `rule`. The `rule` is used as an argument
   of the following :ref:`DNSAction`: `DNSAction.Spoof`, `DNSAction.Pool` and `DNSAction.Delay`. As of version `1.3.0`, you can
-  ommit the argument. For earlier releases, simply return an empty string. If the Lua code fails, ServFail is returned.
+  omit the argument. For earlier releases, simply return an empty string. If the Lua code fails, ServFail is returned.
 
   :param DNSRule: match queries based on this rule
   :param string function: the name of a Lua function
@@ -165,7 +165,7 @@ Rule Generators
   ::
 
     function luarule(dq)
-      if(dq.qtype==35) -- NAPTR
+      if(dq.qtype==dnsdist.NAPTR)
       then
         return DNSAction.Pool, "abuse" -- send to abuse pool
       else
@@ -184,7 +184,7 @@ Rule Generators
   Invoke a Lua function that accepts a :class:`DNSResponse`.
   This function works similar to using :func:`LuaResponseAction`.
   The ``function`` should return both a :ref:`DNSResponseAction` and its argument `rule`. The `rule` is used as an argument
-  of the `DNSResponseAction.Delay`. As of version `1.3.0`, you can ommit the argument (see :func:`addLuaAction`). For earlier
+  of the `DNSResponseAction.Delay`. As of version `1.3.0`, you can omit the argument (see :func:`addLuaAction`). For earlier
   releases, simply return an empty string. If the Lua code fails, ServFail is returned.
 
   :param DNSRule: match queries based on this rule
index 589f4e05527aff89e92e045b696717d59ecf8e82..c4ab74103d029f4146bc9fd8a6c76776d0f19760 100644 (file)
@@ -1293,7 +1293,7 @@ class TestAdvancedLuaActionReturnSyntax(DNSDistTest):
         """
         Advanced: Short syntax for LuaAction return values
         """
-        name = 'refused.advanced.tests.powerdns.com.'
+        name = 'short.refused.advanced.tests.powerdns.com.'
         query = dns.message.make_query(name, 'A', 'IN')
         response = dns.message.make_response(query)
         rrset = dns.rrset.from_text(name,