Skip to content

Commit c81be47

Browse files
author
cfp
committed
magnet download not verified for existing data fixed #4089
1 parent 8f69610 commit c81be47

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

libtransmission/torrent-magnet.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,10 @@ tr_torrentSetMetadataPiece( tr_torrent * tor, int piece, const void * data, in
299299
{
300300
incompleteMetadataFree( tor->incompleteMetadata );
301301
tor->incompleteMetadata = NULL;
302-
if( tor->preFetchMagnet ) tor->isStopping = true;
302+
tor->isStopping = true;
303+
tor->magnetVerify = true;
304+
tor->startAfterVerify = !tor->preFetchMagnet;
305+
tor->preFetchMagnet = false;
303306
}
304307
else /* drat. */
305308
{

libtransmission/torrent.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1967,6 +1967,12 @@ stopTorrent( void * vtor )
19671967
torrentSetQueued( tor, false );
19681968

19691969
tr_torrentUnlock( tor );
1970+
1971+
if( tor->magnetVerify ) {
1972+
tor->magnetVerify = false;
1973+
tr_torinf( tor, "Magnet Verify" );
1974+
tr_torrentVerify( tor );
1975+
}
19701976
}
19711977

19721978
void
@@ -2043,6 +2049,7 @@ closeTorrent( void * vtor )
20432049

20442050
tr_torinf( tor, "%s", _( "Removing torrent" ) );
20452051

2052+
tor->magnetVerify = false;
20462053
stopTorrent( tor );
20472054

20482055
if( tor->isDeleting )

libtransmission/torrent.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@ struct tr_torrent
250250
bool isDirty;
251251
bool isQueued;
252252

253+
bool magnetVerify;
254+
253255
bool infoDictOffsetIsCached;
254256

255257
uint16_t maxConnectedPeers;

0 commit comments

Comments
 (0)