this is more clever sync
authorVolker Birk <vb@pep-project.org>
Mon, 08 Apr 2019 19:30:36 +0200
branchsync
changeset 34703f5f6d631953
parent 3469 ff201109d96e
child 3474 b8af3a8121c3
this is more clever
sync/cond_act_sync.yml2
sync/sync.fsm
     1.1 --- a/sync/cond_act_sync.yml2	Mon Apr 08 12:20:40 2019 +0200
     1.2 +++ b/sync/cond_act_sync.yml2	Mon Apr 08 19:30:36 2019 +0200
     1.3 @@ -37,14 +37,6 @@
     1.4      *result = t1->size == t2->size && memcmp(t1->buf, t2->buf, t1->size) == 0;
     1.5  ||
     1.6  
     1.7 -condition notMe
     1.8 -||
     1.9 -    TID_t *t1 = &session->sync_state.keysync.me;
    1.10 -    TID_t *t2 = &session->own_sync_state.me;
    1.11 -
    1.12 -    *result = t1->size != t2->size || memcmp(t1->buf, t2->buf, t1->size) != 0;
    1.13 -||
    1.14 -
    1.15  condition keyElectionWon
    1.16  ||
    1.17      pEp_identity *from = session->sync_state.common.from;
    1.18 @@ -115,14 +107,6 @@
    1.19      with "dst" > &session->own_sync_state.transaction
    1.20  }
    1.21  
    1.22 -action identifySole {
    1.23 -    call "new_UUID" with "dst" > &session->own_sync_state.me
    1.24 -    call "copy_UUID" {
    1.25 -        with "src" > &session->own_sync_state.me
    1.26 -        with "dst" > &session->sync_state.keysync.me
    1.27 -    }
    1.28 -}
    1.29 -
    1.30  function "show_handshake" {
    1.31      param "type";
    1.32      ||
     2.1 --- a/sync/sync.fsm	Mon Apr 08 12:20:40 2019 +0200
     2.2 +++ b/sync/sync.fsm	Mon Apr 08 19:30:36 2019 +0200
     2.3 @@ -61,10 +61,8 @@
     2.4  
     2.5          // handshaking without existing Device group
     2.6          state HandshakingNew {
     2.7 -            on Init {
     2.8 -                do identifySole;
     2.9 +            on Init
    2.10                  do showSoleHandshake;
    2.11 -            }
    2.12  
    2.13              // Cancel is Rollback
    2.14              on Cancel {
    2.15 @@ -89,14 +87,12 @@
    2.16  
    2.17              // Accept is Phase1Commit
    2.18              on Accept {
    2.19 -                send CommitAccept;
    2.20 +                send CommitAcceptForGroup;
    2.21                  go HandshakingNewPhase1;
    2.22              }
    2.23  
    2.24 -            on CommitAccept {
    2.25 -                if notMe
    2.26 -                    go HandshakingNewPhase1Own;
    2.27 -            }
    2.28 +            on CommitAccept
    2.29 +                go HandshakingNewPhase1Own;
    2.30          }
    2.31  
    2.32          state HandshakingNewPhase1 {
    2.33 @@ -108,9 +104,8 @@
    2.34                  go End;
    2.35              }
    2.36  
    2.37 -            on CommitAccept
    2.38 -                if notMe
    2.39 -                    go NewGroup;
    2.40 +            on CommitAcceptForGroup
    2.41 +                go NewGroup;
    2.42          }
    2.43  
    2.44          state HandshakingNewPhase1Own {
    2.45 @@ -126,8 +121,7 @@
    2.46              }
    2.47  
    2.48              on Accept
    2.49 -                if notMe
    2.50 -                    go NewGroup;
    2.51 +                go NewGroup;
    2.52          }
    2.53  
    2.54          state NewGroup {
    2.55 @@ -335,7 +329,6 @@
    2.56  
    2.57          message CommitAccept 7 {
    2.58              field TID transaction;
    2.59 -            field TID me;
    2.60          }
    2.61  
    2.62          message CommitAcceptForGroup 8 {