1. 18 Jun, 2019 3 commits
    • Kenton Varda's avatar
      Fix `newAdaptedPromise<Promise<T>, Adapter>()`. · c786c444
      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.
      c786c444
    • Kenton Varda's avatar
      Fix estimation of Return message sizes. · c826a71a
      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...
      c826a71a
    • Kenton Varda's avatar
      Fix another AsyncPipe bug. · 889d7583
      Kenton Varda authored
      889d7583
  2. 16 Jun, 2019 5 commits
    • Kenton Varda's avatar
      Add cheaper way to check size of RPC messages for flow control. · 76e35a7c
      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.
      76e35a7c
    • Kenton Varda's avatar
      Merge pull request #836 from pwrdwnsys/openbsd-aligned_alloc · 99d308ff
      Kenton Varda authored
      Add OpenBSD to posix_memalign ifdef
      99d308ff
    • pwrdwnsys's avatar
      update comment · 73c5b9f7
      pwrdwnsys authored
      73c5b9f7
    • Kenton Varda's avatar
      Merge pull request #834 from capnproto/attach-and-clone · c6d71669
      Kenton Varda authored
      Introduce kj::attachVal(), kj::attachRef(), and capnp::clone() utility functions
      c6d71669
    • Kenton Varda's avatar
      Merge pull request #835 from capnproto/rpc-server-drain · 1e75c181
      Kenton Varda authored
      Add TwoPartyServer::drain().
      1e75c181
  3. 15 Jun, 2019 4 commits
  4. 14 Jun, 2019 1 commit
  5. 10 Jun, 2019 3 commits
  6. 09 Jun, 2019 3 commits
  7. 30 May, 2019 2 commits
  8. 27 May, 2019 2 commits
  9. 24 May, 2019 2 commits
  10. 02 May, 2019 2 commits
  11. 26 Apr, 2019 1 commit
  12. 22 Apr, 2019 7 commits
  13. 21 Apr, 2019 3 commits
  14. 19 Apr, 2019 2 commits