1. 18 Jun, 2019 1 commit
  2. 02 May, 2019 1 commit
  3. 19 Apr, 2019 1 commit
  4. 18 Apr, 2019 2 commits
    • Harris Hancock's avatar
      Fulfill AsyncPipe::tryPumpFrom() on EOF · 547bb03b
      Harris Hancock authored
      Previously if the input stream being pumped from encountered an EOF while the other side of the pipe was being pumped elsewhere, we did not fulfill the tryPumpFrom() promise, leaving it hanging.
      547bb03b
    • Kenton Varda's avatar
      Extend AsyncCapabilityStream to support sending FDs with a message. · 65b4f247
      Kenton Varda authored
      Previously, FDs could only be sent separately from data, with the underlying implementation actually sending a dummy one-byte message.
      
      For Cap'n Proto FD passing, it's better if we can attach the FDs to the RPC message they arrived with, because it avoids the need to pre-negotiate where FD passing is supported: if the sender sends FDs but the recipient doesn't arrange to receive them, the FDs will be discarded and closed automatically by the OS. Whereas, if we are sending separate one-byte messages, the recipient needs to know what to do with those.
      65b4f247
  5. 22 Jan, 2019 1 commit
  6. 10 Dec, 2018 1 commit
  7. 08 Sep, 2018 1 commit
  8. 20 Jun, 2018 1 commit
    • Kenton Varda's avatar
      Fix handling of disconnect during WebSocket::pumpTo(). · ce83d192
      Kenton Varda authored
      Before this change, if *either* the `from` or the `to` end of the pump threw a DISCONNECTED exception, we'd then try to call `to.disconnect()`. But if the exception had been thrown from `to` in the first place, then this would throw again, this time complaining about a previous write not having completed. But the whole point was always to propagate errors from the *receiving* end to the sending end. An error on the sending end should just propagate up the stack.
      ce83d192
  9. 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
  10. 07 Jun, 2018 1 commit
  11. 24 Apr, 2018 1 commit
  12. 21 Apr, 2018 2 commits
  13. 18 Apr, 2018 3 commits
    • Kenton Varda's avatar
      fixup: more size_t -> uint64_t · 3902a6c5
      Kenton Varda authored
      3902a6c5
    • Kenton Varda's avatar
    • 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
  14. 23 Feb, 2018 1 commit
  15. 26 Jan, 2018 1 commit
    • Kenton Varda's avatar
      Treat 'Premature EOF' error on async stream as DISCONNECTED. · fe3e3657
      Kenton Varda authored
      Unfortunately TCP does not always distinguish between dirty connection failure and clean connection shutdown. In practice, though, "Premature EOF" errors on streams basically always appear to be due to disconnects (including when the peer crashes).
      fe3e3657
  16. 20 Nov, 2017 1 commit
  17. 23 Sep, 2017 1 commit
  18. 22 Sep, 2017 1 commit
  19. 21 Sep, 2017 2 commits
  20. 15 Sep, 2017 3 commits
  21. 14 Sep, 2017 2 commits
  22. 12 Sep, 2017 2 commits
  23. 02 Feb, 2017 1 commit
  24. 24 Jan, 2017 3 commits
  25. 22 Jan, 2017 2 commits
  26. 01 Dec, 2016 1 commit
  27. 12 Nov, 2016 1 commit
  28. 07 Nov, 2016 1 commit