summaryrefslogtreecommitdiffstats
path: root/daemon/main.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* daemon/main nitpick: unify exit code number handlingVladimír Čunát2019-03-081-2/+2
|
* treewide: fix flushing of messages to logs in some casesVladimír Čunát2019-03-051-2/+6
| | | | | | ... by setting FILE* properties and replace the explicit flushes. Explicit flushing couldn't be well done e.g. for lua's error() function. In particular, we had problems with journald not getting logs timely.
* lib/utils kr_straddr_split(): simplify the APIVladimír Čunát2019-02-251-6/+6
| | | | | | After 83539eb7f it was a bit complicated. It allowed to save a memcpy of the address in case no port was specified, but we only need to do the split when changing configuration, so it was overzealous optimization.
* nitpick fixes for clang-tidyVladimír Čunát2019-02-211-1/+1
|
* lua from C: unify the way we throw lua_error()Vladimír Čunát2019-02-111-0/+1
| | | | It's often a bit shorter, and it provides us with location.
* lib/utils kr_straddr_split(): tweak meaning, use moreVladimír Čunát2019-02-111-22/+9
| | | | | | Now we don't rewrite the port-splitters in command line by zero bytes. That was confusing the output of some SW showing the command-line of running kresd.
* split daemon/bindings.c fileVladimír Čunát2019-02-071-1/+0
| | | | | | | | | | | | It's now a directory, one C file for each lua table of functions. We get more total lines due to per-file copyright headers, but the original file was just too long (nearing 2k lines). The layout was inspired by the lib/cache/ split. Disadvantage: git operations (e.g. blame) will stumble on this commit. During the move, rename the "str" and "xstr" macros, too. Otherwise there are no real changes, as they would be hard to spot.
* nitpicks from lgtm.comVladimír Čunát2019-01-081-1/+1
| | | | | | The script has been unused for longer time. Almost all remaining C warnings are just "FIXME" comments :-) and I didn't touch the JS warnings.
* worker interactive mode: add TODOVladimír Čunát2019-01-071-0/+2
|
* worker interactive mode: check stdin typeVladimír Čunát2018-12-101-6/+17
| | | | | In particular, redirection from a file was leading to abort(), so we provide an error message instead.
* worker shutdown: close the leaking uv handleVladimír Čunát2018-12-101-0/+1
|
* daemon/main: work around CI lint:c problemVladimír Čunát2018-11-151-3/+11
|
* daemon: minor worker initialization fixGrigorii Demidov2018-10-121-14/+13
|
* main: locally disable a gcc warning since !672Vladimír Čunát2018-09-171-0/+4
| | | | I see no use to handle write() return codes in *this* function.
* cache: improve out-of-disk conditionVladimír Čunát2018-09-141-24/+66
| | | | | | | When suspect SIGBUS happens, print helpful error and try to remove the cache, so that the service might work again if auto-restarted. Theoretically we could longjmp() out of the SIGBUS handler, but that would be rather messy, so let the process die.
* rebrand to "Knot Resolver"Petr Špaček2018-08-141-1/+1
| | | | | | Previously we were using names "Knot DNS Resolver" and "Knot Resolver" interchangibly and the prefix "Knot DNS" was somehow confusing users. Let's see if this rebranding actually helps or not.
* doc: clarify what --quiet doesVladimír Čunát2018-02-211-1/+1
| | | | It does almost nothing, currently.
* main: fix --forks defaultVladimír Čunát2018-02-051-2/+2
| | | | | It mostly worked, just by accident. I see no use for negative initialization in this case.
* main: indentation in `parse_args()`Vladimír Čunát2018-01-311-13/+13
|
* main: fix exiting with --help etc.Vladimír Čunát2018-01-301-4/+7
|
* main: fix build without CAN_FORK_EARLYVladimír Čunát2018-01-301-1/+1
|
* Merge branch 'master'Vladimír Čunát2018-01-231-198/+189
|\
| * daemon: remove globals, split main into functionsVítězslav Kříž2018-01-231-143/+156
| |
| * keyfile argument distiguish managed and unmanaged modeVitezslav Kriz2018-01-231-68/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Arguments --keyfile, -k for managed mode and --keyfile-ro, -K for unmanaged (readonly) mode. Automatic setting based on the file permission is removed because it was confusing and could easily lead to state where automatic update does not happen because of unexpected file permissions. Check if folder is writeable was moved into Lua code. Default unmanaged keyfile path can be specified at compile time with option KEYFILE_DEFAULT. This default configuration can be disabled in configuration file with trust_anchors.keyfile_default = nil.
| * daemon/main: refactored keyfile initialization from main()Marek Vavruša2018-01-181-77/+84
| | | | | | | | | | | | | | this helps avoid false positive leaks caused by combination of cleanup functions and goto refs #291
| * daemon: fixed minor linter problemsMarek Vavruša2018-01-121-4/+4
| |
* | Merge remote-tracking branch 'origin/master' into query-traceMarek Vavruša2018-01-081-0/+1
|\|
| * daemon: reuse outbound TCP connections if possible; TLS over outbound TCP ↵Grigorii Demidov2018-01-081-0/+1
| | | | | | | | connection
* | main: close loop after it's finished to please valgrindMarek Vavruša2017-12-211-1/+5
|/ | | | also disabled priming and TA signalisation during tests
* daemon: fix a typo in SIGPIPE blockingVladimír Čunát2017-11-201-1/+1
| | | | I'm sorry. Buggy commit: 2ba2a5e8
* daemon: block SIGPIPEVladimír Čunát2017-11-131-0/+9
| | | | | | We can ignore the signal, as the affected libuv calls report error by returning EPIPE anyway. Fixes https://gitlab.labs.nic.cz/knot/knot-resolver/issues/271
* gnutls logging improvementsVladimír Čunát2017-09-121-1/+0
| | | | | | - move it to utils.c, so it's sensitive to later changes in verbosity - don't mark the lines with [tls], as they may come through libdnssec - use stdout like other verbose messages, instead of stderr (real errors)
* main ipc_activity: close and free handle on errorVitezslav Kriz2017-08-291-0/+1
|
* main ipc_activity: misc improvementsVladimír Čunát2017-08-241-14/+11
| | | | | | | | | | | | Stop IPC after getting an error. One point is the situation when one of the forks ends for some reason, which lead to problems. Another point is pipes getting out of sync. Smaller changes: - don't free the handle while it's still half-in-use - don't fully panic here because of ENOMEM, just stop IPC Fixes https://gitlab.labs.nic.cz/knot/knot-resolver/issues/150
* main ipc_activity: use goto to simplify nestingVladimír Čunát2017-08-241-32/+33
|
* daemon: check existence of config fileVladimír Čunát2017-06-261-6/+10
| | | | | ... even if rundir isn't specified. No other changes in semantics. Before this a typo in config path would pass silently.
* Make the moduledir configurable at the runtimeOndřej Surý2017-05-261-10/+18
|
* command line: specify ports via @ but remain compatibleVladimír Čunát2017-05-171-4/+7
|
* daemon: fixed memory leak and array bounds check failMarek Vavruša2017-02-281-0/+2
|
* Merge !202: trust anchor improvementsVladimír Čunát2017-02-281-3/+8
|\
| * trust anchors: improve logging of failuresVladimír Čunát2017-02-131-3/+8
| | | | | | | | | | engine_cmd() doesn't print the error() exceptions thrown from lua; it only leaves the message on lua stack.
* | Merge branch 'k_param' into 'master' Ondřej Surý2017-02-081-4/+5
|\ \ | | | | | | | | | | | | Fix -k argument processing to avoid out-of-bounds memory accesses See merge request !195
| * | Fix -k argument processing to avoid out-of-bounds memory accessesPetr Špaček2017-02-071-4/+5
| |/ | | | | | | | | | | | | Mangling of keyfile_dir and allocation of keyfile_path led to rare crashes (and Valgrind complaints). The error was introduced in 21f3a6b9d0ed3b4ae05d4d1f1612f0f277235723.
* | daemon TTY: comment nitpicksVladimír Čunát2017-02-031-2/+5
| |
* | daemon TTY: don't skip lua_settop in binary modeVladimír Čunát2017-02-031-0/+1
| | | | | | | | | | This might help if the lua command returns an unexpected number of arguments.
* | daemon TTY: use network byte order in binary outputVladimír Čunát2017-02-031-3/+5
| | | | | | | | That's to allow tunnelling the TTY to a different endian.
* | daemon TTY: remove an unused variableVladimír Čunát2017-02-031-4/+3
| |
* | daemon TTY: fix handling of bufferVladimír Čunát2017-02-031-16/+22
| | | | | | | | It was possible to write past the end of the buffer, if very unlucky.
* | kresc: improve libedit/editline based history and tab-completionŠtěpán Balážik2017-02-031-0/+2
| |
* | daemon TTY: support binary outputVladimír Čunát2017-02-031-5/+28
|/ | | | ... via "__binary" pseudocommand