Browse Source

2010-01-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

	Ignore port message with port=0.
	* src/BtPortMessage.cc
Tatsuhiro Tsujikawa 16 years ago
parent
commit
e56f2afbbf
2 changed files with 9 additions and 0 deletions
  1. 5 0
      ChangeLog
  2. 4 0
      src/BtPortMessage.cc

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2010-01-07  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
+
+	Ignore port message with port=0.
+	* src/BtPortMessage.cc
+
 2010-01-06  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
 
 	Run autoupdate

+ 4 - 0
src/BtPortMessage.cc

@@ -71,6 +71,10 @@ SharedHandle<BtPortMessage> BtPortMessage::create(const unsigned char* data, siz
 void BtPortMessage::doReceivedAction()
 {
   if(!_taskFactory.isNull() && !_taskQueue.isNull()) {
+    if(_port == 0) {
+      logger->debug("Ignored port 0.");
+      return;
+    }
     // node id is random at this point. When ping reply received, new DHTNode
     // instance created with proper node ID and is added to a routing table.
     SharedHandle<DHTNode> node(new DHTNode());