- 12 Jun, 2018 1 commit
-
-
Harris Hancock authored
Reading an unbounded amount of data from a stream is a potential DoS vector. To manage this risk, readAllText() and readAllBytes() now accept a `limit` parameter. For source backwards-compatibility, this limit defaults to kj::maxValue.
-
- 18 Apr, 2018 1 commit
-
-
Kenton Varda authored
This lets you construct an AsyncInputStream / AsyncOutputStream pair that operates entirely within userspace, rather than pushing through a kernel-level pipe. This is far more efficient, avoiding system calls and reducing copies. The pipe does not buffer at all. Instead, it waits for both a read() and a write() call to be active at the same time, and then it fulfills one with the other. This implementation also optimizes pumps. Imagine the situation: you create a pipe; you call pumpTo() on the write end to pump it to some other; then you write to the write end of the pipe. In this case, the write will *directly* call the target stream to which the pipe is being pumped. Hence, adding daisy-chained pipes on top of a final output stream does not incur additional copies of the data. Similarly, tryPumpFrom() is optimized on the read end.
-
- 11 Jan, 2018 1 commit
-
-
Kenton Varda authored
@kloepper pointed out a while back that every compiler you've ever heard of supports this. Plus, it's more concise, it's not prone to copy-paste errors, and it looks nicer. At the time I wanted to remain consistent and I didn't feel like spending the time to update all my existing code. But, every time I've added a new header since I've cursed the include guard, so I finally broke down and changed it.
-
- 11 Dec, 2017 1 commit
-
-
Kenton Varda authored
timer.h takes the place of the old time.h, while time.h itself has been pared down to only non-async-related stuff. Since async-io.h includes timer.h, I suspect no one will be broken by this change. I could have instead moved the non-async parts of time.h into a new header to avoid any possibility of breakage, but time.h is the correct name for the core header, and timer.h is the correct name for the async parts (the Timer class)... so I'm risking it.
-
- 23 Sep, 2017 1 commit
-
-
Kenton Varda authored
-
- 22 Sep, 2017 1 commit
-
-
Kenton Varda authored
This un-breaks code which previously relied upon an implicit cast from AutoCloseFd to int to call the non-ownership-passing versions of the methods.
-
- 21 Sep, 2017 4 commits
-
-
Kenton Varda authored
-
Kenton Varda authored
-
Kenton Varda authored
-
Kenton Varda authored
This allows a lot of nice design patterns, and might later the the basis for capnp 3-party handoff within a machine.
-
- 15 Sep, 2017 2 commits
-
-
Kenton Varda authored
-
Kenton Varda authored
-
- 12 Sep, 2017 1 commit
-
-
Kenton Varda authored
-
- 02 Jun, 2017 1 commit
-
-
Kenton Varda authored
It turns out that, quite often, the write() will have already completed before the method returns, hence dropping the returned promise won't cause any apparent problem -- until you try to write() a sufficiently large value that it doesn't complete on the first call. Then, you get mysterious bugs. Indeed, it turns out the HTTP library has such bugs, which are fixed in this change.
-
- 24 Jan, 2017 2 commits
-
-
Kenton Varda authored
- AsyncInputStream::tryGetLength() can report the amount of data the stream will produce. Useful for implementing HTTP Content-Length header. - AsyncInputStream::pumpTo() copies data from an input stream to an output stream, using double-dispatch to find an optimal approach.
-
Kenton Varda authored
-
- 01 Dec, 2016 1 commit
-
-
Kenton Varda authored
-
- 12 Nov, 2016 1 commit
-
-
Kenton Varda authored
The implementation used by AsyncStreamFd was simply calling the general tryRead(), so why not?
-
- 07 Nov, 2016 1 commit
-
-
Kenton Varda authored
-
- 09 May, 2015 1 commit
-
-
David Renshaw authored
-
- 25 Apr, 2015 1 commit
-
-
David Renshaw authored
-
- 20 Apr, 2015 1 commit
-
-
Kenton Varda authored
-
- 19 Feb, 2015 1 commit
-
-
Kenton Varda authored
-
- 18 Feb, 2015 1 commit
-
-
Jason Paryani authored
This is analagous to shutdownWrite, but for the read end of the stream
-
- 29 Dec, 2014 1 commit
-
-
Kenton Varda authored
-
- 22 Nov, 2014 1 commit
-
-
Kenton Varda authored
This prevents the compiler from reporting warnings in these headers while compiling application code. Hopefully this will stem the never-ending stream of complaints from people who enable pedantic warnings.
-
- 20 Jun, 2014 1 commit
-
-
Kenton Varda authored
For portions currently copyright by Kenton (most of it), transfer copyright to Sandstorm Development Group, Inc. (Kenton's company). The license change is practically meaningless, as MIT and BSD 2-clause are legally equivalent. However, the BSD 2-clause license is sometimes confused for its ugly siblings, BSD 3-clause and BSD 4-clause. The MIT license is more immediately recognizeable for what it is. Rémy Blank and Jason Choy (the two non-trivial contributors) are on record as approving this change: https://groups.google.com/d/msg/capnproto/xXDd2HUOCcc/gbe_COIuXKYJ
-
- 20 May, 2014 1 commit
-
-
Kenton Varda authored
-
- 01 Apr, 2014 1 commit
-
-
Kenton Varda authored
- Define separate times for durations vs. absolute times. - Make more consistent with existing precedents in KJ style.
-
- 30 Mar, 2014 1 commit
-
-
Remy Blank authored
-
- 05 Dec, 2013 1 commit
-
-
Kenton Varda authored
-
- 04 Dec, 2013 4 commits
-
-
Kenton Varda authored
-
Kenton Varda authored
Split AsyncIoProvider into high-level and low-level interfaces, so that alternate EventPort implementations can implement the low-level interface and reuse the higher-level stuff.
-
Kenton Varda authored
-
Kenton Varda authored
Overhaul the way EventLoop is specialized so that it's possible to hook up to an existing event loop infrastructure that is not KJ-aware. This also makes the async IO API more dependency-injection-friendly.
-
- 30 Nov, 2013 1 commit
-
-
Kenton Varda authored
-
- 15 Nov, 2013 1 commit
-
-
Kenton Varda authored
kj::runIoEventLoop() is a shortcut for setting up an EventLoop that can do I/O, without specifying a platform-specific EventLoop.
-
- 12 Nov, 2013 1 commit
-
-
Kenton Varda authored
-
- 08 Nov, 2013 1 commit
-
-
Kenton Varda authored
Implement two-party network. The first RPC call over a socket took place at 2013-11-08 14:46:43 -0800 and completed successfully.
-
- 07 Nov, 2013 1 commit
-
-
Kenton Varda authored
-