Author: toad
Date: 2006-02-21 01:33:48 +0000 (Tue, 21 Feb 2006)
New Revision: 8076

Modified:
   branches/config/src/freenet/clients/http/FproxyToadlet.java
   branches/config/src/freenet/config/FilePersistentConfig.java
   branches/config/src/freenet/node/LoggingConfigHandler.java
   branches/config/src/freenet/node/Node.java
   branches/config/src/freenet/support/FileLoggerHook.java
Log:
connects; appears to work, generally

Modified: branches/config/src/freenet/clients/http/FproxyToadlet.java
===================================================================
--- branches/config/src/freenet/clients/http/FproxyToadlet.java 2006-02-21 
00:55:09 UTC (rev 8075)
+++ branches/config/src/freenet/clients/http/FproxyToadlet.java 2006-02-21 
01:33:48 UTC (rev 8076)
@@ -134,6 +134,7 @@
         FproxyToadlet fproxy = new 
FproxyToadlet(node.makeClient(RequestStarter.INTERACTIVE_PRIORITY_CLASS));
         node.setFproxy(fproxy);
         server.register(fproxy, "/", false);
+        fproxyConfig.finishedInitialization();
         System.out.println("Starting fproxy on port "+(port));
        }


Modified: branches/config/src/freenet/config/FilePersistentConfig.java
===================================================================
--- branches/config/src/freenet/config/FilePersistentConfig.java        
2006-02-21 00:55:09 UTC (rev 8075)
+++ branches/config/src/freenet/config/FilePersistentConfig.java        
2006-02-21 01:33:48 UTC (rev 8076)
@@ -119,6 +119,7 @@
                if(origConfigFileContents == null) return;
                String name = 
config.prefix+SimpleFieldSet.MULTI_LEVEL_CHAR+o.name;
                String val = origConfigFileContents.get(name);
+               if(val == null) return;
                try {
                        o.setInitialValue(val);
                } catch (InvalidConfigValueException e) {

Modified: branches/config/src/freenet/node/LoggingConfigHandler.java
===================================================================
--- branches/config/src/freenet/node/LoggingConfigHandler.java  2006-02-21 
00:55:09 UTC (rev 8075)
+++ branches/config/src/freenet/node/LoggingConfigHandler.java  2006-02-21 
01:33:48 UTC (rev 8076)
@@ -18,7 +18,7 @@

 public class LoggingConfigHandler {

-       protected static final String LOG_PREFIX = "freenet-";
+       protected static final String LOG_PREFIX = "freenet";
        private final SubConfig config;
        private FileLoggerHook fileLoggerHook;
        private File logDir;

Modified: branches/config/src/freenet/node/Node.java
===================================================================
--- branches/config/src/freenet/node/Node.java  2006-02-21 00:55:09 UTC (rev 
8075)
+++ branches/config/src/freenet/node/Node.java  2006-02-21 01:33:48 UTC (rev 
8076)
@@ -542,8 +542,6 @@
                }
        }
        usm = u;
-        usm.setDispatcher(dispatcher=new NodeDispatcher(this));
-        usm.setLowLevelFilter(packetMangler = new FNPPacketMangler(this));

         System.out.println("Port number: "+port);
         portNumber = port;
@@ -622,10 +620,6 @@
                throw new NodeInitException(EXIT_BAD_NODE_DIR, msg);
         }

-        peers = new PeerManager(this, new File(nodeDir, 
"peers-"+portNumber).getPath());
-        peers.writePeers();
-        nodePinger = new NodePinger(this);
-        
         // After we have set up testnet and IP address, load the node file
         try {
                // FIXME should take file directly?
@@ -639,6 +633,14 @@
         }
         writeNodeFile();

+        // Then read the peers
+        peers = new PeerManager(this, new File(nodeDir, 
"peers-"+portNumber).getPath());
+        peers.writePeers();
+        nodePinger = new NodePinger(this);
+
+        usm.setDispatcher(dispatcher=new NodeDispatcher(this));
+        usm.setLowLevelFilter(packetMangler = new FNPPacketMangler(this));
+
         // Temp files

         nodeConfig.register("tempDir", new File(nodeDir, 
"temp-"+portNumber).toString(), 6, true, "Temp files directory", "Name of 
directory to put temporary files in", 
@@ -765,8 +767,6 @@
         }

         nodeConfig.finishedInitialization();
-        config.finishedInit();
-        config.store();

         // FIXME make all the below arbitrary constants configurable!

@@ -839,9 +839,14 @@
         // SNMP
         SNMPStarter.maybeCreate(this, config);

+        // After everything has been created, write the config file back to 
disk.
+        config.finishedInit();
+        config.store();
+        
         // Start testnet handler
                if(testnetHandler != null)
                        testnetHandler.start();
+               
     }

     public ClientKeyBlock realGetKey(ClientKey key, boolean localOnly, boolean 
cache, boolean ignoreStore) throws LowLevelGetException {

Modified: branches/config/src/freenet/support/FileLoggerHook.java
===================================================================
--- branches/config/src/freenet/support/FileLoggerHook.java     2006-02-21 
00:55:09 UTC (rev 8075)
+++ branches/config/src/freenet/support/FileLoggerHook.java     2006-02-21 
01:33:48 UTC (rev 8076)
@@ -481,6 +481,7 @@
                        prefix = 
baseFilename.substring(slashIndex+1).toLowerCase();
                }
                File[] files = dir.listFiles();
+               if(files == null) return;
                java.util.Arrays.sort(files);
                long lastStartTime = -1;
                File oldFile = null;


Reply via email to