ENGINE-398: obvious SQL runtime errors fixed, but we need to set up an external sync dummy, and there is now a weird problem with key_reset_trust; will have to check the test case.

generate_api
Krista Bennett 5 years ago
parent fa821727e0
commit f679244164

@ -3777,6 +3777,8 @@ DYNAMIC_API PEP_STATUS _decrypt_message(
assert(status != PEP_STATUS_OK); // FIXME: FOR DEBUGGING ONLY DO NOT LEAVE IN
if (status != PEP_STATUS_OK) {
// This should really never choke unless the DB is broken.
status = PEP_UNKNOWN_DB_ERROR;
goto pep_error;
}
stringpair_list_t* curr_pair_node;
@ -3803,10 +3805,18 @@ DYNAMIC_API PEP_STATUS _decrypt_message(
goto pep_error;
}
// insert into queue
int result = session->sync_session->inject_sync_msg(reset_msg,
session->sync_session->sync_management);
if (session->messageToSend) {
status = session->messageToSend(session->sync_obj, reset_msg);
}
else if (session->sync_session->messageToSend) {
status = session->sync_session->messageToSend(session->sync_session->sync_obj,
reset_msg);
}
else {
status = PEP_SYNC_NO_MESSAGE_SEND_CALLBACK;
}
if (result == 0) {
if (status == PEP_STATUS_OK) {
// Put into notified DB
status = set_reset_contact_notified(session, curr_pair->key, msg->from->user_id);
if (status != PEP_STATUS_OK) // It's ok to barf because it's a DB problem??
@ -3814,12 +3824,10 @@ DYNAMIC_API PEP_STATUS _decrypt_message(
}
else {
// According to Volker, this would only be a fatal error, so...
status = PEP_SYNC_INJECT_FAILED; // FIXME: see what can happen here
free_message(reset_msg); // ??
reset_msg = NULL; // ??
goto pep_error;
}
free_message(reset_msg);
reset_msg = NULL;
}
}

@ -450,7 +450,7 @@ static const char *sql_was_id_for_revoke_contacted =
// We only need user_id and address, since in the main usage, we'll call update_identity
// on this anyway when sending out messages.
static const char *sql_get_last_contacted =
"select userid, address from identity where datetime('now') < datetime(timestamp, '+14 days') ; ";
"select user_id, address from identity where datetime('now') < datetime(timestamp, '+14 days') ; ";
static int user_version(void *_version, int count, char **text, char **name)
{
@ -751,7 +751,7 @@ DYNAMIC_API PEP_STATUS init(PEP_SESSION *session)
" CONSTRAINT fk_own_identity\n"
" FOREIGN KEY(own_address, own_userid)\n"
" REFERENCES identity(address, user_id)\n"
" ON DELETE CASCADE ON UPDATE CASCADE,\n"
" ON DELETE CASCADE ON UPDATE CASCADE\n"
");\n"
// list of user_ids sent revocation
"create table if not exists revocation_contact_list (\n"

@ -96,6 +96,7 @@ typedef enum {
PEP_SYNC_ILLEGAL_MESSAGE = 0x0902,
PEP_SYNC_NO_INJECT_CALLBACK = 0x0903,
PEP_SYNC_INJECT_FAILED = 0x0904,
PEP_SYNC_NO_MESSAGE_SEND_CALLBACK = 0x0905,
PEP_SEQUENCE_VIOLATED = 0x0970,
PEP_CANNOT_INCREASE_SEQUENCE = 0x0971,

Loading…
Cancel
Save