forked from cory/tildefriends
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:
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user