[o2on-svn] [82] FIX: ブロードキャストメッセージのループの暫定修正によるIMへの副作用

Back to archive index

o2on svn commit o2on-****@lists*****
2008年 5月 1日 (木) 14:33:57 JST


Revision: 82
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=o2on&view=rev&rev=82
Author:   electrolysis
Date:     2008-05-01 14:33:57 +0900 (Thu, 01 May 2008)

Log Message:
-----------
FIX: ブロードキャストメッセージのループの暫定修正によるIMへの副作用

Modified Paths:
--------------
    branches/BRANCH_0043/o2on/src.o2on/O2IMDB.h
    branches/BRANCH_0043/o2on/src.o2on/O2Server_HTTP_Admin.h
    branches/BRANCH_0043/o2on/src.o2on/O2Server_HTTP_P2P.h

Modified: branches/BRANCH_0043/o2on/src.o2on/O2IMDB.h
===================================================================
--- branches/BRANCH_0043/o2on/src.o2on/O2IMDB.h	2008-04-27 14:36:55 UTC (rev 81)
+++ branches/BRANCH_0043/o2on/src.o2on/O2IMDB.h	2008-05-01 05:33:57 UTC (rev 82)
@@ -36,28 +36,26 @@
 	hashT		key;
 	bool		mine;
 	hashListT	paths;
+	bool		broadcast;
 
 	O2IMessage(void)
 		: ip(0)
 		, port(0)
 		, date(0)
 		, mine(false)
+		, broadcast(false)
 	{
 	}
 
 	bool operator==(const O2IMessage &src)
 	{
-		//‚±‚Ì•”•ª‚̃Rƒƒ“ƒgƒAƒEƒg‚ð‰ðœ
-		//return (key == src.key ? true : false);
-
-		//note:ƒuƒ[ƒhƒLƒƒƒXƒgƒƒbƒZ[ƒW‚ÌŒ‚ÌŽb’è‘Ήž
-		// ‚±‚̍\‘¢‘Ì‚ÍIMDB‚Å‚àŽg—p‚µ‚Ä‚¢‚邽‚߁A
-		// C³‚É‚æ‚Á‚ăƒbƒZƒ“ƒWƒƒ[‚Ì•û‚É‚à‰e‹¿‚ ‚èB
-		// ƒƒbƒZ[ƒW“à—e(IP/PORT/–{•¶‚ª“¯‚¶)‚¾‚ƈê‚‚̃ƒbƒZ[ƒW‚É‚È‚éB
-		if(ip == src.ip && port == src.port && msg == src.msg)
-			return true;
-		else
-			return false;
+		if (broadcast == src.broadcast) {
+			if (broadcast)
+				return (ip == src.ip && port == src.port && msg == src.msg ? true : false);
+			else
+				return (key == src.key ? true : false);
+		}
+		return false;
 	}
 };
 typedef std::list<O2IMessage> O2IMessages;

Modified: branches/BRANCH_0043/o2on/src.o2on/O2Server_HTTP_Admin.h
===================================================================
--- branches/BRANCH_0043/o2on/src.o2on/O2Server_HTTP_Admin.h	2008-04-27 14:36:55 UTC (rev 81)
+++ branches/BRANCH_0043/o2on/src.o2on/O2Server_HTTP_Admin.h	2008-05-01 05:33:57 UTC (rev 82)
@@ -1333,6 +1333,7 @@
 				im.date = time(NULL);
 				im.key.random();
 				im.mine = true;
+				im.broadcast = true;
 				if (Job_Broadcast->Add(im))
 					BroadcastDB->AddMessage(im);
 			}

Modified: branches/BRANCH_0043/o2on/src.o2on/O2Server_HTTP_P2P.h
===================================================================
--- branches/BRANCH_0043/o2on/src.o2on/O2Server_HTTP_P2P.h	2008-04-27 14:36:55 UTC (rev 81)
+++ branches/BRANCH_0043/o2on/src.o2on/O2Server_HTTP_P2P.h	2008-05-01 05:33:57 UTC (rev 82)
@@ -423,6 +423,7 @@
 		tmpdb.GetMessages(msg);
 
 		for (O2IMessagesIt it = msg.begin(); it != msg.end(); it++) {
+			it->broadcast = true;
 			if (Job_Broadcast->Add(*it)) {
 				it->paths.clear();
 				BroadcastDB->AddMessage(*it);




o2on-svn メーリングリストの案内
Back to archive index