KeySync: forgotten PEP_OWN_SEQUENCE case in sequence_value
authorEdouard Tisserant <edouard@pep-project.org>
Wed, 08 Feb 2017 14:23:29 +0100
changeset 1572587649a8c216
parent 1571 e22a159b12e3
child 1573 e3c1acfac537
KeySync: forgotten PEP_OWN_SEQUENCE case in sequence_value
src/pEpEngine.c
     1.1 --- a/src/pEpEngine.c	Tue Feb 07 18:04:17 2017 +0100
     1.2 +++ b/src/pEpEngine.c	Wed Feb 08 14:23:29 2017 +0100
     1.3 @@ -2064,13 +2064,15 @@
     1.4      status = _increment_sequence_value(session, name, own);
     1.5      if (status == PEP_STATUS_OK) {
     1.6          status = _get_sequence_value(session, name, value);
     1.7 +    }
     1.8 +    if (status == PEP_STATUS_OK || status == PEP_OWN_SEQUENCE) {
     1.9          result = sqlite3_exec(session->db, "COMMIT ;", NULL, NULL, NULL);
    1.10          if (result == SQLITE_OK){
    1.11              assert(*value < INT32_MAX);
    1.12              if (*value == INT32_MAX){
    1.13                  return PEP_CANNOT_INCREASE_SEQUENCE;
    1.14              }
    1.15 -            return PEP_STATUS_OK;
    1.16 +            return status;
    1.17          } else {
    1.18              return PEP_COMMIT_FAILED;
    1.19          }