The "portable bytecode" produced by luajit isn't compatible when
(lib)luajit version changes or when some build-time configuration of it
changes. If you mix these up, kresd fails to start.
Vladimír Čunát [Tue, 29 Nov 2016 14:07:48 +0000 (15:07 +0100)]
hints: allow removing hints
Fixes #111.
Compatibility: it needs a new libkres.so function. If a wrong version
combination is attempted, the module just cleanly fails to load, though
it writes a slightly confusing message "no such file or directory".
Vladimír Čunát [Tue, 29 Nov 2016 10:35:22 +0000 (11:35 +0100)]
Merge !76: add EDNS(0) padding support
RFC7830 padding support on client->resolver DNSoverTLS communication.
Adds new `net.tls_padding([padding])` option that will cause the answers
to be aligned at *padding* boundaries.
Vladimír Čunát [Thu, 24 Nov 2016 08:56:16 +0000 (09:56 +0100)]
Merge !77: lua: embed bytecode instead of stripped source
It seems a bit cleaner, though impact on size and load speed should not
be noticeable. We simply install most of the lua code, as before, and I
assume that we *do* want to keep that visibility, at least by default.
Suggested on !57.
- Drop all make dependencies, so it's only generated when the file
goes missing (i.e. was explicitly deleted).
- Add checks into the generator to avoid producing empty strings on
failures. It compiled correctly and wasn't easy to debug.
- Drop all make dependencies, so it's only generated when the file
goes missing (i.e. was explicitly deleted).
- Add checks into the generator to avoid producing empty strings on
failures. It compiled correctly and wasn't easy to debug.
Vladimír Čunát [Mon, 14 Nov 2016 13:54:15 +0000 (14:54 +0100)]
lua: embed bytecode instead of stripped source
It seems a bit cleaner, though impact on size and load speed should not
be noticeable. We simply install most of the lua code, as before, and I
assume that we *do* want to keep that visibility, at least by default.
Suggested on !57.
Vladimír Čunát [Mon, 14 Nov 2016 07:13:03 +0000 (08:13 +0100)]
Merge branch 'lua-ffi-structs' into 'master'
lua ffi bindings: fix incorrect structs
Some structures have changed but lua was still using the old ABI.
I think no our lua code used the fields misplaced due to this,
except an example in documentation.
I didn't check much of the ABI in there. I wish I knew some
(half-)automatic way how to do that.
Ondřej Surý [Sat, 12 Nov 2016 09:13:54 +0000 (10:13 +0100)]
Merge branch 'allow_to_set_hostname' into 'master'
Allow to override hostname() with a lua call hostname("example.com")
This changes lua hostname() call to accept optional parameter with new hostname. This is needed to override possibly wrong name used for ephemeral certs.
Vladimír Čunát [Tue, 8 Nov 2016 18:24:28 +0000 (19:24 +0100)]
lua ffi bindings: fix incorrect structs
Some structures have changed but lua was still using the old ABI.
I think no our lua code used the fields misplaced due to this,
except an example in documentation.
I didn't check much of the ABI in there. I wish I knew some
(half-)automatic way how to do that.
Vladimír Čunát [Tue, 8 Nov 2016 16:02:43 +0000 (17:02 +0100)]
layer: refactor and better describe the API
- The API and ABI for modules changes slightly (details below).
KR_MODULE_API is bumped to avoid loading incompatible code.
We have bumped libkres ABIVER since the last release 1.1.1,
so leaving that one intact.
- Make KR_STATE_YIELD not reuse 0 value anymore.
It's easy to e.g. return kr_ok() by mistake.
- struct kr_layer_t:
* ::mm was unused, uninitialized, etc.
* Make ::state an int, as it was everywhere else.
* void *data was ugly and always containing struct kr_request *
- struct kr_layer_api:
* Drop the void* parameter from ::begin, as it was only used
for the request which is available as ctx->req anyway
(formerly ctx->data).
* Drop ::fail. It wasn't even called. Modules can watch for
KR_STATE_FAIL in ::finish.
- Document the apparent meaning of the layer interface, deduced mainly
from the way it's used in the code. Caveats:
* enum knot_layer_state handling seems to assume that it holds exactly
one of the possibilities at a time. The cookie module does NOT
follow that (intentionally), apparently depending on the exact
implementation of the handling at that moment. It feels fragile.
* I was unable to deduce a plausible description of when ::reset is
called. It's practically unused in modules, too.
Vladimír Čunát [Wed, 2 Nov 2016 10:17:23 +0000 (11:17 +0100)]
Merge branch 'p/lru-rebased' into 'master'
lru: new implementation and also interface
The implementation is now a hybrid, slightly described at top of `lib/generic/lru.h`. Also the API is changed a bit, leading to slight simplification of our use patterns. (EDITED)
Vladimír Čunát [Wed, 31 Aug 2016 15:21:47 +0000 (17:21 +0200)]
lru: new implementation and also interface
The implementation is now similar to set-associative caches
that x86 CPU use. Also the API is changed a bit, leading to
slight simplification of our use patterns.
Ondřej Surý [Tue, 18 Oct 2016 07:39:10 +0000 (09:39 +0200)]
Dynamically resolve SONAME for libknot and libzscanner from Makefile
and set libknot_SONAME and libzscanner_SONAME as lua literals.
Remove now obsolete libpath lua function - use find_soname from
platform.mk to define <arg>_SONAME, add lua_pushliteral to
daemon/engine.c and add -D to daemon/daemon.mk for any new library
loaded from Lua.
Based on [issue 28](https://github.com/CZ-NIC/knot-resolver/issues/28), we were able to boost kresd performance running in a Docker container on DockerCloud by nearly 100% by binding to a single interface:ipaddress. It might be handy for other users to know.
Ondřej Surý [Mon, 3 Oct 2016 11:15:52 +0000 (13:15 +0200)]
Merge branch 'p/net.listen' into 'master'
net.listen: make it more flexible
As noted in #94, it feels natural to call it like:
``net.listen({net.lo, '192.168.1.1'})``
Also minor fixes were done in that function and corresponding docs.
Vladimír Čunát [Wed, 7 Sep 2016 12:46:16 +0000 (14:46 +0200)]
net.listen: make it more flexible
As noted in #94, it feels natural to call it like:
``net.listen({net.lo, '192.168.1.1'})``
Also, minor fixes were done in that function and corresponding docs.