Commit 5742de55 authored by Jonathan Coetzee's avatar Jonathan Coetzee

Merge remote-tracking branch 'origin' into watch_rpz

parents 6f4987b7 ef0bc449
Pipeline #44581 failed with stages
in 13 minutes and 33 seconds
Knot Resolver 3.x.y (2019-0m-dd)
================================
Bugfixes
--------
- predict module: load stats module if config didn't specify period (!755)
Knot Resolver 3.2.1 (2019-01-10)
================================
......
......@@ -253,7 +253,12 @@ int kr_rplan_pop(struct kr_rplan *rplan, struct kr_query *qry)
/* Find the query, it will likely be on top */
for (size_t i = rplan->pending.len; i > 0; i--) {
if (rplan->pending.at[i - 1] == qry) {
array_del(rplan->pending, i - 1);
/* Delete i-1 element by *sliding* the rest,
* contrary to array_del() */
for (size_t j = i; j < rplan->pending.len; ++j)
rplan->pending.at[j - 1] = rplan->pending.at[j];
array_pop(rplan->pending);
array_push(rplan->resolved, qry);
break;
}
......
......@@ -123,7 +123,10 @@ typedef array_t(struct kr_query *) kr_qarray_t;
* It also keeps a notion of current zone cut.
*/
struct kr_rplan {
kr_qarray_t pending; /**< List of pending queries. */
kr_qarray_t pending; /**< List of pending queries.
Beware: order is significant ATM,
as the last is the next one to solve,
and they may be inter-dependent. */
kr_qarray_t resolved; /**< List of resolved queries. */
struct kr_request *request; /**< Parent resolution request. */
knot_mm_t *pool; /**< Temporary memory pool. */
......
......@@ -158,7 +158,10 @@ end
function predict.config(config)
-- Reconfigure
if type(config) ~= 'table' then return end
config = config or {}
if type(config) ~= 'table' then
error('[predict] configuration must be a table or nil')
end
if config.window then predict.window = config.window end
if config.period then predict.period = config.period end
-- Load dependent modules
......
-- setup resolver
modules = { 'predict', 'stats' }
modules = { 'predict' }
-- mock global functions
local resolve_count = 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment