... sync
authorVolker Birk <vb@pep-project.org>
Thu, 21 Mar 2019 12:12:09 +0100
branchsync
changeset 3362a90c5e2081c3
parent 3361 323772b6b855
child 3363 9095efc623dd
...
src/message_api.c
sync/gen_statemachine.ysl2
     1.1 --- a/src/message_api.c	Wed Mar 20 19:55:42 2019 +0100
     1.2 +++ b/src/message_api.c	Thu Mar 21 12:12:09 2019 +0100
     1.3 @@ -3284,7 +3284,6 @@
     1.4          identity_list **private_il
     1.5      )
     1.6  {
     1.7 -    
     1.8      assert(session);
     1.9      assert(src);
    1.10      assert(dst);
    1.11 @@ -3858,22 +3857,19 @@
    1.12          char *sync_fpr = NULL;
    1.13          PEP_STATUS tmpstatus = base_extract_message(session, msg, &size, &data, &sync_fpr);
    1.14          if (!tmpstatus && size && data) {
    1.15 -        //    if ((*keylist && strcasecmp(msg->from->fpr, (*keylist)->value))
    1.16 -        //            || (sync_fpr && strcasecmp(msg->from->fpr, sync_fpr))) {
    1.17 -                pEp_identity *_from = identity_dup(msg->from);
    1.18 -                if (!_from) {
    1.19 -                    free_message(*dst);
    1.20 -                    *dst = NULL;
    1.21 -                    free_stringlist(*keylist);
    1.22 -                    *keylist = NULL;
    1.23 -                    free(sync_fpr);
    1.24 -                    return PEP_OUT_OF_MEMORY;
    1.25 -                }
    1.26 -                if (session->sync_state.common.from)
    1.27 -                    free_identity(session->sync_state.common.from);
    1.28 -                session->sync_state.common.from = _from;
    1.29 -                signal_Sync_message(session, *rating, data, size, sync_fpr);
    1.30 -        //    }
    1.31 +            pEp_identity *_from = identity_dup(msg->from);
    1.32 +            if (!_from) {
    1.33 +                free_message(*dst);
    1.34 +                *dst = NULL;
    1.35 +                free_stringlist(*keylist);
    1.36 +                *keylist = NULL;
    1.37 +                free(sync_fpr);
    1.38 +                return PEP_OUT_OF_MEMORY;
    1.39 +            }
    1.40 +            if (session->sync_state.common.from)
    1.41 +                free_identity(session->sync_state.common.from);
    1.42 +            session->sync_state.common.from = _from;
    1.43 +            signal_Sync_message(session, *rating, data, size, sync_fpr);
    1.44          }
    1.45          free(sync_fpr);
    1.46      }
     2.1 --- a/sync/gen_statemachine.ysl2	Wed Mar 20 19:55:42 2019 +0100
     2.2 +++ b/sync/gen_statemachine.ysl2	Thu Mar 21 12:12:09 2019 +0100
     2.3 @@ -929,7 +929,7 @@
     2.4                  default:
     2.5                      // ignore events not handled here
     2.6                      «../@name»_SERVICE_LOG("ignoring event", KeySync_event_name(event));
     2.7 -                    break;
     2.8 +                    return invalid_event;
     2.9              }
    2.10              break;
    2.11