1. 12 Jun, 2018 1 commit
    • Harris Hancock's avatar
      Add limit to readAllBytes()/readAllText() · 49b44f96
      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.
      49b44f96
  2. 18 Apr, 2018 1 commit
    • Kenton Varda's avatar
      Implement in-process byte stream pipes. · 7117175d
      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.
      7117175d
  3. 11 Jan, 2018 1 commit
    • Kenton Varda's avatar
      Replace all include guards with #pragma once. · 677a52ab
      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.
      677a52ab
  4. 11 Dec, 2017 1 commit
    • Kenton Varda's avatar
      Split time.h into time.h and timer.h. · d3278477
      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.
      d3278477
  5. 23 Sep, 2017 1 commit
  6. 22 Sep, 2017 1 commit
  7. 21 Sep, 2017 4 commits
  8. 15 Sep, 2017 2 commits
  9. 12 Sep, 2017 1 commit
  10. 02 Jun, 2017 1 commit
    • Kenton Varda's avatar
      Warn if AsyncOutputStream::write()'s result promise is unused. · b3cfd6be
      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.
      b3cfd6be
  11. 24 Jan, 2017 2 commits
  12. 01 Dec, 2016 1 commit
  13. 12 Nov, 2016 1 commit
  14. 07 Nov, 2016 1 commit
  15. 09 May, 2015 1 commit
  16. 25 Apr, 2015 1 commit
  17. 20 Apr, 2015 1 commit
  18. 19 Feb, 2015 1 commit
  19. 18 Feb, 2015 1 commit
  20. 29 Dec, 2014 1 commit
  21. 22 Nov, 2014 1 commit
  22. 20 Jun, 2014 1 commit
    • Kenton Varda's avatar
      Change license to MIT. · 889204fe
      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
      889204fe
  23. 20 May, 2014 1 commit
  24. 01 Apr, 2014 1 commit
    • Kenton Varda's avatar
      Tweak timer implementation: · 6418de1d
      Kenton Varda authored
      - Define separate times for durations vs. absolute times.
      - Make more consistent with existing precedents in KJ style.
      6418de1d
  25. 30 Mar, 2014 1 commit
  26. 05 Dec, 2013 1 commit
  27. 04 Dec, 2013 4 commits
  28. 30 Nov, 2013 1 commit
  29. 15 Nov, 2013 1 commit
  30. 12 Nov, 2013 1 commit
  31. 08 Nov, 2013 1 commit
  32. 07 Nov, 2013 1 commit