rev 9279 - in kde-extras/ktorrent/branches/experimental/debian: . patches

Modestas Vainius modax-guest at alioth.debian.org
Tue Feb 5 00:39:38 UTC 2008


Author: modax-guest
Date: 2008-02-05 00:39:37 +0000 (Tue, 05 Feb 2008)
New Revision: 9279

Added:
   kde-extras/ktorrent/branches/experimental/debian/patches/03_trunk_pull_r769910.diff
Modified:
   kde-extras/ktorrent/branches/experimental/debian/changelog
   kde-extras/ktorrent/branches/experimental/debian/patches/series
Log:
Pull ktorrent trunk to fix socket leak bug. ktorrent 3.0~rc1+ is usable again.

Modified: kde-extras/ktorrent/branches/experimental/debian/changelog
===================================================================
--- kde-extras/ktorrent/branches/experimental/debian/changelog	2008-02-05 00:37:49 UTC (rev 9278)
+++ kde-extras/ktorrent/branches/experimental/debian/changelog	2008-02-05 00:39:37 UTC (rev 9279)
@@ -28,6 +28,9 @@
       system.
     - 02_kclosestnodessearch_cleanup.dif - cleanup unused variable. Endless
       loop is fixed in 3.0rc1.
+    - 03_trunk_pull_r769910.diff - pull trunk up to revision 769910. Version
+      bump related changes skipped. This patch should fix socket leak which
+      made ktorrent almost unusable for more than 20 minutes.
   * Add "DM-Upload-Allowed: yes" to debian/control source section.
   * Tweak overrides.lintian by adding "libktcore2 libktupnp1" to
     package-name-doesnt-match-sonames. These libraries are supposed to be used
@@ -43,7 +46,7 @@
       (Closes: #459241).
   * Update debian/copyright.
 
- -- Debian KDE Extras Team <pkg-kde-extras at lists.alioth.debian.org>  Mon, 04 Feb 2008 11:40:01 +0200
+ -- Debian KDE Extras Team <pkg-kde-extras at lists.alioth.debian.org>  Mon, 04 Feb 2008 22:51:29 +0200
 
 ktorrent (2.2.4.dfsg.1-1) unstable; urgency=medium
 

Added: kde-extras/ktorrent/branches/experimental/debian/patches/03_trunk_pull_r769910.diff
===================================================================
--- kde-extras/ktorrent/branches/experimental/debian/patches/03_trunk_pull_r769910.diff	                        (rev 0)
+++ kde-extras/ktorrent/branches/experimental/debian/patches/03_trunk_pull_r769910.diff	2008-02-05 00:39:37 UTC (rev 9279)
@@ -0,0 +1,236 @@
+Index: libbtcore/dht/kbucket.cpp
+===================================================================
+--- libbtcore/dht/kbucket.cpp	(revision 767756)
++++ libbtcore/dht/kbucket.cpp	(revision 769910)
+@@ -37,6 +37,7 @@
+ 	{
+ 		last_responded = bt::GetCurrentTime();
+ 		failed_queries = 0;
++		questionable_pings = 0;
+ 	}
+ 	
+ 	KBucketEntry::KBucketEntry(const KInetSocketAddress & addr,const Key & id)
+@@ -44,11 +45,12 @@
+ 	{
+ 		last_responded = bt::GetCurrentTime();
+ 		failed_queries = 0;
++		questionable_pings = 0;
+ 	}
+ 		
+ 	KBucketEntry::KBucketEntry(const KBucketEntry & other)
+ 	: addr(other.addr),node_id(other.node_id),
+-	last_responded(other.last_responded),failed_queries(other.failed_queries)
++	last_responded(other.last_responded),failed_queries(other.failed_queries),questionable_pings(other.questionable_pings)
+ 	{}
+ 
+ 		
+@@ -61,6 +63,7 @@
+ 		node_id = other.node_id;
+ 		last_responded = other.last_responded;
+ 		failed_queries = other.failed_queries;
++		questionable_pings = other.questionable_pings;
+ 		return *this;
+ 	}
+ 	
+@@ -91,13 +94,14 @@
+ 		if (isGood())
+ 			return false;
+ 		
+-		return failed_queries > 2;
++		return failed_queries > 2 || questionable_pings > 2;
+ 	}
+ 	
+ 	void KBucketEntry::hasResponded()
+ 	{
+ 		last_responded = bt::GetCurrentTime();
+ 		failed_queries = 0; // reset failed queries
++		questionable_pings = 0;
+ 	}
+ 	
+ 
+@@ -213,6 +217,7 @@
+ 				RPCCall* c = srv->doCall(p);
+ 				if (c)
+ 				{
++					e.onPingQuestionable();
+ 					c->addListener(this);
+ 					// add the pending entry
+ 					pending_entries_busy_pinging.insert(c,replacement_entry);
+Index: libbtcore/dht/kbucket.h
+===================================================================
+--- libbtcore/dht/kbucket.h	(revision 767756)
++++ libbtcore/dht/kbucket.h	(revision 769910)
+@@ -68,6 +68,7 @@
+ 		Key node_id;
+ 		bt::TimeStamp last_responded;
+ 		Uint32 failed_queries;
++		Uint32 questionable_pings;
+ 	public:
+ 		/**
+ 		 * Constructor, sets everything to 0.
+@@ -122,6 +123,9 @@
+ 		
+ 		/// A request timed out
+ 		void requestTimeout() {failed_queries++;}
++
++		/// The entry has been pinged because it is questionable
++		void onPingQuestionable() {questionable_pings++;}
+ 		
+ 		/// The null entry
+ 		static KBucketEntry null; 
+Index: libbtcore/diskio/singlefilecache.cpp
+===================================================================
+--- libbtcore/diskio/singlefilecache.cpp	(revision 767756)
++++ libbtcore/diskio/singlefilecache.cpp	(revision 769910)
+@@ -63,7 +63,7 @@
+ 		if (!fptr.open(QIODevice::ReadOnly))
+ 			throw Error(i18n("Failed to open %1 : %2",file_map,fptr.errorString()));
+ 		
+-		output_file = fptr.readLine().trimmed();
++		output_file = QString::fromLocal8Bit(fptr.readLine().trimmed());
+ 	}
+ 
+ 	void SingleFileCache::saveFileMap()
+Index: libbtcore/diskio/multifilecache.cpp
+===================================================================
+--- libbtcore/diskio/multifilecache.cpp	(revision 767756)
++++ libbtcore/diskio/multifilecache.cpp	(revision 769910)
+@@ -104,7 +104,7 @@
+ 			Uint32 idx = 0;
+ 			while (!fptr.atEnd() && idx < tor.getNumFiles())
+ 			{
+-				QString path = fptr.readLine().trimmed();
++				QString path = QString::fromLocal8Bit(fptr.readLine().trimmed()); 
+ 				tor.getFile(idx).setPathOnDisk(path);
+ 				idx++;
+ 			}
+Index: libbtcore/net/socket.cpp
+===================================================================
+--- libbtcore/net/socket.cpp	(revision 767756)
++++ libbtcore/net/socket.cpp	(revision 769910)
+@@ -128,7 +128,7 @@
+ 			else
+ 			{
+ 				Out(SYS_CON|LOG_NOTICE) << QString("Cannot connect to host %1 : %2")
+-					.arg(a.toString()).arg(strerror(errno)) << endl;
++					.arg(a.toString()).arg(QString::fromLocal8Bit(strerror(errno))) << endl;
+ 				return false;
+ 			}
+ 		}
+Index: libbtcore/torrent/server.cpp
+===================================================================
+--- libbtcore/torrent/server.cpp	(revision 767756)
++++ libbtcore/torrent/server.cpp	(revision 769910)
+@@ -113,7 +113,7 @@
+ 	
+ 	void Server::newConnection(int socket)
+ 	{
+-		mse::StreamSocket* s = new mse::StreamSocket(socket);
++		mse::StreamSocket* s = new mse::StreamSocket(socket,sock->isIPv4() ? 4 : 6);
+ 		if (peer_managers.count() == 0)
+ 		{
+ 			s->close();
+Index: ktorrent/gui.cpp
+===================================================================
+--- ktorrent/gui.cpp	(revision 767756)
++++ ktorrent/gui.cpp	(revision 769910)
+@@ -234,6 +234,11 @@
+ 	{
+ 		core->load(url);
+ 	}
++	
++	void GUI::loadSilently(const KUrl & url)
++	{
++		core->loadSilently(url);
++	}
+ 
+ 	void GUI::createTorrent()
+ 	{
+Index: ktorrent/gui.h
+===================================================================
+--- ktorrent/gui.h	(revision 767756)
++++ ktorrent/gui.h	(revision 769910)
+@@ -74,6 +74,9 @@
+ 
+ 		/// load a torrent
+ 		void load(const KUrl & url);
++		
++		/// load a torrent silently
++		void loadSilently(const KUrl & url);
+ 
+ 		/**
+ 		 * Open a view
+Index: ktorrent/main.cpp
+===================================================================
+--- ktorrent/main.cpp	(revision 767756)
++++ ktorrent/main.cpp	(revision 769910)
+@@ -116,10 +116,13 @@
+ 	about.addCredit(ki18n("Ozzi"),ki18n("Fixes for several warnings"),"ossi at masiina.no-ip.info");
+ 	about.addCredit(ki18n("Markus Brueffer"),ki18n("Patch to fix free diskspace calculation on FreeBSD"),"markus at brueffer.de");
+ 	about.addCredit(ki18n("Lukas Appelhans"),ki18n("Patch to fix a crash in ChunkDownloadView"),"l.appelhans at gmx.de");
++	about.addCredit(ki18n("Richard Närström"),ki18n("A couple of bugfixes"),"rickard.narstrom at gmail.com");
++	about.addCredit(ki18n("caruccio"),ki18n("Patch to load torrents silently from the command line"),"mateus at caruccio.com");
+ 	KCmdLineArgs::init(argc, argv, &about);
+ 
+ 	KCmdLineOptions options;
+ 	options.add("+[Url]", ki18n("Document to open"));
++	options.add("silent", ki18n("Silently open torrent given on URL"));
+ 	KCmdLineArgs::addCmdLineOptions(options);
+ 	
+ 	kt::App::addCmdLineOptions();
+Index: ktorrent/app.cpp
+===================================================================
+--- ktorrent/app.cpp	(revision 767756)
++++ ktorrent/app.cpp	(revision 769910)
+@@ -46,7 +46,7 @@
+ 		kt::GUI *widget = 0;
+ 		if (!main_widget)
+ 		{
+-			bt::InitLog(kt::DataDir() + "log");
++			bt::InitLog(kt::DataDir() + "log",true);
+ 			
+ 			widget = new kt::GUI();
+ 			setTopWidget(widget);
+@@ -63,7 +63,10 @@
+ 		{
+ 			for (int i = 0; i < args->count(); i++)
+ 			{
+-				widget->load(args->url(i));
++				if (args->isSet("silent"))
++					widget->loadSilently(args->url(i));
++				else
++					widget->load(args->url(i));
+ 			}
+ 		}
+ 		args->clear();
+Index: libktcore/groups/torrentgroup.cpp
+===================================================================
+--- libktcore/groups/torrentgroup.cpp	(revision 767756)
++++ libktcore/groups/torrentgroup.cpp	(revision 769910)
+@@ -74,8 +74,8 @@
+ 	void TorrentGroup::save(bt::BEncoder* enc)
+ 	{
+ 		enc->beginDict();
+-		enc->write(QString("name")); enc->write(name);
+-		enc->write(QString("icon")); enc->write(icon_name);
++		enc->write(QString("name")); enc->write(name.toLocal8Bit());
++		enc->write(QString("icon")); enc->write(icon_name.toLocal8Bit());
+ 		enc->write(QString("hashes")); enc->beginList();
+ 		std::set<TorrentInterface*>::iterator i = torrents.begin();
+ 		while (i != torrents.end())
+@@ -102,13 +102,13 @@
+ 		if (!vn || vn->data().getType() != bt::Value::STRING)
+ 			throw bt::Error("invalid or missing name");
+ 		
+-		name = vn->data().toString();
++		name = QString::fromLocal8Bit(vn->data().toByteArray());
+ 		
+ 		vn = dn->getValue("icon");
+ 		if (!vn || vn->data().getType() != bt::Value::STRING)
+ 			throw bt::Error("invalid or missing icon");
+ 		
+-		setIconByName(vn->data().toString());
++		setIconByName(QString::fromLocal8Bit(vn->data().toByteArray()));
+ 		
+ 		BListNode* ln = dn->getList("hashes");
+ 		if (!ln)

Modified: kde-extras/ktorrent/branches/experimental/debian/patches/series
===================================================================
--- kde-extras/ktorrent/branches/experimental/debian/patches/series	2008-02-05 00:37:49 UTC (rev 9278)
+++ kde-extras/ktorrent/branches/experimental/debian/patches/series	2008-02-05 00:39:37 UTC (rev 9279)
@@ -1,2 +1,3 @@
 01_system_geoip_and_flags.diff
 02_kclosestnodessearch_cleanup.diff
+03_trunk_pull_r769910.diff -p0




More information about the pkg-kde-commits mailing list