| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
https://clangd.llvm.org/design/include-cleaner
Though somehow I'm all the time getting false positives for
"daemon/bindings/impl.h"
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The nghttp2 on_stream_close callback is only called for streams that are
properly closed. If we need to tear down the HTTP connection due to any
reason (e.g. IO error in underlying layer), some streams may not be
propely closed.
Due to HTTP/2 flow control, we may also wait indefinitely for the data
to be written. This can also cause the stream to never be properly
closed.
To handle these cases, a reference of allocated data is kept and we
ensure everything is freed once we're closing the http session.
|
|
|
|
| |
The practical problem was also mitigated by libuv >= 1.32.0 (2ee2d46)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To (hopefully) improve readability, rename the typical macro usage of:
if (!kr_assume(x)) y; // to
if (kr_fails_assert(x)) y;
As a convenience, replace the assert without a return value to a more
simple version:
(void)!kr_assume(x); // becomes
kr_assert(x);
|
| |
|
|
|
|
|
|
| |
Logging strings: I originally wanted to have four chars inside [],
but it doesn't really matter in these cases where logs don't happen
within a request, so "[xdp]" won due to uniformity and simplicity.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Two styles were used: (un)defined and 0/1. We switch to 0/1.
Advantage: it can be used also like `if (ENABLE_FOO)`
(outside preprocessor).
Except for ./meson.build it's sed \
-e 's/#ifdef ENABLE_CAP_NG/#if ENABLE_CAP_NG/g' \
-e 's/#ifdef ENABLE_DOH2/#if ENABLE_DOH2/g' \
-e 's/defined(ENABLE_COOKIES)/ENABLE_COOKIES/g' \
-e 's/#ifdef ENABLE_COOKIES/#if ENABLE_COOKIES/g' \
-i $(git grep -l ENABLE_)
|
| |
|
| |
|
|
|
|
| |
Fixes GET requests and handles some edge cases.
|
|
|
|
|
| |
Working server-side GET/POST HTTPS method - Proof-of-Concept
Working server-side GET/POST HTTP/2 method - WiP
|
|
|
|
|
| |
Rename "s" to "session" to be consistent with all the other
session_*() functions to make it easier to read.
|
|
|
|
|
| |
The variable name query is misleading, since the passed in packet
can actually be a response as well (or a malformed packet).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes the following assert:
daemon/worker.c:1157: qr_task_finalize: Assertion `!session_flags(source_session)->closing' failed.
Scenario which leads to the above error:
1. We're using a stateful protocol.
2. Enough data arrive in a single tcp_recv() call to put at least
two queries into the session's wire buffer.
3. session_wirebuf_process() calls worker_submit() which calls
qr_task_step().
4. In the qr_task_step() the query state changes to KR_STATE_DONE,
then qr_task_finalize() is called.
5. qr_task_send() is called, but it fails. This is where
qr_task_finalize() closes the session, but used to return no error.
6. When the next query is processed in session_wirebuf_process(),
steps 3 and 4 are followed and qr_task_finalize() is called.
7. Since the session is already closed, the assert is triggered.
Debugging this was a lot of fun... All hail the rr debugger!
|
|
|
|
|
|
|
|
|
|
| |
The trailing _t implies the type is a typedef like:
typedef struct tls_ctx {
...
} tls_ctx_t;
But it is a plain struct - so remove it to avoid confusion.
|
| |
|
|
|
|
|
| |
Long GNU GPLv3 boilderplate was automatically replaced
with machine readable tag.
|
|
|
|
| |
Calling this on every incoming UDP request could cost us up to 5% time.
|
| |
|
|
|
|
| |
... upstreams list when closing outgoing connection
|
|
|
|
| |
of estblished TCP connections even if underlying transport is UDP; fixed
|
| |
|
|
|
|
|
| |
- session: data length would be difference between start and end
indices, but the function is unused so why even have it?
|
|
|
|
|
|
| |
When decoding large packets, gnutls gives the application chunks
of size 16kb. So that tls session wirebuffer must be at least
KNOT_WIRE_MAX_PKTSIZE + 16kb. (message re-formatted by vcunat)
|
| |
|
|
|
|
| |
peer's inactivity before, now it is closed after incativity in both directions (peer->kresd, kresd->peer); prevents connection from closing before answer sent to client
|
| |
|
|
|
|
| |
redundant code; bugfixing
|
|
|
|
|
|
|
|
| |
lint:clang-scan-build reported:
> warning: The code calls sizeof() on a pointer type.
> This can produce an unexpected result
but in our case it's intentional.
(Yes, using pointers as keys in trie isn't very pretty.)
|
| |
|
|
|
|
| |
some simplifications
|
| |
|
|
|
|
| |
They don't seem to be useful individually, so why not clean up.
|
|
|
|
|
|
|
|
| |
- Some (potentially) unused vars were left behind.
- The two on_* functions are identical except for the uv types passed,
and those are surely the same in the part we use, but it's not worth
to deduplicate when these functions are only two and so simple.
- lint:c was complaining about the uv_tcp_t malloc().
|
|
|
|
|
|
| |
The support hasn't landed in libuv over all the years,
and we've been still reserving memory for it in advance.
Also comment on the singleton buffer usage.
|
|
|
|
|
|
|
|
|
| |
A quick profiling showed no change in performance,
and in particular no change in time spent in malloc/free.
Some of the types in the union differed in size by a multiple.
If their performance won't be satisfying, replacements should be
considered first (e.g. jemalloc) before rolling our own stuff.
|
|
|
|
| |
api functions
|
| |
|
| |
|
| |
|
| |
|