Treat empty filehash the same as NULL

This commit is contained in:
Jeremy Lakeman 2013-08-28 16:15:28 +09:30
parent 8accabfcac
commit b916363b40
2 changed files with 3 additions and 3 deletions

View File

@ -281,7 +281,7 @@ int rhizome_add_manifest(rhizome_manifest *m_in,int ttl)
if (m_in->version < storedversion)
return WHY("Newer version exists");
if (m_in->version == storedversion)
return WHY("Same version of manifest exists, not adding");
return WHYF("Already have %s:%"PRId64", not adding", id, m_in->version);
break;
default:
return WHY("Select found too many rows!");

View File

@ -1520,9 +1520,9 @@ static int is_interesting(const char *id_hex, int64_t version)
if (sqlite_step_retry(&retry, statement) == SQLITE_ROW){
const char *q_filehash = (const char *) sqlite3_column_text(statement, 0);
ret=0;
if (q_filehash && !rhizome_exists(q_filehash))
if (q_filehash && *q_filehash && !rhizome_exists(q_filehash))
ret=1;
}
}
sqlite3_finalize(statement);
RETURN(ret);