ENGINE-335: handle retvals of updated keyless To identities appropriately
authorKrista Bennett <krista@pep-project.org>
Thu, 25 Jan 2018 12:24:56 +0100
changeset 2450719ec5a51303
parent 2448 b51c2cbb5bf8
child 2451 4de19faa36b3
child 2452 43625ed353b1
child 2453 327c7fddcb8e
ENGINE-335: handle retvals of updated keyless To identities appropriately
src/message_api.c
     1.1 --- a/src/message_api.c	Thu Jan 25 02:39:57 2018 +0100
     1.2 +++ b/src/message_api.c	Thu Jan 25 12:24:56 2018 +0100
     1.3 @@ -1512,8 +1512,13 @@
     1.4          }
     1.5  
     1.6          PEP_STATUS _status = PEP_STATUS_OK;
     1.7 -        if (!is_me(session, _il->ident))
     1.8 +        if (!is_me(session, _il->ident)) {
     1.9              _status = update_identity(session, _il->ident);
    1.10 +            if (_status == PEP_CANNOT_FIND_IDENTITY) {
    1.11 +                _il->ident->comm_type = PEP_ct_key_not_found;
    1.12 +                _status = PEP_STATUS_OK;
    1.13 +            }
    1.14 +        }
    1.15          else
    1.16              _status = myself(session, _il->ident);
    1.17          if (_status != PEP_STATUS_OK) {
    1.18 @@ -1537,8 +1542,13 @@
    1.19      {
    1.20          for (_il = src->to; _il && _il->ident; _il = _il->next) {
    1.21              PEP_STATUS _status = PEP_STATUS_OK;
    1.22 -            if (!is_me(session, _il->ident))
    1.23 +            if (!is_me(session, _il->ident)) {
    1.24                  _status = update_identity(session, _il->ident);
    1.25 +                if (_status == PEP_CANNOT_FIND_IDENTITY) {
    1.26 +                    _il->ident->comm_type = PEP_ct_key_not_found;
    1.27 +                    _status = PEP_STATUS_OK;
    1.28 +                }
    1.29 +            }
    1.30              else
    1.31                  _status = myself(session, _il->ident);
    1.32              if (_status != PEP_STATUS_OK) {
    1.33 @@ -1561,8 +1571,13 @@
    1.34  
    1.35          for (_il = src->cc; _il && _il->ident; _il = _il->next) {
    1.36              PEP_STATUS _status = PEP_STATUS_OK;
    1.37 -            if (!is_me(session, _il->ident))
    1.38 +            if (!is_me(session, _il->ident)) {
    1.39                  _status = update_identity(session, _il->ident);
    1.40 +                if (_status == PEP_CANNOT_FIND_IDENTITY) {
    1.41 +                    _il->ident->comm_type = PEP_ct_key_not_found;
    1.42 +                    _status = PEP_STATUS_OK;
    1.43 +                }
    1.44 +            }
    1.45              else
    1.46                  _status = myself(session, _il->ident);
    1.47              if (_status != PEP_STATUS_OK)