Browse Source

Do not send to origin in second buffered multicast path.

Adam Ierymenko 7 years ago
parent
commit
939ab43ceb
2 changed files with 13 additions and 0 deletions
  1. 3 0
      node/Multicaster.cpp
  2. 10 0
      node/OutboundMulticast.hpp

+ 3 - 0
node/Multicaster.cpp

@@ -345,6 +345,9 @@ void Multicaster::send(
 				data,
 				len);
 
+			if (origin)
+				out.logAsSent(origin);
+
 			unsigned int count = 0;
 
 			for(unsigned int i=0;i<activeBridgeCount;++i) {

+ 10 - 0
node/OutboundMulticast.hpp

@@ -125,6 +125,16 @@ public:
 		sendOnly(RR,tPtr,toAddr);
 	}
 
+	/**
+	 * Log an address as having been used so we will not send there in the future
+	 *
+	 * @param toAddr Address to log as sent
+	 */
+	inline void logAsSent(const Address &toAddr)
+	{
+		_alreadySentTo.push_back(toAddr);
+	}
+
 	/**
 	 * Try to send this to a given peer if it hasn't been sent to them already
 	 *