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) { - //±ÌªÌRgAEgðð - //return (key == src.key ? true : false); - - //note:u[hLXgbZ[WÌÌbèÎ - // ±Ì\¢ÌÍIMDBÅàgpµÄ¢é½ßA - // C³ÉæÁÄbZW[ÌûÉàe¿ èB - // bZ[Wàe(IP/PORT/{¶ª¯¶)¾ÆêÂÌbZ[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);