diff --git a/rhizome_database.c b/rhizome_database.c index 1dc3af00..2bab92b0 100644 --- a/rhizome_database.c +++ b/rhizome_database.c @@ -975,16 +975,11 @@ int64_t rhizome_database_create_blob_for(const char *hashhex,int64_t fileLength, sqlite3_errmsg(rhizome_db)); goto insert_row_fail; } - DEBUGF("INSERT OR REPLACE INTO FILES(id,length,highestpriority,datavalid,inserttime) VALUES('%s',%lld,%d,0,%lld);", - hashhex, (long long)fileLength, priority, (long long)gettime_ms() - ); - + sqlite3_stmt *statement = sqlite_prepare(&retry,"INSERT OR REPLACE INTO FILEBLOBS(id,data) VALUES('%s',?)",hashhex); - DEBUGF("INSERT OR REPLACE INTO FILEBLOBS(id,data) VALUES('%s',?)",hashhex); if (!statement) goto insert_row_fail; - /* Bind appropriate sized zero-filled blob to data field */ if (sqlite3_bind_zeroblob(statement, 1, fileLength) != SQLITE_OK) { WHYF("sqlite3_bind_zeroblob() failed: %s: %s", sqlite3_errmsg(rhizome_db), sqlite3_sql(statement)); diff --git a/rhizome_fetch.c b/rhizome_fetch.c index 7114680a..5494bbb2 100644 --- a/rhizome_fetch.c +++ b/rhizome_fetch.c @@ -748,8 +748,6 @@ rhizome_fetch(struct rhizome_fetch_slot *slot, rhizome_manifest *m, const struct bcopy(peersid,slot->peer_sid,SID_SIZE); bcopy(m->cryptoSignPublic,slot->bid,RHIZOME_MANIFEST_ID_BYTES); slot->bidVersion=m->version; - DEBUGF("request bid=%s, version=0x%llx", - alloca_tohex_bid(slot->bid),slot->bidVersion); slot->bidP=1; /* Don't provide a filename, because we will stream the file straight into @@ -761,7 +759,8 @@ rhizome_fetch(struct rhizome_fetch_slot *slot, rhizome_manifest *m, const struct return -1; } if (config.debug.rhizome_rx) - DEBUGF(" started fetch into %s, slot=%d filehash=%s", slot->manifest->dataFileName, slotno(slot), m->fileHexHash); + DEBUGF(" started fetch bid %s version 0x%llx into %s, slot=%d filehash=%s", + alloca_tohex_bid(slot->bid), slot->bidVersion, slot->manifest->dataFileName, slotno(slot), m->fileHexHash); return STARTED; } @@ -1003,8 +1002,8 @@ int rhizome_suggest_queue_manifest_import(rhizome_manifest *m, const struct sock static int rhizome_fetch_close(struct rhizome_fetch_slot *slot) { - // if (config.debug.rhizome_rx) - DEBUGF("close Rhizome fetch slot=%d", slotno(slot)); + if (config.debug.rhizome_rx) + DEBUGF("close Rhizome fetch slot=%d", slotno(slot)); assert(slot->state != RHIZOME_FETCH_FREE); /* close socket and stop watching it */