What the **** ?!
On Sat, May 13, 2006 at 12:03:07AM +0000, zothar at freenetproject.org wrote:
> Author: zothar
> Date: 2006-05-13 00:02:33 +0000 (Sat, 13 May 2006)
> New Revision: 8687
>
> Modified:
> trunk/freenet/src/freenet/io/comm/UdpSocketManager.java
> trunk/freenet/src/freenet/node/PacketSender.java
> trunk/freenet/src/freenet/node/PeerNode.java
> Log:
> Don't try to send queued messages or keepalive packets to backed off nodes.
> Increase the size of the maximum unmatched FIFO and make the limit a variable.
>
> Modified: trunk/freenet/src/freenet/io/comm/UdpSocketManager.java
> ===================================================================
> --- trunk/freenet/src/freenet/io/comm/UdpSocketManager.java 2006-05-12
> 20:45:50 UTC (rev 8686)
> +++ trunk/freenet/src/freenet/io/comm/UdpSocketManager.java 2006-05-13
> 00:02:33 UTC (rev 8687)
> @@ -43,6 +43,7 @@
> private boolean _active = true;
> private boolean _isDone = false;
> private static UdpSocketManager _usm;
> + private static final int MAX_UNMATCHED_FIFO_SIZE = 5000;
>
> protected UdpSocketManager() {
> }
> @@ -319,7 +320,7 @@
> }
> }
> if(!matched) {
> - while (_unclaimed.size() > 500) {
> + while (_unclaimed.size() >
> MAX_UNMATCHED_FIFO_SIZE) {
> Message removed =
> (Message)_unclaimed.removeFirst();
> Logger.normal(this, "Dropping
> unclaimed: "+removed);
> }
>
> Modified: trunk/freenet/src/freenet/node/PacketSender.java
> ===================================================================
> --- trunk/freenet/src/freenet/node/PacketSender.java 2006-05-12 20:45:50 UTC
> (rev 8686)
> +++ trunk/freenet/src/freenet/node/PacketSender.java 2006-05-13 00:02:33 UTC
> (rev 8687)
> @@ -124,6 +124,11 @@
> }
>
> if(node.packetMangler == null) continue;
> + if(pn.isBackedOff()) {
> + if(pn.hasQueuedMessageItems() || (now -
> pn.lastSentPacketTime() > Node.KEEPALIVE_INTERVAL))
> + Logger.debug(this, pn.getPeer()+" is backed off;
> Won't try to send queued messages and/or keepalive packet");
> + continue;
> + }
> // Any messages to send?
> MessageItem[] messages = null;
> messages = pn.grabQueuedMessageItems();
>
> Modified: trunk/freenet/src/freenet/node/PeerNode.java
> ===================================================================
> --- trunk/freenet/src/freenet/node/PeerNode.java 2006-05-12 20:45:50 UTC
> (rev 8686)
> +++ trunk/freenet/src/freenet/node/PeerNode.java 2006-05-13 00:02:33 UTC
> (rev 8687)
> @@ -468,6 +468,13 @@
> disconnected();
> }
>
> + public boolean hasQueuedMessageItems() {
> + synchronized(messagesToSendNow) {
> + if(messagesToSendNow.size() == 0) return false;
> + return true;
> + }
> + }
> +
> /**
> * Grab all queued Message's.
> * @return Null if no messages are queued, or an array of
>
> _______________________________________________
> cvs mailing list
> cvs at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
>
--
Matthew J Toseland - toad at amphibian.dyndns.org
Freenet Project Official Codemonkey - http://freenetproject.org/
ICTHUS - Nothing is impossible. Our Boss says so.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL:
<https://emu.freenetproject.org/pipermail/devl/attachments/20060513/f4e751c4/attachment.pgp>