[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/ktorrent/windows_port
From:       Joris Guisson <joris.guisson () gmail ! com>
Date:       2008-04-08 8:35:33
Message-ID: 1207643733.115440.24077.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 794654 by guisson:

Merged rev 794652 (torrentcreator crash with empty tracker list)

 M  +1 -0      ChangeLog  
 M  +4 -1      libbtcore/torrent/torrent.cpp  
 M  +6 -1      libbtcore/torrent/torrentcreator.cpp  


--- branches/ktorrent/windows_port/ChangeLog #794653:794654
@@ -3,6 +3,7 @@
 - Fix broken convert of blocklists
 - Ported lock file fix for NFS home directories from KDE3 version
 - When recreating files, make sure directory they are in, exists
+- Fix crash in torrent creator when there are no trackers
 
 Changes in 3.0.1 :
 - Fix sessionTTL not being able to be bigger then 99
--- branches/ktorrent/windows_port/libbtcore/torrent/torrent.cpp #794653:794654
@@ -218,7 +218,10 @@
 		if (!trackers)
 			trackers = new TrackerTier();
 		
-		trackers->urls.append(KUrl(node->data().toString(text_codec).trimmed()));
+		QString s = node->data().toString(text_codec).trimmed();
+		KUrl url(s);
+		if (s.length() > 0 && url.isValid())
+			trackers->urls.append(url);
 	}
 	
 	void Torrent::loadPieceLength(BValueNode* node)
--- branches/ktorrent/windows_port/libbtcore/torrent/torrentcreator.cpp #794653:794654
@@ -128,7 +128,12 @@
 		
 		if(!decentralized)
 		{
-			enc.write("announce"); enc.write(trackers[0]);
+			enc.write("announce"); 
+			if (trackers.count() > 0)
+				enc.write(trackers[0]);
+			else
+				enc.write("");
+			
 			if (trackers.count() > 1)
 			{
 				enc.write("announce-list");
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic