merged in sync ENGINE-596
authorKrista 'DarthMama' Bennett <krista@pep.foundation>
Fri, 15 Nov 2019 11:03:46 +0100
branchENGINE-596
changeset 418793e419537f55
parent 4186 9fbd6672b600
parent 4185 074b6139ab46
child 4188 8e4a262aa1ea
merged in sync
src/pEpEngine.h
     1.1 --- a/build-windows/pEpEngine.vcxproj.filters	Fri Nov 15 11:03:23 2019 +0100
     1.2 +++ b/build-windows/pEpEngine.vcxproj.filters	Fri Nov 15 11:03:46 2019 +0100
     1.3 @@ -215,18 +215,6 @@
     1.4      <ClInclude Include="..\src\key_reset.h">
     1.5        <Filter>Headerdateien</Filter>
     1.6      </ClInclude>
     1.7 -    <ClInclude Include="..\src\KeySync_fsm.h">
     1.8 -      <Filter>Headerdateien</Filter>
     1.9 -    </ClInclude>
    1.10 -    <ClInclude Include="..\src\sync_api.h">
    1.11 -      <Filter>Headerdateien</Filter>
    1.12 -    </ClInclude>
    1.13 -    <ClInclude Include="..\src\sync_codec.h">
    1.14 -      <Filter>Headerdateien</Filter>
    1.15 -    </ClInclude>
    1.16 -    <ClInclude Include="..\src\Sync_event.h">
    1.17 -      <Filter>Headerdateien</Filter>
    1.18 -    </ClInclude>
    1.19      <ClInclude Include="..\src\growing_buf.h">
    1.20        <Filter>Headerdateien</Filter>
    1.21      </ClInclude>
    1.22 @@ -260,6 +248,18 @@
    1.23      <ClInclude Include="..\src\etpan_mime.h">
    1.24        <Filter>Headerdateien</Filter>
    1.25      </ClInclude>
    1.26 +    <ClInclude Include="..\src\KeySync_fsm.h">
    1.27 +      <Filter>Headerdateien</Filter>
    1.28 +    </ClInclude>
    1.29 +    <ClInclude Include="..\src\sync_api.h">
    1.30 +      <Filter>Headerdateien</Filter>
    1.31 +    </ClInclude>
    1.32 +    <ClInclude Include="..\src\Sync_event.h">
    1.33 +      <Filter>Headerdateien</Filter>
    1.34 +    </ClInclude>
    1.35 +    <ClInclude Include="..\src\sync_codec.h">
    1.36 +      <Filter>Headerdateien</Filter>
    1.37 +    </ClInclude>
    1.38    </ItemGroup>
    1.39    <ItemGroup>
    1.40      <Text Include="..\LICENSE.txt" />
     2.1 --- a/src/pEpEngine.h	Fri Nov 15 11:03:23 2019 +0100
     2.2 +++ b/src/pEpEngine.h	Fri Nov 15 11:03:46 2019 +0100
     2.3 @@ -157,7 +157,7 @@
     2.4  //  parameters:
     2.5  //      ev (in)         event to free
     2.6  
     2.7 -void free_Sync_event(SYNC_EVENT ev);
     2.8 +DYNAMIC_API void free_Sync_event(SYNC_EVENT ev);
     2.9  
    2.10  
    2.11  // inject_sync_event - inject sync protocol message
    2.12 @@ -168,6 +168,10 @@
    2.13  //
    2.14  //  return value:
    2.15  //      0 if event could be stored successfully or nonzero otherwise
    2.16 +//
    2.17 +//  caveat:
    2.18 +//      if ev is SHUTDOWN then the implementation has to be synchronous
    2.19 +//      and the shutdown must be immediate
    2.20  
    2.21  typedef int (*inject_sync_event_t)(SYNC_EVENT ev, void *management);
    2.22  
     3.1 --- a/src/sync_api.c	Fri Nov 15 11:03:23 2019 +0100
     3.2 +++ b/src/sync_api.c	Fri Nov 15 11:03:46 2019 +0100
     3.3 @@ -230,6 +230,9 @@
     3.4      if (!session)
     3.5          return PEP_ILLEGAL_VALUE;
     3.6  
     3.7 +    if (session->inject_sync_event)
     3.8 +        session->inject_sync_event((void *) SHUTDOWN, NULL);
     3.9 +
    3.10      identity_list *il = NULL;
    3.11      PEP_STATUS status = own_identities_retrieve(session, &il);
    3.12      if (status)
     4.1 --- a/sync/gen_statemachine.ysl2	Fri Nov 15 11:03:23 2019 +0100
     4.2 +++ b/sync/gen_statemachine.ysl2	Fri Nov 15 11:03:46 2019 +0100
     4.3 @@ -58,7 +58,7 @@
     4.4          //      event must be valid for fsm or None
     4.5          //      in case msg is given event will be calculated out of message
     4.6  
     4.7 -        «@name»_event_t *new_«@name»_event(«yml:ucase(@name)»_PR fsm, int event, «yml:ucase(@name)» *msg);
     4.8 +        DYNAMIC_API «@name»_event_t *new_«@name»_event(«yml:ucase(@name)»_PR fsm, int event, «yml:ucase(@name)» *msg);
     4.9  
    4.10          #define «yml:ucase(@name)»_TIMEOUT_EVENT new_«@name»_event(«@name»_PR_NOTHING, 0, NULL);
    4.11  
    4.12 @@ -68,7 +68,7 @@
    4.13          //  parameters:
    4.14          //      ev (in)         event to free
    4.15  
    4.16 -        void free_«@name»_event(«@name»_event_t *ev);
    4.17 +        DYNAMIC_API void free_«@name»_event(«@name»_event_t *ev);
    4.18  
    4.19  
    4.20          #ifdef __cplusplus
    4.21 @@ -89,7 +89,7 @@
    4.22          #include "«@name»_func.h"
    4.23          `` for "fsm" | #include "«@name»_fsm.h"
    4.24  
    4.25 -        «@name»_event_t *new_«@name»_event(«yml:ucase(@name)»_PR fsm, int event, «@name»_t *msg)
    4.26 +        DYNAMIC_API «@name»_event_t *new_«@name»_event(«yml:ucase(@name)»_PR fsm, int event, «@name»_t *msg)
    4.27          {
    4.28              «@name»_event_t *ev = («@name»_event_t *) calloc(1, sizeof(«@name»_event_t));
    4.29              assert(ev);
    4.30 @@ -113,7 +113,7 @@
    4.31              return ev;
    4.32          }
    4.33  
    4.34 -        void free_«@name»_event(«@name»_event_t *ev)
    4.35 +        DYNAMIC_API void free_«@name»_event(«@name»_event_t *ev)
    4.36          {
    4.37              if (ev) {
    4.38                  free_identity_list(ev->own_identities);