These are chat archives for CZ-NIC/knot-resolver

13th
Jun 2017
Mike Emigh
@nakame_maiku_twitter
Jun 13 2017 07:18
If I'm not forking, I can use print() to display output from inside a module, but that output doesn't seem to appear if using nc -U. Is there a way I can get output to appear?
Vladimír Čunát
@vcunat
Jun 13 2017 07:25
Well, this seems a frequent source of confusion.
Mike Emigh
@nakame_maiku_twitter
Jun 13 2017 07:26
Couldn't find any examples in the existing modules of outputting any text
Vladimír Čunát
@vcunat
Jun 13 2017 07:26
I best understood these by realizing that the main process is the one backgrounded - that's still the only place where most of output appears (in its stdin and stdout).
The CLI attached over the socket gets only the results of commands, not any logs or prints.
(It's possible I'm not precise and missing some details off the top of my head.)
You can still end your command blocks e.g. by return 'foo bar' or whatever you compute in it.
BTW, it's also possible to switch to a machine-readable output of the CLI.
(new thing, not documented yet; ask if you need it ;-)
Mike Emigh
@nakame_maiku_twitter
Jun 13 2017 07:33
i think just modifying the return output is good enough for now
Vladimír Čunát
@vcunat
Jun 13 2017 08:54
knot-resolver gets names via the DNS protocol and uses them the way it gets them
it's a binary format - each label starts with its length, so the contents can (theoretically) be whatever