- May 25, 2021
-
-
Tomas Krizek authored
-
Tomas Krizek authored
-
Tomas Krizek authored
-
Tomas Krizek authored
-
Tomas Krizek authored
-
Tomas Krizek authored
-
Tomas Krizek authored
-
Tomas Krizek authored
-
Tomas Krizek authored
-
Tomas Krizek authored
-
Tomas Krizek authored
-
Tomas Krizek authored
-
Tomas Krizek authored
-
Tomas Krizek authored
-
Tomas Krizek authored
-
Tomas Krizek authored
These macros should replace the use of assert() in our entire codebase. assert() have the following issues: - can be turned off at compilation time - they don't have consistent meaning in our code kr_require() behaves similarly to assert - it checks a condition and aborts if it fails. Unlike asserts, these aren't turned off by using -DNDEBUG. kr_require() should be used for non-recoverable errors. kr_assume() is a way to check for non-fatal errors which supports error reporing, debugging and recovery. The function returns a boolean value which the caller must use for error handling. An error log message is produced when the condition fails. Optionally, when kr_debug_assumption is set to true, the process will use fork() and the child will abort(). This generates a coredump for debugging purposes, while allowing the parent process to keep running and recover from the non-fatal error. This can be useful for debugging hard to reproduce errors in production environments.
-
- May 24, 2021
-
-
Tomas Krizek authored
-
Tomas Krizek authored
-
Tomas Krizek authored
-
Tomas Krizek authored
-
Tomas Krizek authored
-
Tomas Krizek authored
Technically, we return an actual lua table instead of this pretty-printed representation, but I chose it to be consistent with the rest of the docs.
-
Tomas Krizek authored
Add HTTP headers to an optional kr_request.qsource.headers structure. Headers are stored as name, value string pairs. The following snippet can be used to access the headers in lua modules: ``` if (req.qsource.headers ~= nil) then for i = 1, tonumber(req.qsource.headers.len) do local name = ffi.string(req.qsource.headers.at[i - 1].name) local value = ffi.string(req.qsource.headers.at[i - 1].value) print(name, value) end end ``` Fixes #616
-
Tomas Krizek authored
- Apr 19, 2021
-
-
Vladimír Čunát authored
-
Vladimír Čunát authored
I see no potential use for `set`; it's not a suitable abstraction. And for `get` we want to use a pointer to the public type instead of the private one. Overall, worker.h has way too many stuff, but this branch is not a good place to clean it up.
-
- Apr 16, 2021
-
-
This can happen for example when we want to send an answer, but the http stream (or the connection?) is already closed. Direct leak of 48 byte(s) in 1 object(s) allocated from: #0 0x7f5ad2445459 in __interceptor_malloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x55c0db3fc442 in http_write_pkt ../daemon/http.c:610 #2 0x55c0db3fc882 in http_write ../daemon/http.c:651 #3 0x55c0db3e9bb1 in qr_task_send ../daemon/worker.c:700 #4 0x55c0db3ee86c in qr_task_finalize ../daemon/worker.c:1321 #5 0x55c0db3f0123 in qr_task_step ../daemon/worker.c:1633 #6 0x55c0db3f0982 in worker_submit ../daemon/worker.c:1755 #7 0x55c0db3d992a in session_wirebuf_process ../daemon/session.c:759 #8 0x55c0db3c5f01 in udp_recv ../daemon/io.c:89 #9 0x7f5ad22b0e0e (/usr/lib/libuv.so.1+0x20e0e)
-
The on_frame_recv() callback ins't guaranteed to be called by nghttp2. This can happen e.g. in a case when nghttp2 issues a PROTOCOL_ERROR RST_STREAM frame. Previously, it would leave the connection in a stream-processing state, making it completely useless. While this guarantees a cleanup will be called eventually, some streams may still get ignored due to the order of various callbacks and data processing procedures. Still, it's better than the previous implementation.
-
- Apr 14, 2021
-
-
libknot >= 2.9 provides it and their version is less buggy :-) In particular, it works with unaligned pointers.
-
- Mar 30, 2021
-
-
Tomas Krizek authored
This reverts commit 4079a1a9, reversing changes made to a900fdbf.
-
Tomas Krizek authored
This reverts commit 4dab349e, reversing changes made to 4bcf335d.
-
Tomas Krizek authored
This reverts commit 99e6e754, reversing changes made to 65bed85f.
-
- Mar 15, 2021
-
-
Tomas Krizek authored
-
- Mar 12, 2021
-
-
Lukas Jezek authored
-
Lukas Jezek authored
-
- Mar 09, 2021
-
-
Lukas Jezek authored