Author: nextgens
Date: 2007-05-23 22:40:31 +0000 (Wed, 23 May 2007)
New Revision: 13347

Modified:
   trunk/freenet/src/freenet/node/IPDetectorPluginManager.java
Log:
Done the following:
        * Run the external ip detection if no peer is known (to ensure newbies 
publish a correct reference).
        * Fix a log message (we can't assume that the plugin is STUN)
        * Add a new log message each time we register a new plugin

Modified: trunk/freenet/src/freenet/node/IPDetectorPluginManager.java
===================================================================
--- trunk/freenet/src/freenet/node/IPDetectorPluginManager.java 2007-05-23 
22:27:12 UTC (rev 13346)
+++ trunk/freenet/src/freenet/node/IPDetectorPluginManager.java 2007-05-23 
22:40:31 UTC (rev 13347)
@@ -169,6 +169,7 @@
                        newPlugins[plugins.length] = d;
                        plugins = newPlugins;
                }
+               if(logMINOR) Logger.minor(this, "Registering a new plugin : " + 
d);
                maybeRun();
        }

@@ -352,6 +353,9 @@
                                if(detector.maybeSymmetric && 
lastDetectAttemptEndedTime <= 0) // If it appears to be an SNAT, do a detection 
at least once
                                        maybeUrgent = true;

+                               if(node.peers.myPeers.length == 0 && 
lastDetectAttemptEndedTime <= 0) // We don't have any peer connected yet, we 
want to publish a "correct" reference
+                                       maybeUrgent = true;
+                               
                                if(maybeUrgent) {
                                        if(firstTimeUrgent <= 0)
                                                firstTimeUrgent = now;
@@ -448,7 +452,7 @@
                }

                public void realRun() {
-                       if(logMINOR) Logger.minor(this, "Running STUN 
detection");
+                       if(logMINOR) Logger.minor(this, "Running plugin 
detection");
                        try {
                                FredPluginIPDetector[] run = plugins;
                                Vector v = new Vector();


Reply via email to