Added logging around cert_save 2.0.5_p4a_log_test
authorKrista 'DarthMama' Bennett <krista@pep.foundation>
Thu, 18 Jun 2020 13:36:25 +0200
branch2.0.5_p4a_log_test
changeset 475039b0b5829e14
parent 4749 c276c93c972f
child 4751 14886c314616
Added logging around cert_save
src/pgp_sequoia.c
test/src/KeyResetMessageTest.cc
     1.1 --- a/src/pgp_sequoia.c	Wed Jun 17 19:38:23 2020 +0200
     1.2 +++ b/src/pgp_sequoia.c	Thu Jun 18 13:36:25 2020 +0200
     1.3 @@ -790,6 +790,7 @@
     1.4      char *email = NULL;
     1.5      char *name = NULL;
     1.6  
     1.7 +    T("cert_save - begin transaction for saving %s", fpr);
     1.8      sqlite3_stmt *stmt = session->sq_sql.begin_transaction;
     1.9      int sqlite_result = sqlite3_step(stmt);
    1.10      sqlite3_reset(stmt);
    1.11 @@ -797,7 +798,8 @@
    1.12          ERROR_OUT(NULL, PEP_UNKNOWN_ERROR,
    1.13                    "begin transaction failed: %s",
    1.14                    sqlite3_errmsg(session->key_db));
    1.15 -
    1.16 +                  
    1.17 +    T("cert_save - successfully began transaction for saving %s", fpr);
    1.18      pgp_fpr = pgp_cert_fingerprint(cert);
    1.19      fpr = pgp_fingerprint_to_hex(pgp_fpr);
    1.20      T("(%s, private_idents: %s)", fpr, private_idents ? "yes" : "no");
    1.21 @@ -943,16 +945,22 @@
    1.22      // Prevent ERROR_OUT from causing an infinite loop.
    1.23      if (! tried_commit) {
    1.24          tried_commit = 1;
    1.25 +        T("cert_save - about to %s transaction for saving %s", 
    1.26 +           (status == PEP_STATUS_OK ? "commit" : "roll back"), 
    1.27 +           fpr);        
    1.28          stmt = status == PEP_STATUS_OK
    1.29              ? session->sq_sql.commit_transaction
    1.30              : session->sq_sql.rollback_transaction;
    1.31          int sqlite_result = sqlite3_step(stmt);
    1.32 -        sqlite3_reset(stmt);
    1.33 +        sqlite3_reset(stmt);        
    1.34          if (sqlite_result != SQLITE_DONE)
    1.35              ERROR_OUT(NULL, PEP_UNKNOWN_ERROR,
    1.36                        status == PEP_STATUS_OK
    1.37                        ? "commit failed: %s" : "rollback failed: %s",
    1.38                        sqlite3_errmsg(session->key_db));
    1.39 +        T("cert_save - %s transaction for saving %s", 
    1.40 +           (status == PEP_STATUS_OK ? "committed" : "rolled back"), 
    1.41 +           fpr);                              
    1.42      }
    1.43  
    1.44      T("(%s) -> %s", fpr, pEp_status_to_string(status));
     2.1 --- a/test/src/KeyResetMessageTest.cc	Wed Jun 17 19:38:23 2020 +0200
     2.2 +++ b/test/src/KeyResetMessageTest.cc	Thu Jun 18 13:36:25 2020 +0200
     2.3 @@ -479,7 +479,7 @@
     2.4      m_queue.clear();
     2.5      
     2.6      message* enc_msg = NULL;
     2.7 -    mime_decode_message(inbox.c_str(), inbox.size(), &enc_msg, NULL);
     2.8 +    mime_decode_message(inbox.c_str(), inbox.size(), &enc_msg);
     2.9      
    2.10      message* dec_msg = NULL;
    2.11      stringlist_t* keylist = NULL;