Sfoglia il codice sorgente

Remove some left over debug code, and fix attempt to send to self if we are an active bridge.

Adam Ierymenko 10 anni fa
parent
commit
708aac1ea7
2 ha cambiato i file con 11 aggiunte e 7 eliminazioni
  1. 10 6
      node/Multicaster.cpp
  2. 1 1
      node/Peer.cpp

+ 10 - 6
node/Multicaster.cpp

@@ -211,9 +211,11 @@ void Multicaster::send(
 		unsigned int count = 0;
 
 		for(std::vector<Address>::const_iterator ast(alwaysSendTo.begin());ast!=alwaysSendTo.end();++ast) {
-			out.sendOnly(RR,*ast);
-			if (++count >= limit)
-				break;
+			if (*ast != RR->identity.address()) {
+				out.sendOnly(RR,*ast);
+				if (++count >= limit)
+					break;
+			}
 		}
 
 		unsigned long idx = 0;
@@ -264,9 +266,11 @@ void Multicaster::send(
 		unsigned int count = 0;
 
 		for(std::vector<Address>::const_iterator ast(alwaysSendTo.begin());ast!=alwaysSendTo.end();++ast) {
-			out.sendAndLog(RR,*ast);
-			if (++count >= limit)
-				break;
+			if (*ast != RR->identity.address()) {
+				out.sendAndLog(RR,*ast);
+				if (++count >= limit)
+					break;
+			}
 		}
 
 		unsigned long idx = 0;

+ 1 - 1
node/Peer.cpp

@@ -226,7 +226,7 @@ void Peer::doPingAndKeepalive(const RuntimeEnvironment *RR,uint64_t now)
 
 void Peer::pushDirectPaths(const RuntimeEnvironment *RR,RemotePath *path,uint64_t now,bool force)
 {
-	if ((true)||(((now - _lastDirectPathPush) >= ZT_DIRECT_PATH_PUSH_INTERVAL)||(force))) {
+	if (((now - _lastDirectPathPush) >= ZT_DIRECT_PATH_PUSH_INTERVAL)||(force)) {
 		_lastDirectPathPush = now;
 
 		std::vector<Path> dps(RR->node->directPaths());