]> granicus.if.org Git - transmission/commitdiff
(trunk, libT) #4089: 'magnet download not verified for existing data' -- patch by...
authorJordan Lee <jordan@transmissionbt.com>
Sun, 19 Jan 2014 05:03:27 +0000 (05:03 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Sun, 19 Jan 2014 05:03:27 +0000 (05:03 +0000)
libtransmission/torrent-magnet.c
libtransmission/torrent.c
libtransmission/torrent.h

index e063071fca8d1c172d0b8cbbf6f81a1389aca632..cf91d0e013e840dc579701d7380ae03a0b22f435 100644 (file)
@@ -299,6 +299,9 @@ tr_torrentSetMetadataPiece (tr_torrent  * tor, int piece, const void  * data, in
         {
           incompleteMetadataFree (tor->incompleteMetadata);
           tor->incompleteMetadata = NULL;
+          tor->isStopping = true;
+          tor->magnetVerify = true;
+          tor->startAfterVerify = true;
         }
         else /* drat. */
         {
index f02ada4e578918d2eb4c82d0fca703408dec34ec..224721a3eba54c92d3329c611d7d20d57217ec71 100644 (file)
@@ -1873,6 +1873,14 @@ stopTorrent (void * vtor)
   torrentSetQueued (tor, false);
 
   tr_torrentUnlock (tor);
+
+  if (tor->magnetVerify)
+    {
+      tor->magnetVerify = false;
+      tr_logAddTorInfo (tor, "%s", "Magnet Verify");
+      refreshCurrentDir (tor);
+      tr_torrentVerify (tor, NULL, NULL);
+    }
 }
 
 void
@@ -1907,6 +1915,7 @@ closeTorrent (void * vtor)
 
   tr_logAddTorInfo (tor, "%s", _("Removing torrent"));
 
+  tor->magnetVerify = false;
   stopTorrent (tor);
 
   if (tor->isDeleting)
index dcaa327d351debae65ff1811f62a79a70952d482..6028d273d7113f6bf8bfc640e2de62bf55f53102 100644 (file)
@@ -247,6 +247,8 @@ struct tr_torrent
     bool                       isDirty;
     bool                       isQueued;
 
+    bool                       magnetVerify;
+
     bool                       infoDictOffsetIsCached;
 
     uint16_t                   maxConnectedPeers;