From 59817732abe2c254c2fccd55a341300b1075ddd4 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 14 Apr 2008 19:52:51 +0000 Subject: [PATCH] add more debug messages to resume's DND loader --- libtransmission/port-forwarding.c | 1 - libtransmission/resume.c | 15 ++++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/libtransmission/port-forwarding.c b/libtransmission/port-forwarding.c index 46e5e263c..18762307b 100644 --- a/libtransmission/port-forwarding.c +++ b/libtransmission/port-forwarding.c @@ -57,7 +57,6 @@ struct tr_shared tr_upnp * upnp; tr_natpmp * natpmp; - }; /*** diff --git a/libtransmission/resume.c b/libtransmission/resume.c index a424f4fc2..909405f75 100644 --- a/libtransmission/resume.c +++ b/libtransmission/resume.c @@ -119,7 +119,7 @@ loadDND( tr_benc * dict, tr_torrent * tor ) uint64_t ret = 0; tr_info * inf = &tor->info; const tr_file_index_t n = inf->fileCount; - tr_benc * list; + tr_benc * list = NULL; if( tr_bencDictFindList( dict, KEY_DND, &list ) && ( list->val.l.count == (int)n ) ) @@ -136,15 +136,24 @@ loadDND( tr_benc * dict, tr_torrent * tor ) dl[dlCount++] = i; } - if( dndCount ) + if( dndCount ) { tr_torrentInitFileDLs ( tor, dnd, dndCount, FALSE ); - if( dlCount ) + tr_tordbg( tor, "Resume file found %d files listed as dnd", dndCount ); + } + if( dlCount ) { tr_torrentInitFileDLs ( tor, dl, dlCount, TRUE ); + tr_tordbg( tor, "Resume file found %d files marked for download", dlCount ); + } tr_free( dnd ); tr_free( dl ); ret = TR_FR_PRIORITY; } + else + { + tr_tordbg( tor, "Couldn't load DND flags. dnd list (%p) has %d children; torrent has %d files", + ( list ? list->val.l.count : -1 ), (int)n ); + } return ret; }