- 18 Jun, 2019 7 commits
-
-
Kenton Varda authored
Note: Apparently, json.capnp had not been added to the bootstrap test, and the checked-in bootstrap had drifted from the source file.
-
Kenton Varda authored
This can be used on a method to indicate that it is used for "streaming", like: write @0 (bytes :Data) -> stream; A "streaming" method is one which is expected to be called many times to transmit an ordered stream of items. For best throughput, it is often necessary to make multiple overlapping calls, so as not to wait for a round trip for every item. However, to avoid excess buffering, it may be necessary to apply backpressure by having the client limit the total number of overlapping calls. This logic is difficult to get right at the application level, so making it a language feature gives us the opportunity to implement it in the RPC layer. We can, however, do it in a way that is backwards-compatible with implementations that don't support it. The above declaration is equivalent to: write @0 (bytes :Data) -> import "/capnp/stream.capnp".StreamResult; RPC implementations that don't explicitly support streaming can thus instead leave it up to the application to handle.
-
Kenton Varda authored
I have this pattern: Maybe<Own<T>> foo; // ... foo = heap<T>(); KJ_ASSERT_NONNULL(foo)->doSomething(); The assertion feels non-type-safe. Now you can do: auto& ref = foo.emplace(heap<T>()); ref.doSomething();
-
Kenton Varda authored
`kj::Quantity<T>` already supported this. I copied from it.
-
Kenton Varda authored
This was failing to chain the promises, and so returning `Promise<Promise<T>>`. The idea here is you can create a PromiseAdapter which eventually produces another promise to chain to. The adapter is finished and should be destroyed at that point, but the final promise should then redirect to the new promise.
-
Kenton Varda authored
Apparently, Return messages with empty capability tables have been allocated one word too small all along, causing many Return messages to be split into two segments and allocate twice the memory they need. I never bothered to check whether this was happening...
-
Kenton Varda authored
-
- 16 Jun, 2019 5 commits
-
-
Kenton Varda authored
Way back in 538a767e I added `RpcSystem::setFlowLimit()`, a blunt mechanism by which an RPC node can arrange to stop reading new messages from the connection when too many incoming calls are in-flight. This was needed to deal with buggy Sandstorm apps that would stream multi-gigabyte files by doing a zillion writes without waiting, which would then all be queued in the HTTP gateway, causing it to run out of memory. In implementing that, I inadertently caused the RPC system to do a tree walk on every call message it received, in order to sum up the message size. This is silly, becaues it's much cheaper to sum up the segment sizes. In fact, in the case of a malicious peer, the tree walk is potentially insufficient, because it doesn't count holes in the segments. The tree walk also means that any invalid pointers in the message cause an exception to be thrown even if that pointer is never accessed by the app, which isn't the usual behavior. I seem to recall this issue coming up in discussion once in the past, but I couldn't find the thread. For the new streaming feature, we'll be paying attention to the size of outgoing messages. Again, here, it would be nice to compute this size by summing segments without doing a tree walk. So, this commit adds `sizeInWords()` methods that do this.
-
Kenton Varda authored
Add OpenBSD to posix_memalign ifdef
-
pwrdwnsys authored
-
Kenton Varda authored
Introduce kj::attachVal(), kj::attachRef(), and capnp::clone() utility functions
-
Kenton Varda authored
Add TwoPartyServer::drain().
-
- 15 Jun, 2019 4 commits
-
-
Kenton Varda authored
-
Kenton Varda authored
-
Kenton Varda authored
This is frequently needed. Sandstorm had `OwnCapnp` for this purpose: https://github.com/sandstorm-io/sandstorm/blob/4d86a8144cdb43120ea12845738d0fe4a6ffcda1/src/sandstorm/util.h#L495-L525 The Workers codebase has some ad-hoc copies of this logic too, and multiple people have requested something similar on the mailing list.
-
Kenton Varda authored
This is a lot like Own<T>::attach() but for the case where you don't have a Own pointer, you just have a reference or value that you want to attach stuff to.
-
- 14 Jun, 2019 1 commit
-
-
pwrdwnsys authored
-
- 10 Jun, 2019 3 commits
-
-
Harris Hancock authored
Align HTTP entity-body delimiting rules with RFC 7230.
-
Harris Hancock authored
Skip test that fails under qemu-user, probably due to a qemu bug.
-
Kenton Varda authored
The main case where the code was wrong is when neither Content-Length nor Transfer-Encoding was provided on a response. In this case the response is delimited by closing the connection, but KJ previously rejected it outright. AFAICT almost no one on the whole internet relies on this anymore... almost.
-
- 09 Jun, 2019 3 commits
-
-
Kenton Varda authored
Fix exclusiveJoin() bug when both branches complete simultaneously.
-
Kenton Varda authored
-
Kenton Varda authored
-
- 30 May, 2019 2 commits
-
-
Kenton Varda authored
Implement FD passing in Cap'n Proto.
-
Kenton Varda authored
-
- 27 May, 2019 2 commits
-
-
Kenton Varda authored
Fix uninitialized byte arrays in encoding-test.
-
Kenton Varda authored
Initializer lists are temporaries. The code apparently works in debug mode but fails when optimized.
-
- 24 May, 2019 2 commits
-
-
Kenton Varda authored
Add support for url-safe base64 encoding
-
Joe Lee authored
-
- 02 May, 2019 2 commits
-
-
Kenton Varda authored
Fix bug in `kj::newOneWayPipe(0)`.
-
Kenton Varda authored
-
- 26 Apr, 2019 1 commit
-
-
Kenton Varda authored
Fix typos spotted by @a-robinson and update test failure messages to indicate that either testing failing could be due to OS SCM_RIGHTS truncation bug.
-
- 22 Apr, 2019 7 commits
-
-
Kenton Varda authored
-
Kenton Varda authored
-
Kenton Varda authored
-
Kenton Varda authored
-
Kenton Varda authored
-
Kenton Varda authored
-
Kenton Varda authored
-
- 21 Apr, 2019 1 commit
-
-
Kenton Varda authored
-