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

List:       kde-commits
Subject:    extragear/network/ktorrent
From:       Joris Guisson <joris.guisson () gmail ! com>
Date:       2010-01-09 11:26:58
Message-ID: 1263036418.449414.18819.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1072064 by guisson:

Fix crashes when DHT socket could not be bound 

BUG: 221872

 M  +1 -0      ChangeLog  
 M  +17 -7     libbtcore/dht/rpcserver.cpp  
 M  +1 -1      plugins/search/opensearch/ktorrents/opensearch.xml  


--- trunk/extragear/network/ktorrent/ChangeLog #1072063:1072064
@@ -42,6 +42,7 @@
 - Fix crash due to uncaught exception in TorrentFileTreeModel::loadExpandedState 
 - Fix bug causing error message that the QM limits are reached to be shown instead \
                of a torrent to be enqueued (220171)
 - Fix crash caused by not checking for 0 pointer (221333)
+- Fix crashes when DHT socket could not be bound (221872)
 
 Changes in 3.3.2:
 - Fix crash when loading Feed in syndication plugin at startup (216207)
--- trunk/extragear/network/ktorrent/libbtcore/dht/rpcserver.cpp #1072063:1072064
@@ -190,13 +190,20 @@
 	void RPCServer::stop()
 	{
 		bt::Globals::instance().getPortList().removePort(port,net::UDP);
-		sock->close();
-		listener_thread->stop();
-		listener_thread->wait();
-		delete listener_thread;
-		listener_thread = 0;
-		delete sock;
-		sock = 0;
+		if (listener_thread)
+		{
+			listener_thread->stop();
+			listener_thread->wait();
+			delete listener_thread;
+			listener_thread = 0;
+		}
+		
+		if (sock)
+		{
+			sock->close();
+			delete sock;
+			sock = 0;
+		}
 	}
 	
 #if 0
@@ -218,6 +225,9 @@
 
 	void RPCServer::handlePackets()
 	{
+		if (!listener_thread)
+			return; 
+		
 		// lock the thread
 		QMutexLocker lock(&listener_thread->mutex);
 		
--- trunk/extragear/network/ktorrent/plugins/search/opensearch/ktorrents/opensearch.xml \
#1072063:1072064 @@ -2,7 +2,7 @@
 <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
  <ShortName>KTorrents</ShortName>
  <Description>KTorrents Search Engine</Description>
- <Url type="text/html" template="http://ktorrents.com/search.php?q={searchTerms}" />
+ <Url type="text/html" \
template="http://www.ktorrents.com/search.php?q={searchTerms}" />  <Image height="16" \
width="16" type="image/x-icon">http://ktorrents.com/favicon.ico</Image>  \
</OpenSearchDescription>    


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

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