1. 17 Mar, 2020 2 commits
    • Dominik Charousset's avatar
      Make sure BASP nodes agree on a single connection · 83c43935
      Dominik Charousset authored
      This change fixes a race on the routing tables when spinning up multiple
      connections between two nodes simultaneously. With 2 nodes A and B, this
      is the sequence causing an error:
      
      - A publish an actor on port x.
      - A publish an actor on port y.
      - B connects to A:x with connection handle b1.
      - B connects to A:y with connection handle b2.
      - A sees a new connection handle a1 for the connection to A:x.
      - A writes server handshake A:x.
      - A reads client handshake A:x, adds (B, a1) to the routing table.
      - A sees a new connection handle a2 for the connection to A:y.
      - A writes server handshake A:y.
      - A reads client handshake A:y and drops it.
      - B reads server handshake on b2 and adds (A, b2) to the routing table.
      - B reads server handshake on b1 and closes the redundant connection.
      
      After that point, B uses the connection `a2 <-> b2`. However, the server
      believes `a1 <-> b1` is the active connection. When receiving data via
      `a2`, the server has no mapping for the handle in its routing table.
      Consequently, it cannot attribute incoming data on this connection to
      node B.
      
      To fix this dilemma, this change adds additional steps:
      
      - The server now adds *all* connection handles to its routing table. The
        first handle is going to be the default route. However, additional
        handles get added as alternatives. When receiving data on any of these
        sockets, the server is able to attribute it to right node ID.
      - The client dictates which connection gets used. After reading the
        server handshake and setting a direct route to the server, the client
        repeats its handshake with the new select connection flag.
      - When the server receives a handshake where the select connection flag
        is set, it updates it routing table to have the node ID resolve to the
        right connection handle.
      
      This patch is backwards compatible. Older versions of CAF in the network
      simply ignore the unrecognized flag.
      83c43935
    • Dominik Charousset's avatar
      Send client handshake immediately · 8f4e5b99
      Dominik Charousset authored
      (cherry picked from commit f3c6d319)
      8f4e5b99
  2. 06 Mar, 2020 4 commits
  3. 29 Feb, 2020 8 commits
  4. 28 Feb, 2020 3 commits
  5. 25 Feb, 2020 1 commit
  6. 22 Feb, 2020 3 commits
  7. 08 Feb, 2020 1 commit
  8. 04 Feb, 2020 2 commits
  9. 03 Feb, 2020 2 commits
  10. 02 Feb, 2020 2 commits
  11. 30 Jan, 2020 2 commits
  12. 25 Jan, 2020 3 commits
  13. 24 Jan, 2020 1 commit
    • Dominik Charousset's avatar
      Suppress flag and compiler setup in subdir mode · a94f6b2e
      Dominik Charousset authored
      Avoid touching compiler flags if CAF builds as a sub directory of
      another CMake project. Further, check whether the parent project has
      already select an OpenSSL version for us and use that rather than trying
      to locate it ourselves.
      a94f6b2e
  14. 23 Jan, 2020 3 commits
  15. 22 Jan, 2020 2 commits
    • Dominik Charousset's avatar
      Merge pull request #1026 · 03b3e669
      Dominik Charousset authored
      03b3e669
    • Dominik Charousset's avatar
      Add to_strings for enum back to the repository · 0626e714
      Dominik Charousset authored
      Using a code generator that requires compiling a C++ tool breaks when
      crosscompiling CAF. It can also interact badly with projects that
      include CAF as a submodule.
      
      As a compromise between easy consumption / integration of CAF and
      maintainability of the `to_string` implementations, this set of changes
      adds two new targets to CMake:
      - `check-consistency` runs the code generator and checks whether all
        files in the repository are still up-to-date. We can run this target
        automatically in our CI to fail builds that introduce inconsistencies.
      - `update-enum-strings` runs the code generator to replace the files in
        the source tree. This is meant for CAF developers to update `.cpp`
        files after changing enum headers.
      
      Both new targets are excluded from `ALL` in CMake and thus do not run
      automatically.
      0626e714
  16. 20 Jan, 2020 1 commit