From e108fe08227dc82f6c579af3498d8808f00c938d Mon Sep 17 00:00:00 2001 From: gardners Date: Mon, 3 Dec 2012 17:10:39 +1030 Subject: [PATCH] fixed bug in handling of sqlite3_blob_write(). Still more to fix. --- rhizome_fetch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rhizome_fetch.c b/rhizome_fetch.c index 6e63b78f..3ab14690 100644 --- a/rhizome_fetch.c +++ b/rhizome_fetch.c @@ -1217,7 +1217,7 @@ int rhizome_write_content(struct rhizome_fetch_slot *slot, char *buffer, int byt int ret = sqlite3_blob_open(rhizome_db, "main", "FILES", "data", slot->rowid, 1 /* read/write */, &blob); if (ret!=SQLITE_OK) return -1; ret=sqlite3_blob_write(blob, buffer, bytes, slot->file_ofs); - if (ret) { + if (ret!=SQLITE_OK) { if (debug & DEBUG_RHIZOME_RX) DEBUGF("Failed to write %d bytes to file @ offset %d", bytes, slot->file_ofs); rhizome_fetch_close(slot); @@ -1339,7 +1339,7 @@ int rhizome_received_content(unsigned char *bidprefix, RETURN(0); } else - if (1) + if (0) DEBUGF("Doesn't match this slot = 0x%p, because BIDs don't match: %s* vs %s", alloca_tohex(bidprefix,16), alloca_tohex_bid(rhizome_fetch_queues[i].active.bid));