adding check for PEP_SYNC_NO_INJECT_CALLBACK keysync
authorVolker Birk <vb@pep.foundation>
Wed, 31 Aug 2016 12:51:52 +0200
branchkeysync
changeset 11053fbdd80f0e52
parent 1104 81cabcd37300
child 1106 abba29079e14
adding check for PEP_SYNC_NO_INJECT_CALLBACK
src/pEpEngine.h
src/sync_impl.c
     1.1 --- a/src/pEpEngine.h	Wed Aug 31 12:10:26 2016 +0200
     1.2 +++ b/src/pEpEngine.h	Wed Aug 31 12:51:52 2016 +0200
     1.3 @@ -75,6 +75,7 @@
     1.4  
     1.5      PEP_SYNC_NO_TRUSTWORDS_CALLBACK                 = 0x0901,
     1.6      PEP_SYNC_ILLEGAL_MESSAGE                        = 0x0902,
     1.7 +    PEP_SYNC_NO_INJECT_CALLBACK                     = 0x0903,
     1.8  
     1.9      PEP_SEQUENCE_VIOLATED                           = 0x0970,
    1.10      PEP_CANNOT_INCREASE_SEQUENCE                    = 0x0971,
     2.1 --- a/src/sync_impl.c	Wed Aug 31 12:10:26 2016 +0200
     2.2 +++ b/src/sync_impl.c	Wed Aug 31 12:51:52 2016 +0200
     2.3 @@ -64,6 +64,10 @@
     2.4      if (!(session && src))
     2.5          return PEP_ILLEGAL_VALUE;
     2.6  
     2.7 +    assert(session->inject_sync_msg);
     2.8 +    if (!session->inject_sync_msg)
     2.9 +        return PEP_SYNC_NO_INJECT_CALLBACK;
    2.10 +
    2.11      bool found = false;
    2.12      
    2.13      bloblist_t *last = NULL;