Add more logging to chunking routines.

This commit is contained in:
Klaas Freitag 2013-07-31 16:26:28 +02:00
parent d9b34121ae
commit 344ea661c9
2 changed files with 13 additions and 1 deletions

View file

@ -1250,6 +1250,9 @@ static int owncloud_sendfile(csync_vio_method_handle_t *src, csync_vio_method_ha
state = hbf_splitlist(trans, fd);
file_size = trans->stat_size;
DEBUG_WEBDAV("about to send %d block", trans->block_cnt);
/* Reuse chunk info that was stored in database if existing. */
if (dav_session.chunk_info && dav_session.chunk_info->transfer_id) {
DEBUG_WEBDAV("Existing chunk info %d %d ", dav_session.chunk_info->start_id, dav_session.chunk_info->transfer_id);

View file

@ -122,6 +122,9 @@ Hbf_State hbf_splitlist(hbf_transfer_t *transfer, int fd ) {
transfer->calc_size = 0;
#endif
DEBUG_HBF("hbf_splitlist: block_size: %ld threshold: %ld st_size: %ld\n", transfer->block_size, transfer->threshold, sb.st_size );
/* calc the number of blocks to split in */
blk_size = transfer->block_size;
if (sb.st_size < transfer->threshold) {
@ -144,6 +147,9 @@ Hbf_State hbf_splitlist(hbf_transfer_t *transfer, int fd ) {
blk_size = 0;
}
DEBUG_HBF("hbf_splitlist: num_blocks: %ld rmainder: %ld blk_size: %ld\n", num_blocks, remainder, blk_size );
if( num_blocks ) {
int cnt;
int64_t overall = 0;
@ -172,7 +178,10 @@ Hbf_State hbf_splitlist(hbf_transfer_t *transfer, int fd ) {
overall += block->size;
/* store the block data into the result array in the transfer */
*((transfer->block_arr)+cnt) = block;
DEBUG_HBF("hbf_splitlist: created block %d (start: %ld size: %ld)\n", cnt, block->start, block->size );
}
#ifndef NDEBUG
transfer->calc_size = overall;
#endif
@ -269,7 +278,7 @@ static int dav_request( ne_request *req, int fd, hbf_block_t *blk ) {
if( ! (blk && req) ) return HBF_PARAM_FAIL;
ne_set_request_body_fd(req, fd, blk->start, blk->size);
/* DEBUG_HBF("HBF: Block: %d , Start: %ld and Size: %ld\n", blk->seq_number, blk->start, blk->size ); */
DEBUG_HBF("HBF: Block: %d , Start: %ld and Size: %ld\n", blk->seq_number, blk->start, blk->size );
res = ne_request_dispatch(req);
req_status = ne_get_status( req );