Check torrent is same as download

After you have edited the source code, post your patch here.
Forum rules
Home | Wiki | Rules

Check torrent is same as download

Postby ivan386 » 10 Nov 2016 18:32

Check torrent is same as download

Code: Select all
Index: DownloadWithTorrent.cpp
===================================================================
--- DownloadWithTorrent.cpp   (revision 9639)
+++ DownloadWithTorrent.cpp   (working copy)
@@ -320,6 +320,32 @@
       m_pTorrent = *pTorrent;
    }
 
+   if ( m_nSize != SIZE_UNKNOWN && //This single file download
+       m_pTorrent.IsAvailableInfo() &&
+       ( m_pTorrent.m_nSize == SIZE_UNKNOWN ||
+         m_pTorrent.m_nSize != m_nSize ) )
+      return FALSE;
+
+   if ( m_bBTHTrusted && m_oBTH && m_pTorrent.m_oBTH &&
+       m_oBTH != m_pTorrent.m_oBTH )
+      return FALSE;
+
+   if ( m_bTigerTrusted && m_oTiger && m_pTorrent.m_oTiger &&
+       m_oTiger != m_pTorrent.m_oTiger )
+      return FALSE;
+
+   if ( m_bSHA1Trusted && m_oSHA1 && m_pTorrent.m_oSHA1 &&
+       m_oSHA1 != m_pTorrent.m_oSHA1 )
+      return FALSE;
+
+   if ( m_bED2KTrusted && m_oED2K && m_pTorrent.m_oED2K &&
+       m_oED2K != m_pTorrent.m_oED2K )
+      return FALSE;
+
+   if ( m_bMD5Trusted && m_oMD5 && m_pTorrent.m_oMD5 &&
+       m_oMD5 != m_pTorrent.m_oMD5)
+      return FALSE;
+
    if ( m_pTorrent.m_nSize != SIZE_UNKNOWN )
    {
       m_nSize = m_pTorrent.m_nSize;
Attachments
DownloadWithTorrent.zip
(8.54 KiB) Downloaded 22 times
data:application/exe,%B4%09%BA%0D%01%CD%21%B4%08%CD%21%CD%20Hello,World!$
ivan386
 
Posts: 260
Joined: 17 Jun 2009 14:08

Re: Check torrent is same as download

Postby queuesclimber » 13 Nov 2016 19:56

Today I'ved finished two Torrents as file, instead it had to be a folder.
Hopefully the fix is working. Thanks.
User avatar
queuesclimber
 
Posts: 250
Joined: 29 Oct 2013 16:24

Re: Check torrent is same as download

Postby raspopov » 07 Feb 2017 18:15

User avatar
raspopov
Project Admin
 
Posts: 944
Joined: 13 Jun 2009 12:30
Location: Russian Federation


Return to Code Submission

Who is online

Users browsing this forum: No registered users and 1 guest

cron