Fixing some stock experience issues.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3999 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-10-12 12:27:32 +00:00
parent c0a14a738e
commit 1dec53821e
8 changed files with 24 additions and 13 deletions

View File

@ -375,7 +375,7 @@ bool tf_ssb_db_blob_get(tf_ssb_t* ssb, const char* id, uint8_t** out_blob, size_
return result;
}
bool tf_ssb_db_blob_store(tf_ssb_t* ssb, const uint8_t* blob, size_t size, char* out_id, size_t out_id_size)
bool tf_ssb_db_blob_store(tf_ssb_t* ssb, const uint8_t* blob, size_t size, char* out_id, size_t out_id_size, bool* out_new)
{
bool result = false;
sqlite3* db = tf_ssb_get_db(ssb);
@ -411,7 +411,7 @@ bool tf_ssb_db_blob_store(tf_ssb_t* ssb, const uint8_t* blob, size_t size, char*
printf("prepare failed: %s\n", sqlite3_errmsg(db));
}
if (rows)
if (rows && !out_new)
{
printf("blob stored %s %zd => %d\n", id, size, result);
}
@ -432,6 +432,10 @@ bool tf_ssb_db_blob_store(tf_ssb_t* ssb, const uint8_t* blob, size_t size, char*
{
snprintf(out_id, out_id_size, "%s", id);
}
if (out_new)
{
*out_new = rows != 0;
}
return result;
}