From 67a6e1b9b667817cdd840e6725ac34bb7f3f037a Mon Sep 17 00:00:00 2001 From: Andrew Bettison Date: Mon, 16 Mar 2015 22:41:52 +1030 Subject: [PATCH] Add debug logging to rhizome_write_open_journal() --- rhizome_store.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/rhizome_store.c b/rhizome_store.c index 4a13842e..25608b23 100644 --- a/rhizome_store.c +++ b/rhizome_store.c @@ -1602,16 +1602,24 @@ enum rhizome_payload_status rhizome_write_open_journal(struct rhizome_write *wri if (advance_by > 0) rhizome_manifest_set_tail(m, m->tail + advance_by); enum rhizome_payload_status status = rhizome_open_write(write, NULL, new_filesize); + if (config.debug.rhizome) + DEBUGF("rhizome_open_write() returned %s", rhizome_payload_status_message(status)); if (status == RHIZOME_PAYLOAD_STATUS_NEW && copy_length > 0) { - // note that we don't need to bother decrypting the existing journal payload + // we don't need to bother decrypting the existing journal payload enum rhizome_payload_status rstatus = rhizome_journal_pipe(write, &m->filehash, advance_by, copy_length); + if (config.debug.rhizome) + DEBUGF("rhizome_journal_pipe() returned %s", rhizome_payload_status_message(rstatus)); if (rstatus != RHIZOME_PAYLOAD_STATUS_STORED) status = RHIZOME_PAYLOAD_STATUS_ERROR; } - if (status == RHIZOME_PAYLOAD_STATUS_NEW) + if (status == RHIZOME_PAYLOAD_STATUS_NEW) { status = rhizome_write_derive_key(m, write); - if (status != RHIZOME_PAYLOAD_STATUS_NEW) + if (config.debug.rhizome) + DEBUGF("rhizome_write_derive_key() returned %s", rhizome_payload_status_message(status)); + } + if (status != RHIZOME_PAYLOAD_STATUS_NEW) { rhizome_fail_write(write); + } return status; }