← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 3054: Automatically mark sources of large files as bad if the full tree is not available

 

------------------------------------------------------------
revno: 3054
fixes bug: https://launchpad.net/bugs/288756
committer: eMTee <emtee11@xxxxxxxxx>
branch nick: dcplusplus
timestamp: Sat 2012-09-15 22:36:00 +0200
message:
  Automatically mark sources of large files as bad if the full tree is not available
modified:
  changelog.txt
  dcpp/QueueManager.cpp
  win32/QueueFrame.cpp


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'changelog.txt'
--- changelog.txt	2012-09-15 14:25:58 +0000
+++ changelog.txt	2012-09-15 20:36:00 +0000
@@ -40,6 +40,7 @@
 * [L#226968] Remember list sorting & splitter positions (poy)
 * [L#1041553] Fix help tooltips in Windows 8 (poy)
 * Fix GeoIP & OpenSSL problems with wide character paths (poy)
+* [L#288756] Automatically mark sources of large files as bad if the full tree is not available (emtee)
 
 -- 0.799 2012-05-05 --
 * Add icons (iceman50)

=== modified file 'dcpp/QueueManager.cpp'
--- dcpp/QueueManager.cpp	2012-07-01 18:41:13 +0000
+++ dcpp/QueueManager.cpp	2012-09-15 20:36:00 +0000
@@ -1190,6 +1190,8 @@
 	}
 }
 
+#define MAX_SIZE_WO_TREE 20*1024*1024
+
 void QueueManager::removeSource(const string& aTarget, const UserPtr& aUser, int reason, bool removeConn /* = true */) noexcept {
 	bool isRunning = false;
 	bool removeCompletely = false;
@@ -1209,7 +1211,9 @@
 
 		if(reason == QueueItem::Source::FLAG_NO_TREE) {
 			q->getSource(aUser)->setFlag(reason);
-			return;
+			if (q->getSize() < MAX_SIZE_WO_TREE) {
+				return;
+			}
 		}
 
 		if(q->isRunning() && userQueue.getRunning(aUser) == q) {

=== modified file 'win32/QueueFrame.cpp'
--- win32/QueueFrame.cpp	2012-09-15 11:49:25 +0000
+++ win32/QueueFrame.cpp	2012-09-15 20:36:00 +0000
@@ -379,6 +379,8 @@
 						tmp += T_("CRC32 inconsistency (SFV-Check)");
 					} else if(j.isSet(QueueItem::Source::FLAG_BAD_TREE)) {
 						tmp += T_("Full tree does not match TTH root");
+					} else if(j.isSet(QueueItem::Source::FLAG_NO_TREE)) {
+						tmp += T_("Full tree does not match TTH root"); /// @todo change to "No full tree available"
 					} else if(j.isSet(QueueItem::Source::FLAG_SLOW_SOURCE)) {
 						tmp += T_("Source too slow");
 					} else if(j.isSet(QueueItem::Source::FLAG_NO_TTHF)) {