Author: toad
Date: 2008-03-12 18:31:48 +0000 (Wed, 12 Mar 2008)
New Revision: 18487

Modified:
   trunk/freenet/src/freenet/node/FNPPacketMangler.java
   trunk/freenet/src/freenet/node/NodeStarter.java
Log:
Log unmatchable packets to stderr if running a simulation.

Modified: trunk/freenet/src/freenet/node/FNPPacketMangler.java
===================================================================
--- trunk/freenet/src/freenet/node/FNPPacketMangler.java        2008-03-12 
18:08:58 UTC (rev 18486)
+++ trunk/freenet/src/freenet/node/FNPPacketMangler.java        2008-03-12 
18:31:48 UTC (rev 18487)
@@ -147,6 +147,7 @@
        /** Headers overhead if there is one message and no acks. */
        static public final int HEADERS_LENGTH_ONE_MESSAGE = 
                HEADERS_LENGTH_MINIMUM + 2; // 2 bytes = length of message. 
rest is the same.
+       static boolean LOG_UNMATCHABLE_ERROR = false;

        final int fullHeadersLengthMinimum;
        final int fullHeadersLengthOneMessage;
@@ -305,6 +306,8 @@
                if(node.wantAnonAuth()) {
                        if(tryProcessAuthAnon(buf, offset, length, peer, now)) 
return;
                }
+               if(LOG_UNMATCHABLE_ERROR)
+                       System.err.println("Unmatchable packet from "+peer+" on 
"+node.getDarknetPortNumber());
                Logger.normal(this,"Unmatchable packet from "+peer);
        }


Modified: trunk/freenet/src/freenet/node/NodeStarter.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeStarter.java     2008-03-12 18:08:58 UTC 
(rev 18486)
+++ trunk/freenet/src/freenet/node/NodeStarter.java     2008-03-12 18:31:48 UTC 
(rev 18487)
@@ -322,6 +322,8 @@
                plug.setDaemon(false);
                plug.start();
        }
+       
+       FNPPacketMangler.LOG_UNMATCHABLE_ERROR = true;

                return random;
        }


Reply via email to