[freenet-cvs] r18334 - trunk/freenet/src/freenet/node

toad at freenetproject.org toad at freenetproject.org
Tue Mar 4 14:08:22 UTC 2008


Author: toad
Date: 2008-03-04 14:08:22 +0000 (Tue, 04 Mar 2008)
New Revision: 18334

Modified:
   trunk/freenet/src/freenet/node/PeerNode.java
Log:
Try 100 times and then disconnect.

Modified: trunk/freenet/src/freenet/node/PeerNode.java
===================================================================
--- trunk/freenet/src/freenet/node/PeerNode.java	2008-03-04 14:05:18 UTC (rev 18333)
+++ trunk/freenet/src/freenet/node/PeerNode.java	2008-03-04 14:08:22 UTC (rev 18334)
@@ -3642,7 +3642,7 @@
 	}
 	
 	public void sendThrottledMessage(Message msg, int packetSize, ByteCounter ctr) throws NotConnectedException {
-		while(true) {
+		for(int i=0;i<100;i++) {
 			try {
 		getThrottle().sendThrottledMessage(msg, this, node.outputThrottle, packetSize, ctr);
 		return;
@@ -3651,5 +3651,7 @@
 			continue;
 		}
 		}
+		Logger.error(this, "Peer constantly changes its IP address!!: "+shortToString());
+		forceDisconnect(true);
 	}
 }




More information about the cvs mailing list