...
authorVolker Birk <vb@pep-project.org>
Thu, 19 May 2016 11:48:12 +0200
changeset 66551b2e250297a
parent 657 224eeaf88a65
child 666 4bac9007324a
...
src/sync_actions.c
sync/gen_actions_skeleton.ysl2
     1.1 --- a/src/sync_actions.c	Wed May 18 14:29:22 2016 +0200
     1.2 +++ b/src/sync_actions.c	Thu May 19 11:48:12 2016 +0200
     1.3 @@ -23,9 +23,9 @@
     1.4      PEP_STATUS status = PEP_STATUS_OK;
     1.5  
     1.6      assert(session);
     1.7 -assert(!partner);
     1.8 -if (!(session && !partner))
     1.9 -    return PEP_ILLEGAL_VALUE;
    1.10 +    assert(!partner);
    1.11 +    if (!(session && !partner))
    1.12 +        return PEP_ILLEGAL_VALUE;
    1.13  
    1.14      Beacon_t *msg = (Beacon_t *) calloc(1, sizeof(Beacon_t));
    1.15      assert(msg);
    1.16 @@ -71,9 +71,9 @@
    1.17      PEP_STATUS status = PEP_STATUS_OK;
    1.18  
    1.19      assert(session);
    1.20 -assert(partner);
    1.21 -if (!(session && partner))
    1.22 -    return PEP_ILLEGAL_VALUE;
    1.23 +    assert(partner);
    1.24 +    if (!(session && partner))
    1.25 +        return PEP_ILLEGAL_VALUE;
    1.26  
    1.27      HandshakeRequest_t *msg = (HandshakeRequest_t *) calloc(1, sizeof(HandshakeRequest_t));
    1.28      assert(msg);
    1.29 @@ -122,9 +122,9 @@
    1.30      PEP_STATUS status = PEP_STATUS_OK;
    1.31  
    1.32      assert(session);
    1.33 -assert(partner);
    1.34 -if (!(session && partner))
    1.35 -    return PEP_ILLEGAL_VALUE;
    1.36 +    assert(partner);
    1.37 +    if (!(session && partner))
    1.38 +        return PEP_ILLEGAL_VALUE;
    1.39  
    1.40      // working code
    1.41  
    1.42 @@ -153,9 +153,9 @@
    1.43      PEP_STATUS status = PEP_STATUS_OK;
    1.44  
    1.45      assert(session);
    1.46 -assert(partner);
    1.47 -if (!(session && partner))
    1.48 -    return PEP_ILLEGAL_VALUE;
    1.49 +    assert(partner);
    1.50 +    if (!(session && partner))
    1.51 +        return PEP_ILLEGAL_VALUE;
    1.52  
    1.53      // working code
    1.54  
    1.55 @@ -184,9 +184,9 @@
    1.56      PEP_STATUS status = PEP_STATUS_OK;
    1.57  
    1.58      assert(session);
    1.59 -assert(partner);
    1.60 -if (!(session && partner))
    1.61 -    return PEP_ILLEGAL_VALUE;
    1.62 +    assert(partner);
    1.63 +    if (!(session && partner))
    1.64 +        return PEP_ILLEGAL_VALUE;
    1.65  
    1.66      // working code
    1.67  
    1.68 @@ -215,9 +215,9 @@
    1.69      PEP_STATUS status = PEP_STATUS_OK;
    1.70  
    1.71      assert(session);
    1.72 -assert(!partner);
    1.73 -if (!(session && !partner))
    1.74 -    return PEP_ILLEGAL_VALUE;
    1.75 +    assert(!partner);
    1.76 +    if (!(session && !partner))
    1.77 +        return PEP_ILLEGAL_VALUE;
    1.78  
    1.79      OwnKeys_t *msg = (OwnKeys_t *) calloc(1, sizeof(OwnKeys_t));
    1.80      assert(msg);
    1.81 @@ -270,9 +270,9 @@
    1.82      PEP_STATUS status = PEP_STATUS_OK;
    1.83  
    1.84      assert(session);
    1.85 -assert(partner);
    1.86 -if (!(session && partner))
    1.87 -    return PEP_ILLEGAL_VALUE;
    1.88 +    assert(partner);
    1.89 +    if (!(session && partner))
    1.90 +        return PEP_ILLEGAL_VALUE;
    1.91  
    1.92      // working code
    1.93  
     2.1 --- a/sync/gen_actions_skeleton.ysl2	Wed May 18 14:29:22 2016 +0200
     2.2 +++ b/sync/gen_actions_skeleton.ysl2	Thu May 19 11:48:12 2016 +0200
     2.3 @@ -59,15 +59,15 @@
     2.4          choose {
     2.5              when "$partner"
     2.6              ||
     2.7 -            assert(partner);
     2.8 -            if (!(session && partner))
     2.9 -                return PEP_ILLEGAL_VALUE;
    2.10 +                assert(partner);
    2.11 +                if (!(session && partner))
    2.12 +                    return PEP_ILLEGAL_VALUE;
    2.13              ||
    2.14              otherwise
    2.15              ||
    2.16 -            assert(!partner);
    2.17 -            if (!(session && !partner))
    2.18 -                return PEP_ILLEGAL_VALUE;
    2.19 +                assert(!partner);
    2.20 +                if (!(session && !partner))
    2.21 +                    return PEP_ILLEGAL_VALUE;
    2.22              ||
    2.23          }
    2.24      }
    2.25 @@ -151,7 +151,7 @@
    2.26                  goto error;
    2.27              if (Identity_from_Struct(me, &msg->me) == NULL)
    2.28                  goto enomem;
    2.29 -
    2.30 +         `` if "parm or $name='OwnKeys'" |
    2.31           `` if "parm/partner"   |> if (Identity_from_Struct(partner, &msg->partner) == NULL)
    2.32           `` if "parm/partner"   |>> goto enomem;
    2.33           `` if "$name='OwnKeys'"|> stringlist_t *sl;
    2.34 @@ -160,7 +160,7 @@
    2.35           `` if "$name='OwnKeys'"|>> goto error;
    2.36           `` if "$name='OwnKeys'"|> if (KeyList_from_stringlist(sl, &msg->keylist) == NULL)
    2.37           `` if "$name='OwnKeys'"|>> goto enomem;
    2.38 -         `` if "parm or $name='OwnKeys'" |
    2.39 +
    2.40              return status;
    2.41  
    2.42          enomem: