1. 17 Sep, 2016 1 commit
  2. 10 May, 2016 1 commit
  3. 02 Apr, 2016 1 commit
  4. 01 Apr, 2016 3 commits
  5. 26 Mar, 2016 1 commit
    • Matthew Maurer's avatar
      Fix uninitialized members of ListBuilder · 47b92d31
      Matthew Maurer authored
      Adding a `KJ_DASSERT` in the `setListPointer` logic flagged
      non-word-multiple data sections in `INLINE_COMPOSITE` lists, which
      should be impossible. This traced back to uninitialized member variables
      in `ListBuilder` in the case that it was created from a null pointer.
      47b92d31
  6. 25 Mar, 2016 4 commits
  7. 20 Mar, 2016 1 commit
    • Matthew Maurer's avatar
      Add Canonicalization · 5db2c8f8
      Matthew Maurer authored
      The user facing API is in MessageReader and MessageBuilder
      
      {MessageBuilder,MessageReader}::isCanonical verifies the canonicity of a
      message. This is both useful for debugging and for knowing if a received
      message can be used for hashes, bytewise equality, etc.
      
      MessageBuilder::canonicalRoot(Reader) can be used to write a canonical
      message on a best effort basis, and checks itself using isCanonical.
      It should succeed as long as the MessageBuilder in question:
      * Has a first segment which is long enough to contain the message
      * Has not been used before
      
      Tests have been added in canonicalize-test.c++ which verify that for
      crafted examples of canonicalization errors, isCanonical will reject,
      and for a canonicalized version of the standard test message, it will
      accept.
      5db2c8f8
  8. 13 Jan, 2016 1 commit
    • Kenton Varda's avatar
      Fix message corruption bug introduced in 2c9c5c83. · 4d4f831a
      Kenton Varda authored
      As of that change, adopting an empty struct into a pointer that already had some other value fails to overwrite the upper 32 bits of the pointer, thus resulting in a struct pointer with totally bogus bounds. Normally this will either cause a bounds check exception to be thrown when that pointer is later accessed, or lead to a struct containing bogus data (but if teh struct was expected to be empty, probably that data is never accessed).
      4d4f831a
  9. 16 Dec, 2015 1 commit
  10. 24 Jul, 2015 1 commit
  11. 23 Jul, 2015 2 commits
    • Kenton Varda's avatar
      Fix link errors. · 96e9663a
      Kenton Varda authored
      96e9663a
    • Kenton Varda's avatar
      Fix bug causing exception: "'Disembargo' of type 'senderLoopback' sent to an… · d4cd01e9
      Kenton Varda authored
      Fix bug causing exception: "'Disembargo' of type 'senderLoopback' sent to an object that does not point back to the sender."
      
      The problem happened when pipelined calls were made on a promised capability, but then that capability turned out to be null. The promise resolving code incorrectly interpreted this as the remote promise having resolved to a local capability (because the "null" stub capability looks local), and so it would send a Disembargo message to flush the pipeline as required. However, the remote end would receive this Disembargo message and find it is addressed to a null capability, not a capability pointing back to the sender. This was treated as a protocol error, causing the receiver to close the connection.
      
      The solution is to explicitly identity "null" capabilities so that we can distinguish this case. This change also has the benefit that now when you copy a null capability between messages with foo.setCap(bar.getCap()), the pointer will be set null in the destination, rather than becoming a reference to a local broken capability.
      
      Thanks to David Renshaw for narrowing this down.
      d4cd01e9
  12. 22 Jul, 2015 1 commit
  13. 08 Jul, 2015 1 commit
  14. 03 Jul, 2015 1 commit
    • Kenton Varda's avatar
      Refactor how messages are imbued with a capability table. · 5413038b
      Kenton Varda authored
      **The problem**
      
      The methods MessageReader::initCapTable() and MessageBuilder::getCapTable() always felt rather hacky. initCapTable() in particular feels like something that should be handled by the constructor. However, in practice, the cap table is often initialized based on a table encoded within the message itself. That is, an RPC message contains a "payload" which includes both the application-level message structure and a table of capabilities. The cap table has to be processed first, then initCapTable() is called on the overall message, before the application structure can safely be read.
      
      The really weird part about this is that even though the cap table only applies to one branch of the message (the payload), it is set on the *whole* MessageReader. This implies, for example, that it would be impossible to have a message that contains multiple payloads. We haven't had any need for such a thing, but an implemnetation that has such artificial limitations feels very wrong.
      
      MessageBuilder has similar issues going in the opposite direction.
      
      All of this ugliness potentially gets worse when we introduce "membranes". We want a way to intercept capabilities as they are being read from or written to an RPC payload. Currently, the only plausible way to do that is, again, to apply a transformation to all capabilities in the message. In practice it seems like this would work out OK, but it again feels wrong -- we really want to take a single Reader or Builder and "wrap" it so that transformations are applied on capabilities read/written through it.
      
      **The solution**
      
      This change fixes the problem by adding a new pointer to each struct/list Reader/Builder that tracks the current cap table. So, now a Reader or Builder for a particular sub-object can be "imbued" with a cap table without affecting any other existing Readers/Builders pointing into the same message. The cap table is inherited by child Readers/Builders obtained through the original one.
      
      This approach matches up nicely with membranes, which should make their implementation nice and clean.
      
      This change unfortunately means that Readers and Builders are now bigger, possibly with some performance impact.
      5413038b
  15. 23 Jun, 2015 1 commit
  16. 07 May, 2015 1 commit
  17. 03 May, 2015 1 commit
  18. 17 Apr, 2015 1 commit
  19. 15 Apr, 2015 1 commit
  20. 03 Apr, 2015 2 commits
  21. 01 Apr, 2015 1 commit
  22. 05 Mar, 2015 1 commit
  23. 03 Mar, 2015 1 commit
  24. 02 Mar, 2015 3 commits
  25. 29 Dec, 2014 1 commit
  26. 12 Dec, 2014 1 commit
  27. 08 Dec, 2014 1 commit
  28. 24 Nov, 2014 1 commit
    • Kenton Varda's avatar
      MSVC: All lite-mode tests pass. · ebce4aa6
      Kenton Varda authored
      The project file still only compiles a test binary, but it should be easy to separate out a library project from here.
      
      Thanks again to Bryan Boreham <bjboreham@gmail.com> for much help getting this working.
      ebce4aa6
  29. 16 Nov, 2014 1 commit
  30. 09 Nov, 2014 2 commits