From j16sdiz at freenetproject.org Thu May 1 05:27:12 2008
From: j16sdiz at freenetproject.org (j16sdiz at freenetproject.org)
Date: Thu, 1 May 2008 05:27:12 +0000 (UTC)
Subject: [freenet-cvs] r19641 - trunk/freenet/src/freenet/store
Message-ID: <20080501052712.708DD47B382@freenetproject.org>
Author: j16sdiz
Date: 2008-05-01 05:27:12 +0000 (Thu, 01 May 2008)
New Revision: 19641
Modified:
trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
Log:
slient datastore shutdown
Modified: trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
===================================================================
--- trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2008-04-30 23:08:13 UTC (rev 19640)
+++ trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2008-05-01 05:27:12 UTC (rev 19641)
@@ -5,6 +5,7 @@
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
+import java.nio.channels.ClosedChannelException;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.Arrays;
@@ -1353,6 +1354,10 @@
hits++;
}
return block;
+ } catch (ClosedChannelException cce) {
+ // The channel is already close
+ Logger.debug(this, "channel closed" , cce);
+ return null;
} catch(Throwable ex) { // FIXME: ugly
if(ex instanceof IOException) {
synchronized(this) {
@@ -1526,7 +1531,9 @@
Logger.minor(this, "Headers: "+header.length+" bytes, hash "+Fields.hashCode(header));
Logger.minor(this, "Data: "+data.length+" bytes, hash "+Fields.hashCode(data)+" putting "+HexUtil.bytesToHex(routingkey));
}
-
+ } catch (ClosedChannelException cce) {
+ // The channel is already close
+ Logger.debug(this, "channel closed", cce);
} catch(Throwable ex) { // FIXME: ugly
if(ex instanceof IOException) {
synchronized(this) {
From toad at freenetproject.org Thu May 1 13:47:49 2008
From: toad at freenetproject.org (toad at freenetproject.org)
Date: Thu, 1 May 2008 13:47:49 +0000 (UTC)
Subject: [freenet-cvs] r19643 - in trunk/apps/new_installer: . res/unix/bin
Message-ID: <20080501134749.5CC4B479D8B@freenetproject.org>
Author: toad
Date: 2008-05-01 13:47:49 +0000 (Thu, 01 May 2008)
New Revision: 19643
Added:
trunk/apps/new_installer/res/unix/bin/install_autostart.sh
Modified:
trunk/apps/new_installer/ProcessPanel.Spec.xml
trunk/apps/new_installer/install.xml
Log:
Auto-start on reboot on unix.
Currently we use a cron job. This will work on non-root, and doesn't require the LSB-utils to be installed (they usually aren't).
However, we should make the script detect if it's run as root and the LSB utils exist, and if so, use the useradd and install_initd scripts.
Modified: trunk/apps/new_installer/ProcessPanel.Spec.xml
===================================================================
--- trunk/apps/new_installer/ProcessPanel.Spec.xml 2008-05-01 08:19:44 UTC (rev 19642)
+++ trunk/apps/new_installer/ProcessPanel.Spec.xml 2008-05-01 13:47:49 UTC (rev 19643)
@@ -184,6 +184,11 @@
+
+
+
+
+
Modified: trunk/apps/new_installer/install.xml
===================================================================
--- trunk/apps/new_installer/install.xml 2008-05-01 08:19:44 UTC (rev 19642)
+++ trunk/apps/new_installer/install.xml 2008-05-01 13:47:49 UTC (rev 19643)
@@ -225,6 +225,11 @@
The opennet seednodes file. Used to connect quickly (but insecurely) to the network. The node will ask whether to use this after install.
+
+
+ Start the node automatically on startup. Strongly recommended.
+
+
A plugin enabling the node to use Universal Plug and Play to determine your external internet address and set up port forwarding on your router. Note that this involves contacting your default gateway and may be a security risk on an untrusted LAN, however it improves connectivity significantly.
Added: trunk/apps/new_installer/res/unix/bin/install_autostart.sh
===================================================================
--- trunk/apps/new_installer/res/unix/bin/install_autostart.sh (rev 0)
+++ trunk/apps/new_installer/res/unix/bin/install_autostart.sh 2008-05-01 13:47:49 UTC (rev 19643)
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+. "$HOME/_install_toSource.sh"
+cd "$INSTALL_PATH"
+
+# FIXME if we are running as root, and they are installed use the LSB utilities, with crontab as a fallback.
+# See here:
+# http://refspecs.linux-foundation.org/LSB_3.2.0/LSB-Core-generic/LSB-Core-generic/initsrcinstrm.html
+# http://refspecs.linux-foundation.org/LSB_3.2.0/LSB-Core-generic/LSB-Core-generic/useradd.html
+if test -e autostart.install
+then
+ echo "Enabling auto-start."
+ if test -x `which crontab`
+ then
+ echo "Installing cron job to start Freenet on reboot..."
+ rm -f crontab.tmp
+ crontab -l > crontab.tmp
+ echo "@reboot \"$INSTALL_PATH/run.sh\" start" >> crontab.tmp
+ if crontab crontab.tmp
+ then
+ echo Installed cron job.
+ else
+ echo Could not install cron job, you will have to run run.sh start manually to start Freenet after a reboot.
+ fi
+ rm crontab.tmp
+ else
+ echo Cron appears not to be installed, you will have to run run.sh start manually to start Freenet after a reboot.
+ fi
+else
+ echo Auto-start is disabled, you will have to run run.sh start manually to start Freenet after a reboot.
+fi
From j16sdiz at freenetproject.org Thu May 1 14:08:06 2008
From: j16sdiz at freenetproject.org (j16sdiz at freenetproject.org)
Date: Thu, 1 May 2008 14:08:06 +0000 (UTC)
Subject: [freenet-cvs] r19644 - trunk/freenet/src/freenet/store
Message-ID: <20080501140806.6711C3C12D6@freenetproject.org>
Author: j16sdiz
Date: 2008-05-01 14:08:06 +0000 (Thu, 01 May 2008)
New Revision: 19644
Modified:
trunk/freenet/src/freenet/store/CHKStore.java
Log:
fix assertion error
Modified: trunk/freenet/src/freenet/store/CHKStore.java
===================================================================
--- trunk/freenet/src/freenet/store/CHKStore.java 2008-05-01 13:47:49 UTC (rev 19643)
+++ trunk/freenet/src/freenet/store/CHKStore.java 2008-05-01 14:08:06 UTC (rev 19644)
@@ -27,7 +27,7 @@
public void put(CHKBlock b) throws IOException {
NodeCHK key = (NodeCHK) b.getKey();
try {
- store.put(b, key.getRoutingKey(), key.getRoutingKey(), b.getRawData(), b.getRawHeaders(), false);
+ store.put(b, key.getRoutingKey(), key.getFullKey(), b.getRawData(), b.getRawHeaders(), false);
} catch (KeyCollisionException e) {
Logger.error(this, "Impossible for CHKStore: "+e, e);
}
From toad at freenetproject.org Thu May 1 14:21:08 2008
From: toad at freenetproject.org (toad at freenetproject.org)
Date: Thu, 1 May 2008 14:21:08 +0000 (UTC)
Subject: [freenet-cvs] r19645 - in trunk/apps/new_installer: . res/unix/bin
Message-ID: <20080501142108.8404D479940@freenetproject.org>
Author: toad
Date: 2008-05-01 14:21:08 +0000 (Thu, 01 May 2008)
New Revision: 19645
Added:
trunk/apps/new_installer/res/unix/bin/remove_cronjob.sh
Modified:
trunk/apps/new_installer/install.xml
Log:
Hopefully this will remove the cronjob on uninstall through the uninstaller jar.
Modified: trunk/apps/new_installer/install.xml
===================================================================
--- trunk/apps/new_installer/install.xml 2008-05-01 14:08:06 UTC (rev 19644)
+++ trunk/apps/new_installer/install.xml 2008-05-01 14:21:08 UTC (rev 19645)
@@ -219,6 +219,7 @@
Allow the node to auto-update over freenet securely. It's advised that you enable it to keep your node up-to-date.
+
Added: trunk/apps/new_installer/res/unix/bin/remove_cronjob.sh
===================================================================
--- trunk/apps/new_installer/res/unix/bin/remove_cronjob.sh (rev 0)
+++ trunk/apps/new_installer/res/unix/bin/remove_cronjob.sh 2008-05-01 14:21:08 UTC (rev 19645)
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+crontab -l > crontab.tmp
+if grep -F crontab.tmp "@reboot \"$INSTALL_PATH/run.sh\" start"
+then
+ echo Found service in crontab, removing it...
+ cat crontab.tmp | grep -v -F "@reboot \"$INSTALL_PATH/run.sh\" start" > crontab.tmp.new
+ crontab crontab.tmp.new
+fi
+rm -f crontab.tmp crontab.tmp.new
From j16sdiz at freenetproject.org Thu May 1 14:37:21 2008
From: j16sdiz at freenetproject.org (j16sdiz at freenetproject.org)
Date: Thu, 1 May 2008 14:37:21 +0000 (UTC)
Subject: [freenet-cvs] r19646 - trunk/freenet/src/freenet/store
Message-ID: <20080501143721.8FCF247B2E6@freenetproject.org>
Author: j16sdiz
Date: 2008-05-01 14:37:21 +0000 (Thu, 01 May 2008)
New Revision: 19646
Modified:
trunk/freenet/src/freenet/store/PubkeyStore.java
Log:
should take a fullkey
Modified: trunk/freenet/src/freenet/store/PubkeyStore.java
===================================================================
--- trunk/freenet/src/freenet/store/PubkeyStore.java 2008-05-01 14:21:08 UTC (rev 19645)
+++ trunk/freenet/src/freenet/store/PubkeyStore.java 2008-05-01 14:37:21 UTC (rev 19646)
@@ -32,7 +32,7 @@
public void put(byte[] hash, DSAPublicKey key) throws IOException {
try {
- store.put(key, key.getRoutingKey(), key.getRoutingKey(), key.asPaddedBytes(), empty, false);
+ store.put(key, key.getRoutingKey(), key.getFullKey(), key.asPaddedBytes(), empty, false);
} catch (KeyCollisionException e) {
Logger.error(this, "Impossible for PubkeyStore: "+e, e);
}
From toad at freenetproject.org Thu May 1 14:47:54 2008
From: toad at freenetproject.org (toad at freenetproject.org)
Date: Thu, 1 May 2008 14:47:54 +0000 (UTC)
Subject: [freenet-cvs] r19647 - trunk/apps/new_installer
Message-ID: <20080501144754.5C81F47AED4@freenetproject.org>
Author: toad
Date: 2008-05-01 14:47:54 +0000 (Thu, 01 May 2008)
New Revision: 19647
Modified:
trunk/apps/new_installer/install.xml
Log:
remove_cronjob.sh was called from the wrong stage
Modified: trunk/apps/new_installer/install.xml
===================================================================
--- trunk/apps/new_installer/install.xml 2008-05-01 14:37:21 UTC (rev 19646)
+++ trunk/apps/new_installer/install.xml 2008-05-01 14:47:54 UTC (rev 19647)
@@ -219,7 +219,6 @@
Allow the node to auto-update over freenet securely. It's advised that you enable it to keep your node up-to-date.
-
@@ -230,6 +229,7 @@
Start the node automatically on startup. Strongly recommended.
+
From toad at freenetproject.org Thu May 1 14:54:15 2008
From: toad at freenetproject.org (toad at freenetproject.org)
Date: Thu, 1 May 2008 14:54:15 +0000 (UTC)
Subject: [freenet-cvs] r19648 - trunk/apps/new_installer
Message-ID: <20080501145415.EB27147B35D@freenetproject.org>
Author: toad
Date: 2008-05-01 14:54:15 +0000 (Thu, 01 May 2008)
New Revision: 19648
Modified:
trunk/apps/new_installer/install.xml
Log:
Do variable substitution
Modified: trunk/apps/new_installer/install.xml
===================================================================
--- trunk/apps/new_installer/install.xml 2008-05-01 14:47:54 UTC (rev 19647)
+++ trunk/apps/new_installer/install.xml 2008-05-01 14:54:15 UTC (rev 19648)
@@ -230,6 +230,7 @@
Start the node automatically on startup. Strongly recommended.
+
From toad at freenetproject.org Thu May 1 15:06:24 2008
From: toad at freenetproject.org (toad at freenetproject.org)
Date: Thu, 1 May 2008 15:06:24 +0000 (UTC)
Subject: [freenet-cvs] r19649 - trunk/apps/new_installer/res/unix/bin
Message-ID: <20080501150624.60F3E47B3A4@freenetproject.org>
Author: toad
Date: 2008-05-01 15:06:24 +0000 (Thu, 01 May 2008)
New Revision: 19649
Modified:
trunk/apps/new_installer/res/unix/bin/remove_cronjob.sh
Log:
Fix remove_cronjob.sh.
Modified: trunk/apps/new_installer/res/unix/bin/remove_cronjob.sh
===================================================================
--- trunk/apps/new_installer/res/unix/bin/remove_cronjob.sh 2008-05-01 14:54:15 UTC (rev 19648)
+++ trunk/apps/new_installer/res/unix/bin/remove_cronjob.sh 2008-05-01 15:06:24 UTC (rev 19649)
@@ -4,7 +4,7 @@
if grep -F crontab.tmp "@reboot \"$INSTALL_PATH/run.sh\" start"
then
echo Found service in crontab, removing it...
- cat crontab.tmp | grep -v -F "@reboot \"$INSTALL_PATH/run.sh\" start" > crontab.tmp.new
+ cat crontab.tmp | grep -v -F "@reboot \"$INSTALL_PATH/run.sh\" start" - > crontab.tmp.new
crontab crontab.tmp.new
fi
rm -f crontab.tmp crontab.tmp.new
From toad at freenetproject.org Thu May 1 15:13:00 2008
From: toad at freenetproject.org (toad at freenetproject.org)
Date: Thu, 1 May 2008 15:13:00 +0000 (UTC)
Subject: [freenet-cvs] r19650 - trunk/apps/new_installer/res/unix/bin
Message-ID: <20080501151300.EB681479828@freenetproject.org>
Author: toad
Date: 2008-05-01 15:13:00 +0000 (Thu, 01 May 2008)
New Revision: 19650
Modified:
trunk/apps/new_installer/res/unix/bin/remove_cronjob.sh
Log:
Really fix remove_cronjob.sh.
Modified: trunk/apps/new_installer/res/unix/bin/remove_cronjob.sh
===================================================================
--- trunk/apps/new_installer/res/unix/bin/remove_cronjob.sh 2008-05-01 15:06:24 UTC (rev 19649)
+++ trunk/apps/new_installer/res/unix/bin/remove_cronjob.sh 2008-05-01 15:13:00 UTC (rev 19650)
@@ -1,7 +1,7 @@
#!/bin/sh
crontab -l > crontab.tmp
-if grep -F crontab.tmp "@reboot \"$INSTALL_PATH/run.sh\" start"
+if grep -F "@reboot \"$INSTALL_PATH/run.sh\" start" crontab.tmp
then
echo Found service in crontab, removing it...
cat crontab.tmp | grep -v -F "@reboot \"$INSTALL_PATH/run.sh\" start" - > crontab.tmp.new
From j16sdiz at freenetproject.org Thu May 1 15:19:12 2008
From: j16sdiz at freenetproject.org (j16sdiz at freenetproject.org)
Date: Thu, 1 May 2008 15:19:12 +0000 (UTC)
Subject: [freenet-cvs] r19651 - trunk/freenet/src/freenet/store
Message-ID: <20080501151913.0AC6E47B2DD@freenetproject.org>
Author: j16sdiz
Date: 2008-05-01 15:19:12 +0000 (Thu, 01 May 2008)
New Revision: 19651
Modified:
trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
Log:
less verbose logging
Modified: trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
===================================================================
--- trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2008-05-01 15:13:00 UTC (rev 19650)
+++ trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2008-05-01 15:19:12 UTC (rev 19651)
@@ -1004,10 +1004,10 @@
}
}
if(lruVal == 0) {
- Logger.normal(this, "Block "+l+" : resetting LRU");
+ Logger.minor(this, "Block " + l + " : resetting LRU");
lruVal = getNewRecentlyUsed();
} else {
- Logger.normal(this, "Block "+l+" : LRU "+lruVal);
+ Logger.minor(this, "Block " + l + " : LRU " + lruVal);
}
boolean readKey = false;
if(keysRAF != null && keyBuf != null && keysRAFLength > (l+1)*keyLength) {
From toad at freenetproject.org Thu May 1 15:50:15 2008
From: toad at freenetproject.org (toad at freenetproject.org)
Date: Thu, 1 May 2008 15:50:15 +0000 (UTC)
Subject: [freenet-cvs] r19652 - trunk/website/pages/en
Message-ID: <20080501155015.5AD02479C13@freenetproject.org>
Author: toad
Date: 2008-05-01 15:50:15 +0000 (Thu, 01 May 2008)
New Revision: 19652
Modified:
trunk/website/pages/en/download.php
Log:
You *can* just download it and click on it, but we recommend the above command lines as that may not work
Modified: trunk/website/pages/en/download.php
===================================================================
--- trunk/website/pages/en/download.php 2008-05-01 15:19:12 UTC (rev 19651)
+++ trunk/website/pages/en/download.php 2008-05-01 15:50:15 UTC (rev 19652)
@@ -56,6 +56,7 @@
wget http://downloads.freenetproject.org/alpha/installer/new_installer.jar
java -jar new_installer.jar
+Alternatively, downloading the installer and then clicking on it may work on some systems, but if there are problems we recommend the above command lines.
Or do the following on a headless system:
From toad at freenetproject.org Thu May 1 15:53:01 2008
From: toad at freenetproject.org (toad at freenetproject.org)
Date: Thu, 1 May 2008 15:53:01 +0000 (UTC)
Subject: [freenet-cvs] r19653 - trunk/website/pages/en
Message-ID: <20080501155301.A35EF479D21@freenetproject.org>
Author: toad
Date: 2008-05-01 15:53:01 +0000 (Thu, 01 May 2008)
New Revision: 19653
Modified:
trunk/website/pages/en/download.php
Log:
it -> the file
Modified: trunk/website/pages/en/download.php
===================================================================
--- trunk/website/pages/en/download.php 2008-05-01 15:50:15 UTC (rev 19652)
+++ trunk/website/pages/en/download.php 2008-05-01 15:53:01 UTC (rev 19653)
@@ -56,7 +56,7 @@
wget http://downloads.freenetproject.org/alpha/installer/new_installer.jar
java -jar new_installer.jar
-Alternatively, downloading the installer and then clicking on it may work on some systems, but if there are problems we recommend the above command lines.
+Alternatively, downloading the installer and then clicking on the file may work on some systems, but if there are problems we recommend the above command lines.
Or do the following on a headless system:
From toad at freenetproject.org Thu May 1 15:56:41 2008
From: toad at freenetproject.org (toad at freenetproject.org)
Date: Thu, 1 May 2008 15:56:41 +0000 (UTC)
Subject: [freenet-cvs] r19654 - trunk/website/pages/en
Message-ID: <20080501155641.B7E10479D79@freenetproject.org>
Author: toad
Date: 2008-05-01 15:56:41 +0000 (Thu, 01 May 2008)
New Revision: 19654
Modified:
trunk/website/pages/en/download.php
Log:
"Type on a command line" -> "Open a terminal and type:"
Same length, but more newbie friendly, they're usually called something like terminal.
Modified: trunk/website/pages/en/download.php
===================================================================
--- trunk/website/pages/en/download.php 2008-05-01 15:53:01 UTC (rev 19653)
+++ trunk/website/pages/en/download.php 2008-05-01 15:56:41 UTC (rev 19654)
@@ -51,7 +51,7 @@
You need to have a recent Java Runtime Environment (JRE). We have experienced best results with Sun's Java Runtime Environment which can be obtained via your package manager or from http://www.java.com/.
Java version 1.4.2 and later will work. However, be aware that there are applet security vulnerabilities in all versions prior to Java 1.5 update 4. Generally, we recommend using latest.
-Type on a command line :
+Open a terminal and type:
wget http://downloads.freenetproject.org/alpha/installer/new_installer.jar
java -jar new_installer.jar
From toad at freenetproject.org Thu May 1 17:51:33 2008
From: toad at freenetproject.org (toad at freenetproject.org)
Date: Thu, 1 May 2008 17:51:33 +0000 (UTC)
Subject: [freenet-cvs] r19655 - trunk/freenet/src/freenet/node/fcp
Message-ID: <20080501175133.A0EFD4797F5@freenetproject.org>
Author: toad
Date: 2008-05-01 17:51:33 +0000 (Thu, 01 May 2008)
New Revision: 19655
Modified:
trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java
Log:
Don't terminate the FCP connection on getting an insert with a bogus URI.
Modified: trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java 2008-05-01 15:56:41 UTC (rev 19654)
+++ trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java 2008-05-01 17:51:33 UTC (rev 19655)
@@ -218,7 +218,7 @@
outputHandler.queue(new ProtocolErrorMessage(e.protocolCode, false, e.getMessage(), e.ident, e.global));
return;
} catch (MalformedURLException e) {
- failedMessage = new ProtocolErrorMessage(ProtocolErrorMessage.FREENET_URI_PARSE_ERROR, true, null, id, message.global);
+ failedMessage = new ProtocolErrorMessage(ProtocolErrorMessage.FREENET_URI_PARSE_ERROR, false, null, id, message.global);
}
if(!persistent)
requestsByIdentifier.put(id, cp);
@@ -265,7 +265,7 @@
} catch (IdentifierCollisionException e) {
success = false;
} catch (MalformedURLException e) {
- failedMessage = new ProtocolErrorMessage(ProtocolErrorMessage.FREENET_URI_PARSE_ERROR, true, null, id, message.global);
+ failedMessage = new ProtocolErrorMessage(ProtocolErrorMessage.FREENET_URI_PARSE_ERROR, false, null, id, message.global);
}
if(!persistent) {
synchronized(this) {
From toad at freenetproject.org Thu May 1 17:54:29 2008
From: toad at freenetproject.org (toad at freenetproject.org)
Date: Thu, 1 May 2008 17:54:29 +0000 (UTC)
Subject: [freenet-cvs] r19656 - trunk/freenet/src/freenet/node/fcp
Message-ID: <20080501175429.B48C5479C13@freenetproject.org>
Author: toad
Date: 2008-05-01 17:54:29 +0000 (Thu, 01 May 2008)
New Revision: 19656
Modified:
trunk/freenet/src/freenet/node/fcp/ProtocolErrorMessage.java
Log:
Don't close the connection on getting a ProtocolErrorMessage from the client.
Should never happen, just confuses things.
Modified: trunk/freenet/src/freenet/node/fcp/ProtocolErrorMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/ProtocolErrorMessage.java 2008-05-01 17:51:33 UTC (rev 19655)
+++ trunk/freenet/src/freenet/node/fcp/ProtocolErrorMessage.java 2008-05-01 17:54:29 UTC (rev 19656)
@@ -165,7 +165,6 @@
public void run(FCPConnectionHandler handler, Node node) {
Logger.error(this, "Client reported protocol error");
- if(fatal) handler.close();
}
public String getName() {
From toad at freenetproject.org Thu May 1 17:55:27 2008
From: toad at freenetproject.org (toad at freenetproject.org)
Date: Thu, 1 May 2008 17:55:27 +0000 (UTC)
Subject: [freenet-cvs] r19657 - trunk/freenet/src/freenet/node/fcp
Message-ID: <20080501175527.6037E479CF7@freenetproject.org>
Author: toad
Date: 2008-05-01 17:55:27 +0000 (Thu, 01 May 2008)
New Revision: 19657
Modified:
trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java
Log:
Revert 19655, fatal protocol errors don't cause connection close.
Modified: trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java 2008-05-01 17:54:29 UTC (rev 19656)
+++ trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java 2008-05-01 17:55:27 UTC (rev 19657)
@@ -218,7 +218,7 @@
outputHandler.queue(new ProtocolErrorMessage(e.protocolCode, false, e.getMessage(), e.ident, e.global));
return;
} catch (MalformedURLException e) {
- failedMessage = new ProtocolErrorMessage(ProtocolErrorMessage.FREENET_URI_PARSE_ERROR, false, null, id, message.global);
+ failedMessage = new ProtocolErrorMessage(ProtocolErrorMessage.FREENET_URI_PARSE_ERROR, true, null, id, message.global);
}
if(!persistent)
requestsByIdentifier.put(id, cp);
@@ -265,7 +265,7 @@
} catch (IdentifierCollisionException e) {
success = false;
} catch (MalformedURLException e) {
- failedMessage = new ProtocolErrorMessage(ProtocolErrorMessage.FREENET_URI_PARSE_ERROR, false, null, id, message.global);
+ failedMessage = new ProtocolErrorMessage(ProtocolErrorMessage.FREENET_URI_PARSE_ERROR, true, null, id, message.global);
}
if(!persistent) {
synchronized(this) {
From toad at freenetproject.org Thu May 1 18:29:22 2008
From: toad at freenetproject.org (toad at freenetproject.org)
Date: Thu, 1 May 2008 18:29:22 +0000 (UTC)
Subject: [freenet-cvs] r19658 - trunk/freenet/src/freenet/clients/http
Message-ID: <20080501182922.6BAAB479D01@freenetproject.org>
Author: toad
Date: 2008-05-01 18:29:22 +0000 (Thu, 01 May 2008)
New Revision: 19658
Modified:
trunk/freenet/src/freenet/clients/http/SymlinkerToadlet.java
Log:
Logging
Modified: trunk/freenet/src/freenet/clients/http/SymlinkerToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/SymlinkerToadlet.java 2008-05-01 17:55:27 UTC (rev 19657)
+++ trunk/freenet/src/freenet/clients/http/SymlinkerToadlet.java 2008-05-01 18:29:22 UTC (rev 19658)
@@ -40,11 +40,8 @@
String fns[] = tslconfig.getStringArr("symlinks");
if (fns != null) {
for (int i = 0 ; i < fns.length ; i++) {
- //System.err.println("Load: " + StringArrOption.decode(fns[i]));
String tuple[] = fns[i].split("#");
if (tuple.length == 2)
- System.out.println("Adding link: " + tuple[0] + " => " + tuple[1]);
- if (tuple.length == 2)
addLink(tuple[0], tuple[1], false);
}
}
From toad at freenetproject.org Thu May 1 19:14:20 2008
From: toad at freenetproject.org (toad at freenetproject.org)
Date: Thu, 1 May 2008 19:14:20 +0000 (UTC)
Subject: [freenet-cvs] r19659 - trunk/freenet/src/freenet/clients/http
Message-ID: <20080501191420.511CF4798AB@freenetproject.org>
Author: toad
Date: 2008-05-01 19:14:20 +0000 (Thu, 01 May 2008)
New Revision: 19659
Modified:
trunk/freenet/src/freenet/clients/http/FProxyToadlet.java
Log:
Fixed #1942.
Modified: trunk/freenet/src/freenet/clients/http/FProxyToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/FProxyToadlet.java 2008-05-01 18:29:22 UTC (rev 19658)
+++ trunk/freenet/src/freenet/clients/http/FProxyToadlet.java 2008-05-01 19:14:20 UTC (rev 19659)
@@ -413,6 +413,12 @@
}
String requestedMimeType = httprequest.getParam("type", null);
String override = (requestedMimeType == null) ? "" : "?type="+URLEncoder.encode(requestedMimeType,true);
+ // No point passing ?force= across a redirect, since the key will change.
+ // However, there is every point in passing ?forcedownload.
+ if(httprequest.isParameterSet("forcedownload")) {
+ if(override.length() == 0) override = "?forcedownload";
+ else override = override+"&forcedownload";
+ }
try {
if(Logger.shouldLog(Logger.MINOR, this))
Logger.minor(this, "FProxy fetching "+key+" ("+maxSize+ ')');
From toad at freenetproject.org Thu May 1 19:38:01 2008
From: toad at freenetproject.org (toad at freenetproject.org)
Date: Thu, 1 May 2008 19:38:01 +0000 (UTC)
Subject: [freenet-cvs] r19660 - trunk/freenet/src/freenet/client/async
Message-ID: <20080501193801.578CA47AEF7@freenetproject.org>
Author: toad
Date: 2008-05-01 19:38:01 +0000 (Thu, 01 May 2008)
New Revision: 19660
Modified:
trunk/freenet/src/freenet/client/async/USKFetcher.java
Log:
Fix 0000793: Dupe detection on USK inserts breaking?
Modified: trunk/freenet/src/freenet/client/async/USKFetcher.java
===================================================================
--- trunk/freenet/src/freenet/client/async/USKFetcher.java 2008-05-01 19:14:20 UTC (rev 19659)
+++ trunk/freenet/src/freenet/client/async/USKFetcher.java 2008-05-01 19:38:01 UTC (rev 19660)
@@ -468,6 +468,8 @@
for(int i=0;i lastEd)
attempts[i].schedule();
else {
From toad at freenetproject.org Thu May 1 19:46:17 2008
From: toad at freenetproject.org (toad at freenetproject.org)
Date: Thu, 1 May 2008 19:46:17 +0000 (UTC)
Subject: [freenet-cvs] r19661 - trunk/freenet/src/freenet/clients/http
Message-ID: <20080501194617.E1C9C479707@freenetproject.org>
Author: toad
Date: 2008-05-01 19:46:17 +0000 (Thu, 01 May 2008)
New Revision: 19661
Modified:
trunk/freenet/src/freenet/clients/http/QueueToadlet.java
Log:
Fix the other half of 0002280: insert of key via queue page fails with invalid key
Modified: trunk/freenet/src/freenet/clients/http/QueueToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/QueueToadlet.java 2008-05-01 19:38:01 UTC (rev 19660)
+++ trunk/freenet/src/freenet/clients/http/QueueToadlet.java 2008-05-01 19:46:17 UTC (rev 19661)
@@ -278,6 +278,9 @@
} catch (FileNotFoundException e) {
this.writeError(L10n.getString("QueueToadlet.errorNoFileOrCannotRead"), L10n.getString("QueueToadlet.errorAccessDeniedFile", new String[]{ "file" }, new String[]{ file.getFilename() }), ctx);
return;
+ } catch (MalformedURLException mue1) {
+ writeError(L10n.getString("QueueToadlet.errorInvalidURI"), L10n.getString("QueueToadlet.errorInvalidURIToU"), ctx);
+ return;
}
writePermanentRedirect(ctx, "Done", "/queue/");
return;
From NEOatNHNG at freenetproject.org Thu May 1 21:21:50 2008
From: NEOatNHNG at freenetproject.org (NEOatNHNG at freenetproject.org)
Date: Thu, 1 May 2008 21:21:50 +0000 (UTC)
Subject: [freenet-cvs] r19662 - trunk/freenet/src/freenet/l10n
Message-ID: <20080501212150.29AD54798BD@freenetproject.org>
Author: NEOatNHNG
Date: 2008-05-01 21:21:49 +0000 (Thu, 01 May 2008)
New Revision: 19662
Modified:
trunk/freenet/src/freenet/l10n/freenet.l10n.de.properties
Log:
German language update (freenet.l10n.de.pre_v1145)
Modified: trunk/freenet/src/freenet/l10n/freenet.l10n.de.properties
===================================================================
--- trunk/freenet/src/freenet/l10n/freenet.l10n.de.properties 2008-05-01 19:46:17 UTC (rev 19661)
+++ trunk/freenet/src/freenet/l10n/freenet.l10n.de.properties 2008-05-01 21:21:49 UTC (rev 19662)
@@ -478,11 +478,20 @@
IPDetectorPluginManager.direct=Sie scheinen direkt mit dem Internet verbunden zu sein. Herzlichen Gl?ckwunsch, Sie sollten in der Lage sein, sich mit jedem anderen Freenet-Knoten zu verbinden.
IPDetectorPluginManager.directTitle=Direkte Internet-Verbindung erkannt
IPDetectorPluginManager.forwardPort=Ihr Knoten scheint sich hinter einem NAT-Ger?t zu befinden (f?r Details schauen Sie auf die Erreichbarkeits-Seite). Sie sollten, wenn m?glich, den UDP-Port (nicht TCP) ${port} weiterleiten um die Erreichbarkeit zu verbessern. Es ist m?glich, dass Sie dies bereits getan haben; Freenet braucht etwas Zeit um eine Portweiterleitung zu erkennen. F?r weitere Informationen schauen Sie ${link}hier${/link}.
+IPDetectorPluginManager.forwardPortMaybeForwarded=Ihr Knoten scheint sich hinter einem NAT-Ger?t zu befinden (Details finden Sie auf der Erreichbarkeits-Seite). Sie sollten, wenn m?glich, den UDP-Port (nicht TCP) ${port} weiterleiten um die Erreichbarkeit zu verbessern. Es ist m?glich, dass Sie dies bereits getan haben; Freenet braucht etwas Zeit um eine Portweiterleitung zu erkennen. Weitere Informationen finden Sie ${link}hier${/link}.
+IPDetectorPluginManager.forwardPortNotForwarded=Ihr Knoten scheint sich hinter einem NAT-Ger?t zu befinden (Details finden Sie auf der Erreichbarkeits-Seite). Sie sollten, wenn m?glich, den UDP-Port (nicht TCP) ${port} weiterleiten um die Erreichbarkeit zu verbessern. Es scheint, als ob der Port nicht weitergeleitet wird, Freenet kann dies jedoch nicht sicher erkennen. Weitere Informationen finden Sie ${link}hier${/link}.
IPDetectorPluginManager.forwardPortShort=Bitte leiten Sie den UDP-Port ${port} weiter.
+IPDetectorPluginManager.forwardPortShortMaybeForwarded=Bitte leiten Sie den UDP-Port ${port} weiter (vielleicht haben Sie dies schon getan).
+IPDetectorPluginManager.forwardPortShortNotForwarded=Bitte leiten Sie den UDP-Port ${port} weiter (er scheint noch nicht weitergeleitet zu sein).
IPDetectorPluginManager.forwardTwoPorts=Ihr Knoten scheint sich hinter einem NAT-Ger?t zu befinden (f?r Details schauen Sie auf die Erreichbarkeits-Seite). Sie sollten, wenn m?glich, die UDP-Ports (nicht TCP) ${port1} und ${port2} weiterleiten um die Erreichbarkeit zu verbessern. Es ist m?glich, dass Sie dies bereits getan haben; Freenet braucht etwas Zeit um eine Portweiterleitung zu erkennen. F?r weitere Informationen schauen Sie ${link}hier${/link}.
+IPDetectorPluginManager.forwardTwoPortsMaybeForwarded=Ihr Knoten scheint sich hinter einem NAT-Ger?t zu befinden (Details finden Sie auf der Erreichbarkeits-Seite). Sie sollten, wenn m?glich, die UDP-Ports (nicht TCP) ${port1} und ${port2} weiterleiten um die Erreichbarkeit zu verbessern. Es ist m?glich, dass Sie dies bereits getan haben; Freenet braucht etwas Zeit um eine Portweiterleitung zu erkennen. Weitere Informationen finden Sie ${link}hier${/link}.
+IPDetectorPluginManager.forwardTwoPortsNotForwarded=Ihr Knoten scheint sich hinter einem NAT-Ger?t zu befinden (Details finden Sie auf der Erreichbarkeits-Seite). Sie sollten, wenn m?glich, die UDP-Ports (nicht TCP) ${port1} und ${port2} weiterleiten um die Erreichbarkeit zu verbessern. Es scheint, als ob der Port nicht weitergeleitet wird, Freenet kann dies jedoch nicht sicher erkennen. Weitere Informationen finden Sie ${link}hier${/link}.
IPDetectorPluginManager.forwardTwoPortsShort=Bitte leiten Sie die UDP-Ports ${port1} und ${port2} weiter.
+IPDetectorPluginManager.forwardTwoPortsShortMaybeForwarded=Bitte leiten Sie die UDP-Ports ${port1} und ${port2} weiter (vielleicht haben Sie dies schon getan).
+IPDetectorPluginManager.forwardTwoPortsShortNotForwarded=Bitte leiten Sie die UDP-Ports ${port1} und ${port2} weiter (sie scheinen noch nicht weitergeleitet zu sein).
IPDetectorPluginManager.fullCone=Ihre Internet-Verbindung scheint sich hinter einem "full cone"-NAT (Router) zu befinden. Herzlichen Gl?ckwunsch, Ihr Knoten sollte in der Lage sein, sich mit jedem anderen Knoten zu verbinden.
IPDetectorPluginManager.fullConeTitle="Full cone"-NAT erkannt
+IPDetectorPluginManager.maybeAlreadyForwarded=Vielleicht haben Sie dies schon getan (f?r Freenet ist es schwer dies zu erkennen).
IPDetectorPluginManager.noConnectivity=Ihre Internet-Verbindung scheint UDP nicht zu unterst?tzen. Wenn diese Erkennung richtig ist, wird Freenet auf Ihrem Computer derzeit wahrscheinlich nicht funktionieren.
IPDetectorPluginManager.noConnectivityTitle=Keine UDP-Konnektivit?t
IPDetectorPluginManager.noConnectivityshort=Schwerwiegende Verbindungsprobleme: Keine UDP-Verbindung, Freenet wird nicht funktionieren!
@@ -1005,8 +1014,8 @@
SimpleToadletServer.bindToLong=Zu benutzende IP-Adresse
SimpleToadletServer.cannotChangePortOnTheFly=Kann die FProxy-Port-Nummer nicht im laufenden Betrieb ?ndern
SimpleToadletServer.couldNotChangeBindTo=Konnte die von FProxy zu benutzende Adresse nicht ?ndern: ${error}.
-SimpleToadletServer.cssName=CSS-Name
-SimpleToadletServer.cssNameLong=Name des CSS das FProxy benutzen soll
+SimpleToadletServer.cssName=Design der Web-Oberfl?che
+SimpleToadletServer.cssNameLong=W?hlen Sie ein Design f?r die Web-Oberfl?che aus
SimpleToadletServer.cssOverride=Das CSS durch eine benutzerdefiniertes ersetzen (WARNUNG!)
SimpleToadletServer.cssOverrideCantRead=Wir k?nnen die gegebene CSS-Ersatz-Datei nicht lesen: ${filename}
SimpleToadletServer.cssOverrideLong=Diese Einstellung erlaubt es Ihnen, die CSS-Datei des Knotens mit einer benutzerdefinierten Datei zu ersetzen. WARNUNG: CSS-Dateien k?nnen gef?hrlich sein und werden nicht gefiltert! Benutzung auf eigene Gefahr. (denken Sie dar?ber nach devl at freenetproject zu kontaktieren um sie in die Haupt-Distribution aufnehmen zu lassen ;-) )
From NEOatNHNG at freenetproject.org Thu May 1 21:34:15 2008
From: NEOatNHNG at freenetproject.org (NEOatNHNG at freenetproject.org)
Date: Thu, 1 May 2008 21:34:15 +0000 (UTC)
Subject: [freenet-cvs] r19663 - trunk/website/pages/de
Message-ID: <20080501213415.826F5479B78@freenetproject.org>
Author: NEOatNHNG
Date: 2008-05-01 21:34:15 +0000 (Thu, 01 May 2008)
New Revision: 19663
Modified:
trunk/website/pages/de/download.php
Log:
Update German download page
Modified: trunk/website/pages/de/download.php
===================================================================
--- trunk/website/pages/de/download.php 2008-05-01 21:21:49 UTC (rev 19662)
+++ trunk/website/pages/de/download.php 2008-05-01 21:34:15 UTC (rev 19663)
@@ -85,13 +85,18 @@
dass in den Versionen vor Java 1.5 Update 4 Sicherheitsl?cken im Applet sind.
Generell empfehlen wir die neuste Version zu benutzen.
-Geben Sie folgendes in einer Kommandozeile ein:
+?ffnen Sie eine Kommandozeile (Terminal) und geben Sie folgendes ein:
wget http://downloads.freenetproject.org/alpha/installer/new_installer.jar
java -jar new_installer.jar
+Alternativ k?nnen Sie auf manchen Systemen auch das Installationsprogramm herunterladen und es anklicken, wenn jedoch
+Probleme auftreten, empfehlen wir die obigen Kommandos.
+
Oder folgendes, wenn es sich um ein System ohne grafische Oberfl?che handelt:
@@ -105,7 +110,9 @@
um herauszufinden wie man den Web-Zugriff von einem entfernten Computer
aktiviert.
From toad at freenetproject.org Thu May 1 22:03:02 2008
From: toad at freenetproject.org (toad at freenetproject.org)
Date: Thu, 1 May 2008 22:03:02 +0000 (UTC)
Subject: [freenet-cvs] r19664 - trunk/freenet/src/freenet/node
Message-ID: <20080501220302.9D719479A1E@freenetproject.org>
Author: toad
Date: 2008-05-01 22:03:02 +0000 (Thu, 01 May 2008)
New Revision: 19664
Modified:
trunk/freenet/src/freenet/node/OpennetManager.java
Log:
Turn off 1-peer-per-kB/sec, since testing is negative.
Modified: trunk/freenet/src/freenet/node/OpennetManager.java
===================================================================
--- trunk/freenet/src/freenet/node/OpennetManager.java 2008-05-01 21:34:15 UTC (rev 19663)
+++ trunk/freenet/src/freenet/node/OpennetManager.java 2008-05-01 22:03:02 UTC (rev 19664)
@@ -93,7 +93,7 @@
static final int MAX_OPENNET_NODEREF_LENGTH = 32768;
/** Enable scaling of peers with bandwidth? */
- static final boolean ENABLE_PEERS_PER_KB_OUTPUT = true;
+ static final boolean ENABLE_PEERS_PER_KB_OUTPUT = false;
/** Target bandwidth usage - above this, we use MAX_PEERS_FOR_SCALING */
static final int TARGET_BANDWIDTH_USAGE = 20*1024; // 20 peers at 20K/sec.
/** Minimum number of peers */
From toad at freenetproject.org Thu May 1 22:05:10 2008
From: toad at freenetproject.org (toad at freenetproject.org)
Date: Thu, 1 May 2008 22:05:10 +0000 (UTC)
Subject: [freenet-cvs] r19665 - trunk/freenet/src/freenet/node
Message-ID: <20080501220510.EFAF0479D53@freenetproject.org>
Author: toad
Date: 2008-05-01 22:05:10 +0000 (Thu, 01 May 2008)
New Revision: 19665
Modified:
trunk/freenet/src/freenet/node/OpennetManager.java
Log:
Simplify logic slightly, fix not counting darknet connections against a scaled peers limit.
Modified: trunk/freenet/src/freenet/node/OpennetManager.java
===================================================================
--- trunk/freenet/src/freenet/node/OpennetManager.java 2008-05-01 22:03:02 UTC (rev 19664)
+++ trunk/freenet/src/freenet/node/OpennetManager.java 2008-05-01 22:05:10 UTC (rev 19665)
@@ -484,17 +484,18 @@
}
protected int getNumberOfConnectedPeersToAim() {
- int max = Integer.MAX_VALUE;
+ int max = node.getMaxOpennetPeers();
if(ENABLE_PEERS_PER_KB_OUTPUT) {
int obwLimit = node.getOutputBandwidthLimit();
if(obwLimit >= TARGET_BANDWIDTH_USAGE) {
- max = MAX_PEERS_FOR_SCALING;
+ max = Math.min(max, MAX_PEERS_FOR_SCALING);
} else {
- max = obwLimit * MAX_PEERS_FOR_SCALING / TARGET_BANDWIDTH_USAGE;
- if(max < MIN_PEERS_FOR_SCALING) max = MIN_PEERS_FOR_SCALING;
+ int limit = Math.min(max, obwLimit * MAX_PEERS_FOR_SCALING / TARGET_BANDWIDTH_USAGE);
+ if(limit < MIN_PEERS_FOR_SCALING) limit = MIN_PEERS_FOR_SCALING;
+ max = Math.min(max, limit);
}
}
- return Math.min(max, node.getMaxOpennetPeers() - node.peers.countConnectedDarknetPeers());
+ return max - node.peers.countConnectedDarknetPeers();
}
/**
From NEOatNHNG at freenetproject.org Thu May 1 22:28:06 2008
From: NEOatNHNG at freenetproject.org (NEOatNHNG at freenetproject.org)
Date: Thu, 1 May 2008 22:28:06 +0000 (UTC)
Subject: [freenet-cvs] r19666 - trunk/website
Message-ID: <20080501222806.9BC514798F9@freenetproject.org>
Author: NEOatNHNG
Date: 2008-05-01 22:28:06 +0000 (Thu, 01 May 2008)
New Revision: 19666
Modified:
trunk/website/style.css
Log:
Fix homepage layout for little windows
Modified: trunk/website/style.css
===================================================================
--- trunk/website/style.css 2008-05-01 22:05:10 UTC (rev 19665)
+++ trunk/website/style.css 2008-05-01 22:28:06 UTC (rev 19666)
@@ -31,7 +31,8 @@
font-size: 14px;
font-weight: normal;
color: #000000;
- width: 600px;
+ /* width: 600px; */
+ max-width: 600px;
float: left;
}
@@ -78,7 +79,7 @@
div#menu a:hover {background-color:#eee;}
.menu {
- width: 155px;
+ /* width: 155px; */
font-size: 16px;
list-style-type: none;
list-style-position: inside;
From NEOatNHNG at freenetproject.org Thu May 1 23:26:20 2008
From: NEOatNHNG at freenetproject.org (NEOatNHNG at freenetproject.org)
Date: Thu, 1 May 2008 23:26:20 +0000 (UTC)
Subject: [freenet-cvs] r19669 - trunk/website
Message-ID: <20080501232620.6EA9E47B2F8@freenetproject.org>
Author: NEOatNHNG
Date: 2008-05-01 23:26:20 +0000 (Thu, 01 May 2008)
New Revision: 19669
Modified:
trunk/website/style.css
Log:
Really fix homepage layout for little windows
Modified: trunk/website/style.css
===================================================================
--- trunk/website/style.css 2008-05-01 22:56:16 UTC (rev 19668)
+++ trunk/website/style.css 2008-05-01 23:26:20 UTC (rev 19669)
@@ -32,8 +32,8 @@
font-weight: normal;
color: #000000;
/* width: 600px; */
- max-width: 600px;
- float: left;
+ max-width: 700px;
+ /* float: left; */
}
From NEOatNHNG at freenetproject.org Thu May 1 23:30:26 2008
From: NEOatNHNG at freenetproject.org (NEOatNHNG at freenetproject.org)
Date: Thu, 1 May 2008 23:30:26 +0000 (UTC)
Subject: [freenet-cvs] r19670 - trunk/website
Message-ID: <20080501233026.1022A47B30B@freenetproject.org>
Author: NEOatNHNG
Date: 2008-05-01 23:30:25 +0000 (Thu, 01 May 2008)
New Revision: 19670
Modified:
trunk/website/style.css
Log:
Doh, forgot to paste the rest of the changes
Modified: trunk/website/style.css
===================================================================
--- trunk/website/style.css 2008-05-01 23:26:20 UTC (rev 19669)
+++ trunk/website/style.css 2008-05-01 23:30:25 UTC (rev 19670)
@@ -13,6 +13,8 @@
background: #fafafa;
text-decoration: none;
margin-top: 15px;
+ margin-right: 10px;
+ margin-bottom: 10px;
}
From NEOatNHNG at freenetproject.org Thu May 1 23:57:31 2008
From: NEOatNHNG at freenetproject.org (NEOatNHNG at freenetproject.org)
Date: Thu, 1 May 2008 23:57:31 +0000 (UTC)
Subject: [freenet-cvs] r19671 - trunk/website
Message-ID: <20080501235731.B5FD84797CB@freenetproject.org>
Author: NEOatNHNG
Date: 2008-05-01 23:57:31 +0000 (Thu, 01 May 2008)
New Revision: 19671
Modified:
trunk/website/style.css
Log:
Another little adjustment
Modified: trunk/website/style.css
===================================================================
--- trunk/website/style.css 2008-05-01 23:30:25 UTC (rev 19670)
+++ trunk/website/style.css 2008-05-01 23:57:31 UTC (rev 19671)
@@ -13,7 +13,7 @@
background: #fafafa;
text-decoration: none;
margin-top: 15px;
- margin-right: 10px;
+ margin-right: 20px;
margin-bottom: 10px;
}
From nextgens at freenetproject.org Fri May 2 03:50:03 2008
From: nextgens at freenetproject.org (nextgens at freenetproject.org)
Date: Fri, 2 May 2008 03:50:03 +0000 (UTC)
Subject: [freenet-cvs] r19672 - trunk/apps/new_installer
Message-ID: <20080502035003.6B37E479828@freenetproject.org>
Author: nextgens
Date: 2008-05-02 03:50:03 +0000 (Fri, 02 May 2008)
New Revision: 19672
Modified:
trunk/apps/new_installer/ProcessPanel.Spec.xml
trunk/apps/new_installer/install.xml
Log:
new_installer: try the cronjob on macos as well... it might work there too ;)
Modified: trunk/apps/new_installer/ProcessPanel.Spec.xml
===================================================================
--- trunk/apps/new_installer/ProcessPanel.Spec.xml 2008-05-01 23:57:31 UTC (rev 19671)
+++ trunk/apps/new_installer/ProcessPanel.Spec.xml 2008-05-02 03:50:03 UTC (rev 19672)
@@ -129,10 +129,12 @@
+
Modified: trunk/apps/new_installer/install.xml
===================================================================
--- trunk/apps/new_installer/install.xml 2008-05-01 23:57:31 UTC (rev 19671)
+++ trunk/apps/new_installer/install.xml 2008-05-02 03:50:03 UTC (rev 19672)
@@ -226,7 +226,9 @@
-
+
+
+
Start the node automatically on startup. Strongly recommended.
From j16sdiz at freenetproject.org Fri May 2 09:44:53 2008
From: j16sdiz at freenetproject.org (j16sdiz at freenetproject.org)
Date: Fri, 2 May 2008 09:44:53 +0000 (UTC)
Subject: [freenet-cvs] r19673 - trunk/freenet/src/freenet/crypt
Message-ID: <20080502094453.961F64797B5@freenetproject.org>
Author: j16sdiz
Date: 2008-05-02 09:44:53 +0000 (Fri, 02 May 2008)
New Revision: 19673
Modified:
trunk/freenet/src/freenet/crypt/SHA256.java
Log:
remove unused method (all our method now use JVM provided SHA-256)
Modified: trunk/freenet/src/freenet/crypt/SHA256.java
===================================================================
--- trunk/freenet/src/freenet/crypt/SHA256.java 2008-05-02 03:50:03 UTC (rev 19672)
+++ trunk/freenet/src/freenet/crypt/SHA256.java 2008-05-02 09:44:53 UTC (rev 19673)
@@ -43,264 +43,17 @@
import freenet.node.Node;
import freenet.node.NodeInitException;
-import freenet.support.HexUtil;
import freenet.support.Logger;
import freenet.support.io.Closer;
/**
* @author Jeroen C. van Gelderen (gelderen at cryptix.org)
*/
-public class SHA256 implements Digest {
-
-// Constants
-//...........................................................................
+public class SHA256 {
/** Size (in bytes) of this hash */
private static final int HASH_SIZE = 32;
- private static final int BLOCK_SIZE = 64;
- /** 64 byte buffer */
- private final byte[] buf;
- /** Buffer offset */
- private int bufOff;
- /** Number of bytes hashed 'till now. */
- private long byteCount;
- /** Round constants */
- private static final int K[] = {
- 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
- 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
- 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
- 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
- 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
- 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
- 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
- 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
- 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
- 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
- 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
- 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
- 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
- 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
- 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
- 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
- };
-// Instance variables
-//...........................................................................
- /** 8 32-bit words (interim result) */
- private final int[] context;
- /** Expanded message block buffer */
- private final int[] buffer;
-// Constructors
-//...........................................................................
- public SHA256() {
- this.context = new int[8];
- this.buffer = new int[64];
- this.buf = new byte[64];
- coreReset();
- }
-
-// Concreteness
-//...........................................................................
- protected void coreDigest(byte[] buf, int off) {
- for(int i = 0; i < context.length; i++)
- for(int j = 0; j < 4; j++)
- buf[off + (i * 4 + (3 - j))] = (byte) (context[i] >>> (8 * j));
- }
-
- protected void coreReset() {
- this.bufOff = 0;
- this.byteCount = 0;
-
- // initial values
- context[0] = 0x6a09e667;
- context[1] = 0xbb67ae85;
- context[2] = 0x3c6ef372;
- context[3] = 0xa54ff53a;
- context[4] = 0x510e527f;
- context[5] = 0x9b05688c;
- context[6] = 0x1f83d9ab;
- context[7] = 0x5be0cd19;
- }
-
- protected void coreUpdate(byte[] block, int offset) {
-
- int[] W = buffer;
-
- // extract the bytes into our working buffer
- for(int i = 0; i < 16; i++)
- W[i] = (block[offset++]) << 24 |
- (block[offset++] & 0xFF) << 16 |
- (block[offset++] & 0xFF) << 8 |
- (block[offset++] & 0xFF);
-
- // expand
- for(int i = 16; i < 64; i++)
- W[i] = sig1(W[i - 2]) + W[i - 7] + sig0(W[i - 15]) + W[i - 16];
-
- int a = context[0];
- int b = context[1];
- int c = context[2];
- int d = context[3];
- int e = context[4];
- int f = context[5];
- int g = context[6];
- int h = context[7];
-
- // run 64 rounds
- for(int i = 0; i < 64; i++) {
- int T1 = h + Sig1(e) + Ch(e, f, g) + K[i] + W[i];
- int T2 = Sig0(a) + Maj(a, b, c);
- h = g;
- g = f;
- f = e;
- e = d + T1;
- d = c;
- c = b;
- b = a;
- a = T1 + T2;
- }
-
- // merge
- context[0] += a;
- context[1] += b;
- context[2] += c;
- context[3] += d;
- context[4] += e;
- context[5] += f;
- context[6] += g;
- context[7] += h;
- }
-
- private final int Ch(int x, int y, int z) {
- return (x & y) ^ (~x & z);
- }
-
- private final int Maj(int x, int y, int z) {
- return (x & y) ^ (x & z) ^ (y & z);
- }
-
- private final int Sig0(int x) {
- return S(2, x) ^ S(13, x) ^ S(22, x);
- }
-
- private final int Sig1(int x) {
- return S(6, x) ^ S(11, x) ^ S(25, x);
- }
-
- private final int sig0(int x) {
- return S(7, x) ^ S(18, x) ^ R(3, x);
- }
-
- private final int sig1(int x) {
- return S(17, x) ^ S(19, x) ^ R(10, x);
- }
-
- private final int R(int off, int x) {
- return (x >>> off);
- }
-
- private final int S(int off, int x) {
- return (x >>> off) | (x << (32 - off));
- }
-
- private int privateDigest(byte[] buf, int offset, int len, boolean reset) {
- //#ASSERT(this.bufOff < BLOCK_SIZE);
-
- this.buf[this.bufOff++] = (byte) 0x80;
-
- int lenOfBitLen = 8;
- int C = BLOCK_SIZE - lenOfBitLen;
- if(this.bufOff > C) {
- while(this.bufOff < BLOCK_SIZE) {
- this.buf[this.bufOff++] = (byte) 0x00;
- }
-
- coreUpdate(this.buf, 0);
- this.bufOff = 0;
- }
-
- while(this.bufOff < C) {
- this.buf[this.bufOff++] = (byte) 0x00;
- }
-
- long bitCount = byteCount * 8;
-
- for(int i = 56; i >= 0; i -= 8)
- this.buf[this.bufOff++] = (byte) (bitCount >>> (i));
-
- coreUpdate(this.buf, 0);
- coreDigest(buf, offset);
-
- if(reset)
- coreReset();
- return HASH_SIZE;
- }
-
-
- // Freenet Digest interface methods
/**
- * retrieve the value of a hash, by filling the provided int[] with
- * n elements of the hash (where n is the bitlength of the hash/32)
- * @param digest int[] into which to place n elements
- * @param offset index of first of the n elements
- **/
- public void extract(int[] digest, int offset) {
- System.arraycopy(context, 0, digest, offset, context.length);
- }
-
- /**
- * Add one byte to the digest. When this is implemented
- * all of the abstract class methods end up calling
- * this method for types other than bytes.
- * @param b byte to add
- */
- public void update(byte b) {
-
- byteCount += 1;
- buf[bufOff++] = b;
- if(bufOff == BLOCK_SIZE) {
- coreUpdate(buf, 0);
- bufOff = 0;
- }
-
- }
-
- /**
- * Add many bytes to the digest.
- * @param input byte data to add
- * @param offset start byte
- * @param length number of bytes to hash
- */
- public void update(byte[] input, int offset, int length) {
- byteCount += length;
-
- int todo;
- while(length >= (todo = BLOCK_SIZE - this.bufOff)) {
- System.arraycopy(input, offset, this.buf, this.bufOff, todo);
- coreUpdate(this.buf, 0);
- length -= todo;
- offset += todo;
- this.bufOff = 0;
- }
-
- System.arraycopy(input, offset, this.buf, this.bufOff, length);
- bufOff += length;
- }
-
- public void update(byte[] data) {
- update(data, 0, data.length);
- }
-
- /**
- * Returns the completed digest, reinitializing the hash function;
- * @return the byte array result
- */
- public byte[] digest() {
- byte[] tmp = new byte[HASH_SIZE];
- privateDigest(tmp, 0, HASH_SIZE, true);
- return tmp;
- }
-
- /**
* It won't reset the Message Digest for you!
* @param InputStream
* @param MessageDigest
@@ -321,39 +74,6 @@
}
}
- public static byte[] hash(InputStream is) throws IOException {
- MessageDigest md = SHA256.getMessageDigest();
- md.reset();
- hash(is, md);
- byte[] result = md.digest();
- SHA256.returnMessageDigest(md);
-
- return result;
- }
-
- /**
- * Write the completed digest into the given buffer.
- * @param reset If true, the hash function is reinitialized
- */
- public void digest(boolean reset, byte[] buffer, int offset) {
- privateDigest(buf, offset, buffer.length, true);
- }
-
- /**
- * Return the hash size of this digest in bits
- */
- public final int digestSize() {
- return HASH_SIZE << 3;
- }
-
- public String doHash(String s) {
- coreReset();
- for(int i = 0; i < s.length(); i++) {
- this.update((byte) s.charAt(i));
- }
- byte[] d = digest();
- return HexUtil.bytesToHex(d);
- }
static private final Vector digests = new Vector();
/**
@@ -396,28 +116,7 @@
return hash;
}
- public static void main(String[] args) {
- byte[] buffer = new byte[1024];
- SHA256 s = new SHA256();
- try {
- while(true) {
- int rc = System.in.read(buffer);
- if(rc > 0)
- s.update(buffer, 0, rc);
- else
- break;
- }
- } catch(java.io.IOException e) {
- }
- byte[] rv = s.digest();
- System.out.println(HexUtil.bytesToHex(rv));
- }
-
public static int getDigestLength() {
return HASH_SIZE;
}
-
- public static Digest getInstance() {
- return new SHA256();
- }
}
From j16sdiz at freenetproject.org Fri May 2 10:09:13 2008
From: j16sdiz at freenetproject.org (j16sdiz at freenetproject.org)
Date: Fri, 2 May 2008 10:09:13 +0000 (UTC)
Subject: [freenet-cvs] r19674 - trunk/freenet/src/freenet/crypt
Message-ID: <20080502100913.BD7E34790AB@freenetproject.org>
Author: j16sdiz
Date: 2008-05-02 10:09:13 +0000 (Fri, 02 May 2008)
New Revision: 19674
Modified:
trunk/freenet/src/freenet/crypt/SHA256.java
Log:
limit number of cached SHA256 md
Modified: trunk/freenet/src/freenet/crypt/SHA256.java
===================================================================
--- trunk/freenet/src/freenet/crypt/SHA256.java 2008-05-02 09:44:53 UTC (rev 19673)
+++ trunk/freenet/src/freenet/crypt/SHA256.java 2008-05-02 10:09:13 UTC (rev 19674)
@@ -105,6 +105,8 @@
String algo = md256.getAlgorithm();
if(!(algo.equals("SHA-256") || algo.equals("SHA256")))
throw new IllegalArgumentException("Should be SHA-256 but is " + algo);
+ if (digests.size() > 16) // don't cache too many of them
+ return;
md256.reset();
digests.add(md256);
}
From j16sdiz at freenetproject.org Fri May 2 10:10:12 2008
From: j16sdiz at freenetproject.org (j16sdiz at freenetproject.org)
Date: Fri, 2 May 2008 10:10:12 +0000 (UTC)
Subject: [freenet-cvs] r19675 - in trunk/freenet/src/freenet: crypt node
store support
Message-ID: <20080502101013.00472479738@freenetproject.org>
Author: j16sdiz
Date: 2008-05-02 10:10:12 +0000 (Fri, 02 May 2008)
New Revision: 19675
Modified:
trunk/freenet/src/freenet/crypt/SHA256.java
trunk/freenet/src/freenet/node/MemoryChecker.java
trunk/freenet/src/freenet/node/Node.java
trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
trunk/freenet/src/freenet/support/OOMHandler.java
trunk/freenet/src/freenet/support/OOMHook.java
Log:
alternative low memory / out of memory handling
Modified: trunk/freenet/src/freenet/crypt/SHA256.java
===================================================================
--- trunk/freenet/src/freenet/crypt/SHA256.java 2008-05-02 10:09:13 UTC (rev 19674)
+++ trunk/freenet/src/freenet/crypt/SHA256.java 2008-05-02 10:10:12 UTC (rev 19675)
@@ -44,6 +44,8 @@
import freenet.node.Node;
import freenet.node.NodeInitException;
import freenet.support.Logger;
+import freenet.support.OOMHandler;
+import freenet.support.OOMHook;
import freenet.support.io.Closer;
/**
@@ -105,7 +107,7 @@
String algo = md256.getAlgorithm();
if(!(algo.equals("SHA-256") || algo.equals("SHA256")))
throw new IllegalArgumentException("Should be SHA-256 but is " + algo);
- if (digests.size() > 16) // don't cache too many of them
+ if (digests.size() > 16 || noCache) // don't cache too many of them
return;
md256.reset();
digests.add(md256);
@@ -121,4 +123,20 @@
public static int getDigestLength() {
return HASH_SIZE;
}
+
+ private static boolean noCache = false;
+
+ static {
+ OOMHandler.addOOMHook(new OOMHook() {
+ public void handleLowMemory() throws Exception {
+ digests.clear();
+ noCache = true;
+ }
+
+ public void handleOutOfMemory() throws Exception {
+ digests.clear();
+ noCache = true;
+ }
+ });
+ }
}
Modified: trunk/freenet/src/freenet/node/MemoryChecker.java
===================================================================
--- trunk/freenet/src/freenet/node/MemoryChecker.java 2008-05-02 10:09:13 UTC (rev 19674)
+++ trunk/freenet/src/freenet/node/MemoryChecker.java 2008-05-02 10:10:12 UTC (rev 19675)
@@ -4,6 +4,7 @@
package freenet.node;
import freenet.support.Logger;
+import freenet.support.OOMHandler;
import freenet.support.SizeUtil;
public class MemoryChecker implements Runnable {
@@ -42,6 +43,11 @@
Logger.normal(this, "Memory in use: "+SizeUtil.formatSize((r.totalMemory()-r.freeMemory())));
+ if (r.freeMemory() < 4096 * 1024 * 1024) { // free memory < 8 MB
+ Logger.error(this, "memory too low, trying to free some");
+ OOMHandler.lowMemory();
+ }
+
int sleeptime = aggressiveGCModificator;
if(sleeptime <= 0) { // We are done
ps.queueTimedJob(this, 120 * 250); // 30 sec
Modified: trunk/freenet/src/freenet/node/Node.java
===================================================================
--- trunk/freenet/src/freenet/node/Node.java 2008-05-02 10:09:13 UTC (rev 19674)
+++ trunk/freenet/src/freenet/node/Node.java 2008-05-02 10:10:12 UTC (rev 19675)
@@ -124,7 +124,7 @@
/**
* @author amphibian
*/
-public class Node implements TimeSkewDetectorCallback, GetPubkey, OOMHook {
+public class Node implements TimeSkewDetectorCallback, GetPubkey {
private static boolean logMINOR;
@@ -1604,8 +1604,6 @@
e.printStackTrace();
throw new NodeInitException(NodeInitException.EXIT_COULD_NOT_START_UPDATER, "Could not create Updater: "+e);
}
-
- OOMHandler.addOOMHook(this);
Logger.normal(this, "Node constructor completed");
System.out.println("Node constructor completed");
@@ -3306,23 +3304,4 @@
public void setDispatcherHook(NodeDispatcherCallback cb) {
this.dispatcher.setHook(cb);
}
-
- /**
- * Free some memory
- */
- public void handleOOM() throws Exception {
- if (cachedPubKeys != null) {
- Object value;
- do {
- value = cachedPubKeys.popKey();
- } while (value != null);
- }
- if (recentlyCompletedIDs != null) {
- synchronized (recentlyCompletedIDs) {
- // half it size
- while (recentlyCompletedIDs.size() > MAX_RECENTLY_COMPLETED_IDS / 2)
- recentlyCompletedIDs.pop();
- }
- }
- }
}
Modified: trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
===================================================================
--- trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2008-05-02 10:09:13 UTC (rev 19674)
+++ trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2008-05-02 10:10:12 UTC (rev 19675)
@@ -2239,15 +2239,30 @@
bf.get(data);
}
- public void handleOOM() throws Exception {
- if (storeRAF != null)
- storeRAF.getFD().sync();
- if (keysRAF != null)
- keysRAF.getFD().sync();
- if (lruRAF != null)
- lruRAF.getFD().sync();
+ public void handleLowMemory() throws Exception {
+ // Flush all
+ if (storeFC != null)
+ storeFC.force(true);
+ if (keysFC != null)
+ keysFC.force(true);
+ if (lruFC != null)
+ lruFC.force(true);
}
+ public void handleOutOfMemory() throws Exception {
+ // database likely to be corrupted,
+ // reconstruct it just in case
+ reconstructFile.createNewFile();
+
+ // Flush all
+ if (storeFC != null)
+ storeFC.force(true);
+ if (keysFC != null)
+ keysFC.force(true);
+ if (lruFC != null)
+ lruFC.force(true);
+ }
+
/**
* @return
*/
Modified: trunk/freenet/src/freenet/support/OOMHandler.java
===================================================================
--- trunk/freenet/src/freenet/support/OOMHandler.java 2008-05-02 10:09:13 UTC (rev 19674)
+++ trunk/freenet/src/freenet/support/OOMHandler.java 2008-05-02 10:10:12 UTC (rev 19675)
@@ -33,6 +33,30 @@
}
}
+ /**
+ * Call this when running low of memory
+ */
+ public static void lowMemory() {
+ System.gc();
+ System.runFinalization();
+
+ // iterate all oom hooks
+ Iterator it = oomHooks.iterator();
+ while (it.hasNext()) {
+ OOMHook hook = ((OOMHook) it.next());
+ if (hook != null) {
+ try {
+ hook.handleLowMemory();
+ } catch (Throwable t) {
+ //ignore
+ }
+ }
+ }
+
+ System.gc();
+ System.runFinalization();
+ }
+
public static void handleOOM(OutOfMemoryError e) {
if (isOOM) {
Logger.error(null, "Double OOM", e);
@@ -51,20 +75,18 @@
System.gc();
System.runFinalization();
-
+
// iterate all oom hooks
Iterator it = oomHooks.iterator();
while (it.hasNext()) {
OOMHook hook = ((OOMHook) it.next());
if (hook != null) {
try {
- hook.handleOOM();
+ hook.handleOutOfMemory();
} catch (Throwable t) {
//ignore
}
}
-
- System.gc();
}
System.gc();
Modified: trunk/freenet/src/freenet/support/OOMHook.java
===================================================================
--- trunk/freenet/src/freenet/support/OOMHook.java 2008-05-02 10:09:13 UTC (rev 19674)
+++ trunk/freenet/src/freenet/support/OOMHook.java 2008-05-02 10:10:12 UTC (rev 19675)
@@ -5,9 +5,14 @@
*/
public interface OOMHook {
/**
- * Handle OutOfMemoryError
+ * Handle running low of memory
*
* (try to free some cache, save the files, etc).
*/
- void handleOOM() throws Exception;
+ void handleLowMemory() throws Exception;
+
+ /**
+ * Handle running out of memory
+ */
+ void handleOutOfMemory() throws Exception;
}
From nextgens at freenetproject.org Fri May 2 10:51:22 2008
From: nextgens at freenetproject.org (nextgens at freenetproject.org)
Date: Fri, 2 May 2008 10:51:22 +0000 (UTC)
Subject: [freenet-cvs] r19676 - trunk/apps/new_installer
Message-ID: <20080502105122.6303D4799CF@freenetproject.org>
Author: nextgens
Date: 2008-05-02 10:51:22 +0000 (Fri, 02 May 2008)
New Revision: 19676
Modified:
trunk/apps/new_installer/ProcessPanel.Spec.xml
Log:
new_installer: doh
Modified: trunk/apps/new_installer/ProcessPanel.Spec.xml
===================================================================
--- trunk/apps/new_installer/ProcessPanel.Spec.xml 2008-05-02 10:10:12 UTC (rev 19675)
+++ trunk/apps/new_installer/ProcessPanel.Spec.xml 2008-05-02 10:51:22 UTC (rev 19676)
@@ -191,6 +191,11 @@
+
+
+
+
+
From nextgens at freenetproject.org Fri May 2 11:03:20 2008
From: nextgens at freenetproject.org (nextgens at freenetproject.org)
Date: Fri, 2 May 2008 11:03:20 +0000 (UTC)
Subject: [freenet-cvs] r19677 - trunk/apps/new_installer
Message-ID: <20080502110320.71C2047B2FD@freenetproject.org>
Author: nextgens
Date: 2008-05-02 11:03:20 +0000 (Fri, 02 May 2008)
New Revision: 19677
Modified:
trunk/apps/new_installer/ProcessPanel.Spec.xml
Log:
new_installer: factor out a config file (no functionnal change); needs to be tested on macos
Modified: trunk/apps/new_installer/ProcessPanel.Spec.xml
===================================================================
--- trunk/apps/new_installer/ProcessPanel.Spec.xml 2008-05-02 10:51:22 UTC (rev 19676)
+++ trunk/apps/new_installer/ProcessPanel.Spec.xml 2008-05-02 11:03:20 UTC (rev 19677)
@@ -2,12 +2,10 @@
-
-
-
+
@@ -15,9 +13,6 @@
-
-
-
@@ -28,9 +23,6 @@
-
-
-
@@ -41,33 +33,21 @@
-
-
-
-
-
-
-
-
-
-
-
-
@@ -75,9 +55,6 @@
-
-
-
@@ -87,9 +64,6 @@
-
-
-
@@ -99,9 +73,6 @@
-
-
-
@@ -111,9 +82,6 @@
-
-
-
@@ -123,9 +91,6 @@
-
-
-
@@ -139,9 +104,6 @@
-
-
-
@@ -151,9 +113,6 @@
-
-
-
@@ -163,9 +122,6 @@
-
-
-
@@ -175,9 +131,6 @@
-
-
-
@@ -188,10 +141,6 @@
-
-
-
-
@@ -199,9 +148,6 @@
-
-
-
From j16sdiz at freenetproject.org Fri May 2 11:21:43 2008
From: j16sdiz at freenetproject.org (j16sdiz at freenetproject.org)
Date: Fri, 2 May 2008 11:21:43 +0000 (UTC)
Subject: [freenet-cvs] r19678 - in trunk/freenet/src/freenet: node support
Message-ID: <20080502112143.DCDA447B2B5@freenetproject.org>
Author: j16sdiz
Date: 2008-05-02 11:21:43 +0000 (Fri, 02 May 2008)
New Revision: 19678
Modified:
trunk/freenet/src/freenet/node/FailureTable.java
trunk/freenet/src/freenet/support/LRUHashtable.java
Log:
more oom handler
Modified: trunk/freenet/src/freenet/node/FailureTable.java
===================================================================
--- trunk/freenet/src/freenet/node/FailureTable.java 2008-05-02 11:03:20 UTC (rev 19677)
+++ trunk/freenet/src/freenet/node/FailureTable.java 2008-05-02 11:21:43 UTC (rev 19678)
@@ -21,6 +21,8 @@
import freenet.keys.SSKBlock;
import freenet.support.LRUHashtable;
import freenet.support.Logger;
+import freenet.support.OOMHandler;
+import freenet.support.OOMHook;
import freenet.support.SerialExecutor;
import freenet.support.io.NativeThread;
@@ -38,7 +40,7 @@
* in the last hour.
* @author toad
*/
-public class FailureTable {
+public class FailureTable implements OOMHook {
/** FailureTableEntry's by key. Note that we push an entry only when sentTime changes. */
private final LRUHashtable entriesByKey;
@@ -78,6 +80,7 @@
public void start() {
offerExecutor.start(node.executor, "FailureTable offers executor");
+ OOMHandler.addOOMHook(this);
}
/**
@@ -625,4 +628,15 @@
return entry.othersWant(null);
}
+ public void handleLowMemory() throws Exception {
+ synchronized (this) {
+ entriesByKey.clear();
+ }
+ }
+
+ public void handleOutOfMemory() throws Exception {
+ synchronized (this) {
+ entriesByKey.clear();
+ }
+ }
}
Modified: trunk/freenet/src/freenet/support/LRUHashtable.java
===================================================================
--- trunk/freenet/src/freenet/support/LRUHashtable.java 2008-05-02 11:03:20 UTC (rev 19677)
+++ trunk/freenet/src/freenet/support/LRUHashtable.java 2008-05-02 11:21:43 UTC (rev 19678)
@@ -162,4 +162,8 @@
entries[i++] = values.nextElement();
}
+ public synchronized void clear() {
+ list.clear();
+ hash.clear();
+ }
}
From j16sdiz at freenetproject.org Fri May 2 12:11:58 2008
From: j16sdiz at freenetproject.org (j16sdiz at freenetproject.org)
Date: Fri, 2 May 2008 12:11:58 +0000 (UTC)
Subject: [freenet-cvs] r19679 - trunk/freenet/src/freenet/crypt/ciphers
Message-ID: <20080502121158.58E1D479967@freenetproject.org>
Author: j16sdiz
Date: 2008-05-02 12:11:58 +0000 (Fri, 02 May 2008)
New Revision: 19679
Modified:
trunk/freenet/src/freenet/crypt/ciphers/Rijndael.java
trunk/freenet/src/freenet/crypt/ciphers/Rijndael_Algorithm.java
Log:
restrict access
Modified: trunk/freenet/src/freenet/crypt/ciphers/Rijndael.java
===================================================================
--- trunk/freenet/src/freenet/crypt/ciphers/Rijndael.java 2008-05-02 11:21:43 UTC (rev 19678)
+++ trunk/freenet/src/freenet/crypt/ciphers/Rijndael.java 2008-05-02 12:11:58 UTC (rev 19679)
@@ -22,11 +22,11 @@
private final int keysize, blocksize;
// for Util.getCipherByName.. and yes, screw you too, java
- public Rijndael(Integer keysize) throws UnsupportedCipherException {
+ private Rijndael(Integer keysize) throws UnsupportedCipherException {
this(keysize.intValue());
}
- public Rijndael(int keysize) throws UnsupportedCipherException {
+ private Rijndael(int keysize) throws UnsupportedCipherException {
this(keysize, 128);
}
@@ -49,7 +49,7 @@
this.blocksize=blocksize;
}
- public Rijndael() {
+ private Rijndael() {
this.keysize = 128;
this.blocksize = 128;
}
@@ -83,10 +83,12 @@
* @return Size of temporary int[] a, t. If these are passed in, this can speed
* things up by avoiding unnecessary allocations between rounds.
*/
+ // only consumer is RijndaelPCFBMode
public synchronized final int getTempArraySize() {
return blocksize/(8*4);
}
+ // only consumer is RijndaelPCFBMode
public synchronized final void encipher(byte[] block, byte[] result, int[] a, int[] t) {
if(block.length != blocksize/8)
throw new IllegalArgumentException();
Modified: trunk/freenet/src/freenet/crypt/ciphers/Rijndael_Algorithm.java
===================================================================
--- trunk/freenet/src/freenet/crypt/ciphers/Rijndael_Algorithm.java 2008-05-02 11:21:43 UTC (rev 19678)
+++ trunk/freenet/src/freenet/crypt/ciphers/Rijndael_Algorithm.java 2008-05-02 12:11:58 UTC (rev 19679)
@@ -30,47 +30,53 @@
// Debugging methods and variables
// ...........................................................................
- static final String NAME = "Rijndael_Algorithm";
- static final boolean IN = true, OUT = false;
+ private static final String NAME = "Rijndael_Algorithm";
+ private static final boolean IN = true, OUT = false;
- static final boolean RDEBUG = Rijndael_Properties.GLOBAL_DEBUG;
- static final int debuglevel = RDEBUG ? Rijndael_Properties.getLevel(NAME) : 0;
- static final PrintWriter err = RDEBUG ? Rijndael_Properties.getOutput() : null;
+ private static final boolean RDEBUG = Rijndael_Properties.GLOBAL_DEBUG;
+ private static final int debuglevel = RDEBUG ? Rijndael_Properties.getLevel(NAME) : 0;
+ private static final PrintWriter err = RDEBUG ? Rijndael_Properties.getOutput() : null;
- static final boolean TRACE = Rijndael_Properties.isTraceable(NAME);
+ private static final boolean TRACE = Rijndael_Properties.isTraceable(NAME);
- static void debug (String s) { err.println(">>> "+NAME+": "+s); }
- static void trace (boolean in, String s) {
+ private static void debug(String s) {
+ err.println(">>> " + NAME + ": " + s);
+ }
+
+ private static void trace(boolean in, String s) {
if (TRACE) err.println((in?"==> ":"<== ")+NAME+ '.' +s);
}
- static void trace (String s) { if (TRACE) err.println("<=> "+NAME+ '.' +s); }
+ private static void trace(String s) {
+ if (TRACE)
+ err.println("<=> " + NAME + '.' + s);
+ }
// Constants and variables
// ...........................................................................
- static final int BLOCK_SIZE = 16; // default block size in bytes
+ private static final int BLOCK_SIZE = 16; // default block size in bytes
- static final int[] alog = new int[256];
- static final int[] log = new int[256];
+ private static final int[] alog = new int[256];
+ private static final int[] log = new int[256];
- static final byte[] S = new byte[256];
- static final byte[] Si = new byte[256];
- static final int[] T1 = new int[256];
- static final int[] T2 = new int[256];
- static final int[] T3 = new int[256];
- static final int[] T4 = new int[256];
- static final int[] T5 = new int[256];
- static final int[] T6 = new int[256];
- static final int[] T7 = new int[256];
- static final int[] T8 = new int[256];
- static final int[] U1 = new int[256];
- static final int[] U2 = new int[256];
- static final int[] U3 = new int[256];
- static final int[] U4 = new int[256];
- static final byte[] rcon = new byte[30];
+ private static final byte[] S = new byte[256];
+ private static final byte[] Si = new byte[256];
+ private static final int[] T1 = new int[256];
+ private static final int[] T2 = new int[256];
+ private static final int[] T3 = new int[256];
+ private static final int[] T4 = new int[256];
+ private static final int[] T5 = new int[256];
+ private static final int[] T6 = new int[256];
+ private static final int[] T7 = new int[256];
+ private static final int[] T8 = new int[256];
+ private static final int[] U1 = new int[256];
+ private static final int[] U2 = new int[256];
+ private static final int[] U3 = new int[256];
+ private static final int[] U4 = new int[256];
+ private static final byte[] rcon = new byte[30];
- static final int[][][] shifts = new int[][][] {
+ private static final int[][][] shifts = new int[][][] {
{ {0, 0}, {1, 3}, {2, 2}, {3, 1} },
{ {0, 0}, {1, 5}, {2, 4}, {3, 3} },
{ {0, 0}, {1, 7}, {3, 5}, {4, 4} }
@@ -271,14 +277,14 @@
}
// multiply two elements of GF(2^m)
- static final int mul (int a, int b) {
+ private static final int mul(int a, int b) {
return ((a != 0) && (b != 0)) ?
alog[(log[a & 0xFF] + log[b & 0xFF]) % 255] :
0;
}
// convenience method used in generating Transposition boxes
- static final int mul4 (int a, byte[] b) {
+ private static final int mul4(int a, byte[] b) {
if (a == 0) return 0;
a = log[a & 0xFF];
int a0 = (b[0] != 0) ? alog[(a + log[b[0] & 0xFF]) % 255] & 0xFF : 0;
@@ -471,14 +477,18 @@
}
/** A basic symmetric encryption/decryption test. */
- public static boolean self_test() { return self_test(BLOCK_SIZE); }
+ static boolean self_test() {
+ return self_test(BLOCK_SIZE);
+ }
// Rijndael own methods
// ...........................................................................
/** @return The default length in bytes of the Algorithm input block. */
- public static final int blockSize() { return BLOCK_SIZE; }
+ static final int blockSize() {
+ return BLOCK_SIZE;
+ }
/**
* Expand a user-supplied key material into a session key.
@@ -497,7 +507,7 @@
//a problem the callers should resolve among themselves.
//It is a fact that allowing no more than one makeKey on any given
//CPU will result in fewer cache misses. -- ejhuff 2003-10-12
- public final static synchronized Object makeKey (byte[] k, int blockSize)
+ final static synchronized Object makeKey(byte[] k, int blockSize)
throws InvalidKeyException {
if (RDEBUG) trace(IN, "makeKey("+k+", "+blockSize+ ')');
if (k == null)
@@ -593,7 +603,7 @@
* @param sessionKey The session key to use for encryption.
* @param blockSize The block size in bytes of this Rijndael.
*/
- public static final void
+ static final void
blockEncrypt (byte[] in, byte[] result, int inOffset, Object sessionKey, int blockSize) {
if (blockSize == BLOCK_SIZE) {
blockEncrypt(in, result, inOffset, sessionKey);
@@ -617,7 +627,7 @@
* @param sessionKey The session key to use for encryption.
* @param blockSize The block size in bytes of this Rijndael.
*/
- public static final void
+ static final void
blockEncrypt (byte[] in, byte[] result, int inOffset, Object sessionKey, int blockSize, int[] a, int[] t) {
if (blockSize == BLOCK_SIZE) {
blockEncrypt(in, result, inOffset, sessionKey);
@@ -673,7 +683,7 @@
* @param sessionKey The session key to use for decryption.
* @param blockSize The block size in bytes of this Rijndael.
*/
- public static final void
+ static final void
blockDecrypt (byte[] in, byte[] result, int inOffset, Object sessionKey, int blockSize) {
if (blockSize == BLOCK_SIZE) {
blockDecrypt(in, result, inOffset, sessionKey);
@@ -785,7 +795,7 @@
* @return The number of rounds for a given Rijndael's key and
* block sizes.
*/
- public static final int getRounds (int keySize, int blockSize) {
+ private static final int getRounds(int keySize, int blockSize) {
switch (keySize) {
case 16:
return blockSize == 16 ? 10 : (blockSize == 24 ? 12 : 14);
From j16sdiz at freenetproject.org Fri May 2 13:54:40 2008
From: j16sdiz at freenetproject.org (j16sdiz at freenetproject.org)
Date: Fri, 2 May 2008 13:54:40 +0000 (UTC)
Subject: [freenet-cvs] r19680 - trunk/freenet/src/freenet/crypt/ciphers
Message-ID: <20080502135440.7CFF8479CEA@freenetproject.org>
Author: j16sdiz
Date: 2008-05-02 13:54:40 +0000 (Fri, 02 May 2008)
New Revision: 19680
Modified:
trunk/freenet/src/freenet/crypt/ciphers/Rijndael.java
Log:
fix NPE and comment
Modified: trunk/freenet/src/freenet/crypt/ciphers/Rijndael.java
===================================================================
--- trunk/freenet/src/freenet/crypt/ciphers/Rijndael.java 2008-05-02 12:11:58 UTC (rev 19679)
+++ trunk/freenet/src/freenet/crypt/ciphers/Rijndael.java 2008-05-02 13:54:40 UTC (rev 19680)
@@ -21,7 +21,6 @@
private Object sessionKey;
private final int keysize, blocksize;
- // for Util.getCipherByName.. and yes, screw you too, java
private Rijndael(Integer keysize) throws UnsupportedCipherException {
this(keysize.intValue());
}
@@ -49,7 +48,8 @@
this.blocksize=blocksize;
}
- private Rijndael() {
+ // for Util.getCipherByName.. and yes, screw you too, java
+ public Rijndael() {
this.keysize = 128;
this.blocksize = 128;
}
From j16sdiz at freenetproject.org Fri May 2 14:18:42 2008
From: j16sdiz at freenetproject.org (j16sdiz at freenetproject.org)
Date: Fri, 2 May 2008 14:18:42 +0000 (UTC)
Subject: [freenet-cvs] r19681 - trunk/freenet/src/freenet/node
Message-ID: <20080502141842.E0B71479D01@freenetproject.org>
Author: j16sdiz
Date: 2008-05-02 14:18:42 +0000 (Fri, 02 May 2008)
New Revision: 19681
Modified:
trunk/freenet/src/freenet/node/MemoryChecker.java
Log:
doh. I do mean 8 MiB
Modified: trunk/freenet/src/freenet/node/MemoryChecker.java
===================================================================
--- trunk/freenet/src/freenet/node/MemoryChecker.java 2008-05-02 13:54:40 UTC (rev 19680)
+++ trunk/freenet/src/freenet/node/MemoryChecker.java 2008-05-02 14:18:42 UTC (rev 19681)
@@ -43,7 +43,7 @@
Logger.normal(this, "Memory in use: "+SizeUtil.formatSize((r.totalMemory()-r.freeMemory())));
- if (r.freeMemory() < 4096 * 1024 * 1024) { // free memory < 8 MB
+ if (r.freeMemory() < 8 * 1024 * 1024) { // free memory < 8 MB
Logger.error(this, "memory too low, trying to free some");
OOMHandler.lowMemory();
}
From j16sdiz at freenetproject.org Fri May 2 14:59:29 2008
From: j16sdiz at freenetproject.org (j16sdiz at freenetproject.org)
Date: Fri, 2 May 2008 14:59:29 +0000 (UTC)
Subject: [freenet-cvs] r19682 - trunk/freenet/src/freenet/node
Message-ID: <20080502145929.DB8DE47B2C6@freenetproject.org>
Author: j16sdiz
Date: 2008-05-02 14:59:29 +0000 (Fri, 02 May 2008)
New Revision: 19682
Modified:
trunk/freenet/src/freenet/node/FailureTable.java
Log:
oomhook: half the FailureTable on low memory
Modified: trunk/freenet/src/freenet/node/FailureTable.java
===================================================================
--- trunk/freenet/src/freenet/node/FailureTable.java 2008-05-02 14:18:42 UTC (rev 19681)
+++ trunk/freenet/src/freenet/node/FailureTable.java 2008-05-02 14:59:29 UTC (rev 19682)
@@ -630,7 +630,10 @@
public void handleLowMemory() throws Exception {
synchronized (this) {
- entriesByKey.clear();
+ int size = entriesByKey.size();
+ do {
+ entriesByKey.popKey();
+ } while (entriesByKey.size() >= size / 2);
}
}
From j16sdiz at freenetproject.org Fri May 2 14:59:50 2008
From: j16sdiz at freenetproject.org (j16sdiz at freenetproject.org)
Date: Fri, 2 May 2008 14:59:50 +0000 (UTC)
Subject: [freenet-cvs] r19683 - trunk/freenet/src/freenet/store
Message-ID: <20080502145950.83D6A479D58@freenetproject.org>
Author: j16sdiz
Date: 2008-05-02 14:59:50 +0000 (Fri, 02 May 2008)
New Revision: 19683
Modified:
trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
Log:
oomhook: lower database cache size
Modified: trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
===================================================================
--- trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2008-05-02 14:59:29 UTC (rev 19682)
+++ trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2008-05-02 14:59:50 UTC (rev 19683)
@@ -25,6 +25,7 @@
import com.sleepycat.je.DatabaseNotFoundException;
import com.sleepycat.je.Environment;
import com.sleepycat.je.EnvironmentConfig;
+import com.sleepycat.je.EnvironmentMutableConfig;
import com.sleepycat.je.LockMode;
import com.sleepycat.je.OperationStatus;
import com.sleepycat.je.RunRecoveryException;
@@ -2247,6 +2248,11 @@
keysFC.force(true);
if (lruFC != null)
lruFC.force(true);
+
+ EnvironmentMutableConfig dbmc = environment.getMutableConfig();
+ long cacheSize = (long) (dbmc.getCacheSize() * .9); // we have 6 databases, 0.9^6 = 0.53
+ dbmc.setCacheSize(cacheSize);
+ Logger.normal(this, "low memory, set db cache = " + cacheSize);
}
public void handleOutOfMemory() throws Exception {
From j16sdiz at freenetproject.org Fri May 2 15:49:48 2008
From: j16sdiz at freenetproject.org (j16sdiz at freenetproject.org)
Date: Fri, 2 May 2008 15:49:48 +0000 (UTC)
Subject: [freenet-cvs] r19684 - trunk/freenet/src/freenet/node
Message-ID: <20080502154948.49E7A479CEA@freenetproject.org>
Author: j16sdiz
Date: 2008-05-02 15:49:47 +0000 (Fri, 02 May 2008)
New Revision: 19684
Modified:
trunk/freenet/src/freenet/node/MemoryChecker.java
Log:
oomhook: fire low memory only when we have allocated maxMemory
Modified: trunk/freenet/src/freenet/node/MemoryChecker.java
===================================================================
--- trunk/freenet/src/freenet/node/MemoryChecker.java 2008-05-02 14:59:50 UTC (rev 19683)
+++ trunk/freenet/src/freenet/node/MemoryChecker.java 2008-05-02 15:49:47 UTC (rev 19684)
@@ -41,9 +41,14 @@
Runtime r = Runtime.getRuntime();
- Logger.normal(this, "Memory in use: "+SizeUtil.formatSize((r.totalMemory()-r.freeMemory())));
+ long totalMemory = r.totalMemory();
+ long freeMemory = r.freeMemory();
+ long maxMemory = r.maxMemory();
- if (r.freeMemory() < 8 * 1024 * 1024) { // free memory < 8 MB
+ Logger.normal(this, "Memory in use: "+SizeUtil.formatSize((totalMemory-freeMemory)));
+
+ if (freeMemory < 8 * 1024 * 1024 // free memory < 8 MB
+ && (totalMemory == maxMemory || maxMemory == Long.MAX_VALUE)) { // we have allocated max memory
Logger.error(this, "memory too low, trying to free some");
OOMHandler.lowMemory();
}
@@ -64,13 +69,13 @@
// we are getting much easier.
if(aggressiveGCModificator > 0) {
boolean logMINOR = Logger.shouldLog(Logger.MINOR, this);
- long beforeGCUsedMemory = (r.totalMemory()-r.freeMemory());
+ long beforeGCUsedMemory = (r.totalMemory() - r.freeMemory());
if(logMINOR) Logger.minor(this, "Memory in use before GC: "+beforeGCUsedMemory);
long beforeGCTime = System.currentTimeMillis();
System.gc();
System.runFinalization();
long afterGCTime = System.currentTimeMillis();
- long afterGCUsedMemory = (r.totalMemory()-r.freeMemory());
+ long afterGCUsedMemory = (r.totalMemory() - r.freeMemory());
if(logMINOR) {
Logger.minor(this, "Memory in use after GC: "+afterGCUsedMemory);
Logger.minor(this, "GC completed after "+(afterGCTime - beforeGCTime)+"ms and \"recovered\" "+(beforeGCUsedMemory - afterGCUsedMemory)+" bytes, leaving "+afterGCUsedMemory+" bytes used");
From j16sdiz at freenetproject.org Fri May 2 16:06:08 2008
From: j16sdiz at freenetproject.org (j16sdiz at freenetproject.org)
Date: Fri, 2 May 2008 16:06:08 +0000 (UTC)
Subject: [freenet-cvs] r19685 - trunk/freenet/src/freenet/store
Message-ID: <20080502160608.DF98347B2B0@freenetproject.org>
Author: j16sdiz
Date: 2008-05-02 16:06:08 +0000 (Fri, 02 May 2008)
New Revision: 19685
Modified:
trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
Log:
revert r19683, it just doesn't work
Modified: trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
===================================================================
--- trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2008-05-02 15:49:47 UTC (rev 19684)
+++ trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2008-05-02 16:06:08 UTC (rev 19685)
@@ -25,7 +25,6 @@
import com.sleepycat.je.DatabaseNotFoundException;
import com.sleepycat.je.Environment;
import com.sleepycat.je.EnvironmentConfig;
-import com.sleepycat.je.EnvironmentMutableConfig;
import com.sleepycat.je.LockMode;
import com.sleepycat.je.OperationStatus;
import com.sleepycat.je.RunRecoveryException;
@@ -2248,11 +2247,6 @@
keysFC.force(true);
if (lruFC != null)
lruFC.force(true);
-
- EnvironmentMutableConfig dbmc = environment.getMutableConfig();
- long cacheSize = (long) (dbmc.getCacheSize() * .9); // we have 6 databases, 0.9^6 = 0.53
- dbmc.setCacheSize(cacheSize);
- Logger.normal(this, "low memory, set db cache = " + cacheSize);
}
public void handleOutOfMemory() throws Exception {
From j16sdiz at freenetproject.org Fri May 2 16:17:59 2008
From: j16sdiz at freenetproject.org (j16sdiz at freenetproject.org)
Date: Fri, 2 May 2008 16:17:59 +0000 (UTC)
Subject: [freenet-cvs] r19686 - trunk/freenet/src/freenet/store
Message-ID: <20080502161759.27570479B7B@freenetproject.org>
Author: j16sdiz
Date: 2008-05-02 16:17:58 +0000 (Fri, 02 May 2008)
New Revision: 19686
Modified:
trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
Log:
oomhook: call dbenv.evictMemory()
Modified: trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
===================================================================
--- trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2008-05-02 16:06:08 UTC (rev 19685)
+++ trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2008-05-02 16:17:58 UTC (rev 19686)
@@ -2247,6 +2247,8 @@
keysFC.force(true);
if (lruFC != null)
lruFC.force(true);
+
+ environment.evictMemory();
}
public void handleOutOfMemory() throws Exception {
From NEOatNHNG at freenetproject.org Fri May 2 17:27:46 2008
From: NEOatNHNG at freenetproject.org (NEOatNHNG at freenetproject.org)
Date: Fri, 2 May 2008 17:27:46 +0000 (UTC)
Subject: [freenet-cvs] r19687 - in trunk/website: . pages/de pages/en
pages/sv
Message-ID: <20080502172746.3D3A2479D82@freenetproject.org>
Author: NEOatNHNG
Date: 2008-05-02 17:27:46 +0000 (Fri, 02 May 2008)
New Revision: 19687
Modified:
trunk/website/index.php
trunk/website/pages/de/menu.php
trunk/website/pages/en/menu.php
trunk/website/pages/sv/menu.php
trunk/website/style.css
Log:
New website layout
Modified: trunk/website/index.php
===================================================================
--- trunk/website/index.php 2008-05-02 16:17:58 UTC (rev 19686)
+++ trunk/website/index.php 2008-05-02 17:27:46 UTC (rev 19687)
@@ -44,7 +44,7 @@
-
+
@@ -64,7 +64,7 @@
}
?>
-
+
Modified: trunk/website/pages/de/menu.php
===================================================================
--- trunk/website/pages/de/menu.php 2008-05-02 16:17:58 UTC (rev 19686)
+++ trunk/website/pages/de/menu.php 2008-05-02 17:27:46 UTC (rev 19687)
@@ -55,7 +55,7 @@
//far away from perfect but better than nothing!
// if(!ereg("^A-Za-z0-9_-]+$",$link)){ echo "Nice try !"; exit();}
if ($link == $page) {
- echo '
'.$text.'';
+ echo '
';
} else {
lnk($text, $link.".html");
}
Modified: trunk/website/pages/en/menu.php
===================================================================
--- trunk/website/pages/en/menu.php 2008-05-02 16:17:58 UTC (rev 19686)
+++ trunk/website/pages/en/menu.php 2008-05-02 17:27:46 UTC (rev 19687)
@@ -55,7 +55,7 @@
//far away from perfect but better than nothing!
// if(!ereg("^A-Za-z0-9_-]+$",$link)){ echo "Nice try !"; exit();}
if ($link == $page) {
- echo '
'.$text.'';
+ echo '
';
} else {
lnk($text, $link.".html");
}
Modified: trunk/website/pages/sv/menu.php
===================================================================
--- trunk/website/pages/sv/menu.php 2008-05-02 16:17:58 UTC (rev 19686)
+++ trunk/website/pages/sv/menu.php 2008-05-02 17:27:46 UTC (rev 19687)
@@ -44,7 +44,7 @@
// if(!ereg("^A-Za-z0-9_-]+$",$link)){ echo "Nice try !"; exit();}
if ($link == $page) {
?>
-
=$text ?>
+
} else {
lnk($text, $link.".html");
Modified: trunk/website/style.css
===================================================================
--- trunk/website/style.css 2008-05-02 16:17:58 UTC (rev 19686)
+++ trunk/website/style.css 2008-05-02 17:27:46 UTC (rev 19687)
@@ -1,20 +1,29 @@
+html {
+ background: #AACCFF;
+}
+
body {
- margin: 0 0 0 0;
+ margin: 0 auto;
+ padding: 5px 20px;
+ max-width: 760px;
+ border: 1px solid #77BBFF;
+ background: #FFF;
}
div#menu {
- font-family: Sans-serif, Arial, "Times New Roman", Georgia, Times, serif;
+ font-family: Sans-serif, Arial, "Times New Roman", Georgia, Times, serif;
float:left;
font-style: normal;
font-weight: normal;
text-align: left;
line-height: 100%;
color: #000000;
- background: #fafafa;
+ background: #CCDDFF;
text-decoration: none;
margin-top: 15px;
- margin-right: 20px;
+ margin-right: 30px;
margin-bottom: 10px;
+ border: 1px solid #99CCFF;
}
@@ -28,13 +37,12 @@
div#content {
/*font-family: Sans-serif, Arial, "Times New Roman", Georgia, Times, serif;*/
- padding-left:20px;
+ /* padding-left:20px; */
font-style: normal;
font-size: 14px;
font-weight: normal;
color: #000000;
/* width: 600px; */
- max-width: 700px;
/* float: left; */
}
@@ -56,9 +64,6 @@
a:link { text-decoration: none; color: #0033AA }
a:visited { text-decoration: none; color: #0033AA }
a:hover { text-decoration: none; color: #0033AA }
-a.menu:link { color: #000000; text-decoration: none }
-a.menu:visited { color: #000000; text-decoration: none }
-a.menu:hover { color: #000000; text-decoration: none }
div.hideit { display: none; }
@@ -70,12 +75,7 @@
border: 1px dashed #ccc;
}
-div#menu a {
- color:#09c;
- text-decoration:none;
- font-weight:200;
- }
-
+
div#menu a:link {color:#000;}
div#menu a:visited {color:#000;}
div#menu a:hover {background-color:#eee;}
@@ -85,24 +85,28 @@
font-size: 16px;
list-style-type: none;
list-style-position: inside;
- margin:0 0 0 1em;
+ margin:0 0 0 0;
padding:0;
}
.submenu {
list-style-type: none;
- font-size: 75%;
- }
+ font-size: 75%;
+ margin: 0 0 0 1em;
+ padding: 0;
+}
+.shop {
+ width: 100%;
+ background: #FFFFFF;
+ text-align: center;
+}
+.selected-menu {
+ font-weight: bold;
+ color:#13B;
+}
-.menu ul {
- list-style-type: square;
- margin:0 0 0 2em;
- padding:0;
- }
-
-
.paper-text { padding: 10px 0px 0px 30px; }
.videoimage { vertical-align: top; padding-top:14px; padding-left:7px;}
.pdfimage { vertical-align: top; padding-top:14px;}
From NEOatNHNG at freenetproject.org Fri May 2 17:32:59 2008
From: NEOatNHNG at freenetproject.org (NEOatNHNG at freenetproject.org)
Date: Fri, 2 May 2008 17:32:59 +0000 (UTC)
Subject: [freenet-cvs] r19688 - trunk/website
Message-ID: <20080502173259.A618747AEC7@freenetproject.org>
Author: NEOatNHNG
Date: 2008-05-02 17:32:59 +0000 (Fri, 02 May 2008)
New Revision: 19688
Modified:
trunk/website/style.css
Log:
Doh
Modified: trunk/website/style.css
===================================================================
--- trunk/website/style.css 2008-05-02 17:27:46 UTC (rev 19687)
+++ trunk/website/style.css 2008-05-02 17:32:59 UTC (rev 19688)
@@ -78,7 +78,7 @@
div#menu a:link {color:#000;}
div#menu a:visited {color:#000;}
-div#menu a:hover {background-color:#eee;}
+div#menu a:hover {color:#13B;}
.menu {
/* width: 155px; */
From toad at freenetproject.org Fri May 2 23:25:03 2008
From: toad at freenetproject.org (toad at freenetproject.org)
Date: Fri, 2 May 2008 23:25:03 +0000 (UTC)
Subject: [freenet-cvs] r19689 - trunk/freenet/src/freenet/store
Message-ID: <20080502232503.4960A47B2B3@freenetproject.org>
Author: toad
Date: 2008-05-02 23:25:02 +0000 (Fri, 02 May 2008)
New Revision: 19689
Modified:
trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
Log:
Don't abort twice
Modified: trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
===================================================================
--- trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2008-05-02 17:32:59 UTC (rev 19688)
+++ trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2008-05-02 23:25:02 UTC (rev 19689)
@@ -1509,6 +1509,7 @@
// Key already exists!
// But is it valid?
t.abort();
+ t = null;
if(fetch(routingkey, fullKey, false) != null) return; // old key was valid, we are not overwriting
// If we are here, it was corrupt, or it was just deleted, so we can replace it.
if(logMINOR) Logger.minor(this, "Old key was invalid, adding anyway");
From toad at freenetproject.org Fri May 2 23:27:36 2008
From: toad at freenetproject.org (toad at freenetproject.org)
Date: Fri, 2 May 2008 23:27:36 +0000 (UTC)
Subject: [freenet-cvs] r19690 - trunk/freenet/src/freenet/store
Message-ID: <20080502232737.28B2447B2B3@freenetproject.org>
Author: toad
Date: 2008-05-02 23:27:36 +0000 (Fri, 02 May 2008)
New Revision: 19690
Modified:
trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
Log:
Abort the transaction even on a ClosedChannelException
Modified: trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
===================================================================
--- trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2008-05-02 23:25:02 UTC (rev 19689)
+++ trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2008-05-02 23:27:36 UTC (rev 19690)
@@ -1541,14 +1541,15 @@
if(closed) return;
}
}
- if(t!=null){
- try{t.abort();}catch(DatabaseException ex2){}
- }
checkSecondaryDatabaseError(ex);
Logger.error(this, "Caught "+ex, ex);
ex.printStackTrace();
if(ex instanceof IOException) throw (IOException) ex;
else throw new IOException(ex.getMessage());
+ } finally {
+ if(t!=null){
+ try{t.abort();}catch(DatabaseException ex2){}
+ }
}
}
From nextgens at freenetproject.org Sat May 3 02:56:10 2008
From: nextgens at freenetproject.org (nextgens at freenetproject.org)
Date: Sat, 3 May 2008 02:56:10 +0000 (UTC)
Subject: [freenet-cvs] r19691 - trunk/freenet/src/freenet/node
Message-ID: <20080503025610.1B7DB479D0F@freenetproject.org>
Author: nextgens
Date: 2008-05-03 02:56:09 +0000 (Sat, 03 May 2008)
New Revision: 19691
Modified:
trunk/freenet/src/freenet/node/KeyTracker.java
trunk/freenet/src/freenet/node/PeerManager.java
Log:
revert r19589 and r19596
Modified: trunk/freenet/src/freenet/node/KeyTracker.java
===================================================================
--- trunk/freenet/src/freenet/node/KeyTracker.java 2008-05-02 23:27:36 UTC (rev 19690)
+++ trunk/freenet/src/freenet/node/KeyTracker.java 2008-05-03 02:56:09 UTC (rev 19691)
@@ -728,7 +728,7 @@
return acks;
}
- public synchronized void requeueForgot(int[] forgotPackets, int start, int length) {
+ public void requeueForgot(int[] forgotPackets, int start, int length) {
synchronized(forgottenQueue) { // It doesn't do anything else does it? REDFLAG
for(int i=start;i
Author: toad
Date: 2008-05-03 11:25:50 +0000 (Sat, 03 May 2008)
New Revision: 19692
Modified:
trunk/freenet/src/freenet/clients/http/staticfiles/defaultbookmarks.dat
Log:
Update editions
Modified: trunk/freenet/src/freenet/clients/http/staticfiles/defaultbookmarks.dat
===================================================================
--- trunk/freenet/src/freenet/clients/http/staticfiles/defaultbookmarks.dat 2008-05-03 02:56:09 UTC (rev 19691)
+++ trunk/freenet/src/freenet/clients/http/staticfiles/defaultbookmarks.dat 2008-05-03 11:25:50 UTC (rev 19692)
@@ -19,11 +19,11 @@
BookmarkCategory0.Content.Bookmark1.Name=Freenet Activelink Index (warning: it will take a long time for all the images to load!)
BookmarkCategory0.Content.Bookmark1.hasAnActivelink=true
BookmarkCategory0.Content.Bookmark1.Description=A graphical freenet index (this will take a long time to load as it preloads the sites; contains no porn)
-BookmarkCategory0.Content.Bookmark1.URI=USK at qd-hk0vHYg7YvK2BQsJMcUD5QSF0tDkgnnF6lnWUH0g,xTFOV9ddCQQk6vQ6G~jfL6IzRUgmfMcZJ6nuySu~NUc,AQACAAE/activelink-index/49/
+BookmarkCategory0.Content.Bookmark1.URI=USK at qd-hk0vHYg7YvK2BQsJMcUD5QSF0tDkgnnF6lnWUH0g,xTFOV9ddCQQk6vQ6G~jfL6IzRUgmfMcZJ6nuySu~NUc,AQACAAE/activelink-index/50/
BookmarkCategory0.Content.Bookmark4.Name=Freenet Activelink Index Text Version (non-graphical version of FAI)
BookmarkCategory0.Content.Bookmark4.hasAnActivelink=true
BookmarkCategory0.Content.Bookmark4.Description=Text version of the Activelink Index
-BookmarkCategory0.Content.Bookmark4.URI=USK at qd-hk0vHYg7YvK2BQsJMcUD5QSF0tDkgnnF6lnWUH0g,xTFOV9ddCQQk6vQ6G~jfL6IzRUgmfMcZJ6nuySu~NUc,AQACAAE/activelink-index-text/13/
+BookmarkCategory0.Content.Bookmark4.URI=USK at qd-hk0vHYg7YvK2BQsJMcUD5QSF0tDkgnnF6lnWUH0g,xTFOV9ddCQQk6vQ6G~jfL6IzRUgmfMcZJ6nuySu~NUc,AQACAAE/activelink-index-text/14/
BookmarkCategory1.Name=Freenet devel's flogs
BookmarkCategory1.Content.BookmarkCategory=0
BookmarkCategory1.Content.Bookmark=5
From nextgens at freenetproject.org Sat May 3 11:45:09 2008
From: nextgens at freenetproject.org (nextgens at freenetproject.org)
Date: Sat, 3 May 2008 11:45:09 +0000 (UTC)
Subject: [freenet-cvs] r19693 - trunk/freenet/src/freenet/support/io
Message-ID: <20080503114509.CE2C5478D7B@freenetproject.org>
Author: nextgens
Date: 2008-05-03 11:45:09 +0000 (Sat, 03 May 2008)
New Revision: 19693
Modified:
trunk/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucket.java
Log:
Some paranoia (flush() before close() just in case a BufferedOutputStream is catching exceptions)
Modified: trunk/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucket.java
===================================================================
--- trunk/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucket.java 2008-05-03 11:25:50 UTC (rev 19692)
+++ trunk/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucket.java 2008-05-03 11:45:09 UTC (rev 19693)
@@ -194,6 +194,7 @@
}
} finally {
closed = true;
+ out.flush();
out.close();
}
}
From nextgens at freenetproject.org Sat May 3 11:48:02 2008
From: nextgens at freenetproject.org (nextgens at freenetproject.org)
Date: Sat, 3 May 2008 11:48:02 +0000 (UTC)
Subject: [freenet-cvs] r19694 - trunk/freenet/src/freenet/support/io
Message-ID: <20080503114802.24217478D98@freenetproject.org>
Author: nextgens
Date: 2008-05-03 11:48:01 +0000 (Sat, 03 May 2008)
New Revision: 19694
Modified:
trunk/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucket.java
Log:
Don't instanciate a new MT; use the existing one.
Modified: trunk/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucket.java
===================================================================
--- trunk/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucket.java 2008-05-03 11:45:09 UTC (rev 19693)
+++ trunk/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucket.java 2008-05-03 11:48:01 UTC (rev 19694)
@@ -28,7 +28,7 @@
private final Bucket bucket;
private final int minPaddedSize;
- private final RandomSource origRandom;
+ private final RandomSource randomSource;
private SoftReference /* */ aesRef;
/** The decryption key. */
private final byte[] key;
@@ -45,7 +45,7 @@
* @throws UnsupportedCipherException
*/
public PaddedEphemerallyEncryptedBucket(Bucket bucket, int minSize, RandomSource origRandom) {
- this.origRandom = origRandom;
+ this.randomSource = origRandom;
this.bucket = bucket;
if(bucket.size() != 0) throw new IllegalArgumentException("Bucket must be empty");
byte[] tempKey = new byte[32];
@@ -72,7 +72,7 @@
if(bucket.size() < knownSize)
throw new IOException("Bucket "+bucket+" is too small on disk - knownSize="+knownSize+" but bucket.size="+bucket.size()+" for "+bucket);
this.dataLength = knownSize;
- this.origRandom = origRandom;
+ this.randomSource = origRandom;
this.bucket = bucket;
if(key.length != 32) throw new IllegalArgumentException("Key wrong length: "+key.length);
this.key = key;
@@ -82,7 +82,7 @@
}
public PaddedEphemerallyEncryptedBucket(SimpleFieldSet fs, RandomSource origRandom, PersistentFileTracker f) throws CannotCreateFromFieldSetException {
- this.origRandom = origRandom;
+ this.randomSource = origRandom;
String tmp = fs.get("DataLength");
if(tmp == null)
throw new CannotCreateFromFieldSetException("No DataLength");
@@ -180,14 +180,13 @@
return;
}
synchronized(PaddedEphemerallyEncryptedBucket.this) {
- MersenneTwister paddingSource = new MersenneTwister(origRandom.nextLong());
long finalLength = paddedLength();
long padding = finalLength - dataLength;
byte[] buf = new byte[4096];
long writtenPadding = 0;
while(writtenPadding < padding) {
int left = (int) Math.min((padding - writtenPadding), (long)buf.length);
- paddingSource.nextBytes(buf);
+ randomSource.nextBytes(buf);
out.write(buf, 0, left);
writtenPadding += left;
}
From NEOatNHNG at freenetproject.org Sat May 3 11:50:20 2008
From: NEOatNHNG at freenetproject.org (NEOatNHNG at freenetproject.org)
Date: Sat, 3 May 2008 11:50:20 +0000 (UTC)
Subject: [freenet-cvs] r19695 - trunk/website
Message-ID: <20080503115020.6B004478DA7@freenetproject.org>
Author: NEOatNHNG
Date: 2008-05-03 11:50:20 +0000 (Sat, 03 May 2008)
New Revision: 19695
Modified:
trunk/website/style.css
Log:
Fix menu bug. Thanks to Loki
Modified: trunk/website/style.css
===================================================================
--- trunk/website/style.css 2008-05-03 11:48:01 UTC (rev 19694)
+++ trunk/website/style.css 2008-05-03 11:50:20 UTC (rev 19695)
@@ -56,7 +56,10 @@
}
-div#footer { text-align: center; }
+div#footer {
+ text-align: center;
+ clear: both;
+}
div#content li { list-style-type: square; }
From nextgens at freenetproject.org Sat May 3 13:25:08 2008
From: nextgens at freenetproject.org (nextgens at freenetproject.org)
Date: Sat, 3 May 2008 13:25:08 +0000 (UTC)
Subject: [freenet-cvs] r19696 - in trunk/freenet/src/freenet: client node
support/io
Message-ID: <20080503132508.A59554781A5@freenetproject.org>
Author: nextgens
Date: 2008-05-03 13:25:08 +0000 (Sat, 03 May 2008)
New Revision: 19696
Modified:
trunk/freenet/src/freenet/client/ArchiveManager.java
trunk/freenet/src/freenet/node/NodeClientCore.java
trunk/freenet/src/freenet/support/io/FilenameGenerator.java
trunk/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucket.java
trunk/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucketFactory.java
trunk/freenet/src/freenet/support/io/PersistentTempBucketFactory.java
Log:
Some refactoring: use the same instance of MT everywhere instead of creating a new one
Needs testing!
Modified: trunk/freenet/src/freenet/client/ArchiveManager.java
===================================================================
--- trunk/freenet/src/freenet/client/ArchiveManager.java 2008-05-03 11:50:20 UTC (rev 19695)
+++ trunk/freenet/src/freenet/client/ArchiveManager.java 2008-05-03 13:25:08 UTC (rev 19696)
@@ -23,6 +23,7 @@
import freenet.support.io.FilenameGenerator;
import freenet.support.io.PaddedEphemerallyEncryptedBucket;
import freenet.support.io.TempFileBucket;
+import java.util.Random;
/**
* Cache of recently decoded archives:
@@ -39,6 +40,7 @@
private static boolean logMINOR;
final RandomSource random;
+ final Random weakRandom;
final long maxArchiveSize;
final long maxArchivedFileSize;
@@ -72,7 +74,7 @@
* @param cacheDir The directory in which to store cached data.
* @param random A random source for the encryption keys used by stored files.
*/
- public ArchiveManager(int maxHandlers, long maxCachedData, long maxArchiveSize, long maxArchivedFileSize, int maxCachedElements, RandomSource random, FilenameGenerator filenameGenerator) {
+ public ArchiveManager(int maxHandlers, long maxCachedData, long maxArchiveSize, long maxArchivedFileSize, int maxCachedElements, RandomSource random, Random weakRandom, FilenameGenerator filenameGenerator) {
maxArchiveHandlers = maxHandlers;
archiveHandlers = new LRUHashtable();
this.maxCachedElements = maxCachedElements;
@@ -81,6 +83,7 @@
this.maxArchiveSize = maxArchiveSize;
this.maxArchivedFileSize = maxArchivedFileSize;
this.random = random;
+ this.weakRandom = weakRandom;
this.filenameGenerator = filenameGenerator;
logMINOR = Logger.shouldLog(Logger.MINOR, this);
}
@@ -473,7 +476,7 @@
byte[] cipherKey = new byte[32];
random.nextBytes(cipherKey);
- PaddedEphemerallyEncryptedBucket encryptedBucket = new PaddedEphemerallyEncryptedBucket(fb, 1024, random);
+ PaddedEphemerallyEncryptedBucket encryptedBucket = new PaddedEphemerallyEncryptedBucket(fb, 1024, weakRandom);
return new TempStoreElement(myFile, fb, encryptedBucket);
}
Modified: trunk/freenet/src/freenet/node/NodeClientCore.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeClientCore.java 2008-05-03 11:50:20 UTC (rev 19695)
+++ trunk/freenet/src/freenet/node/NodeClientCore.java 2008-05-03 13:25:08 UTC (rev 19696)
@@ -190,14 +190,14 @@
}
});
try {
- persistentTempBucketFactory = new PersistentTempBucketFactory(new File(nodeConfig.getString("persistentTempDir")), "freenet-temp-", random);
+ persistentTempBucketFactory = new PersistentTempBucketFactory(new File(nodeConfig.getString("persistentTempDir")), "freenet-temp-", node.fastWeakRandom);
persistentEncryptedTempBucketFactory = new PersistentEncryptedTempBucketFactory(persistentTempBucketFactory);
} catch (IOException e2) {
String msg = "Could not find or create persistent temporary directory";
throw new NodeInitException(NodeInitException.EXIT_BAD_TEMP_DIR, msg);
}
- tempBucketFactory = new PaddedEphemerallyEncryptedBucketFactory(new TempBucketFactory(tempFilenameGenerator), random, 1024);
+ tempBucketFactory = new PaddedEphemerallyEncryptedBucketFactory(new TempBucketFactory(tempFilenameGenerator), node.fastWeakRandom, 1024);
// Downloads directory
@@ -272,7 +272,7 @@
});
setUploadAllowedDirs(nodeConfig.getStringArr("uploadAllowedDirs"));
- archiveManager = new ArchiveManager(MAX_ARCHIVE_HANDLERS, MAX_CACHED_ARCHIVE_DATA, MAX_ARCHIVE_SIZE, MAX_ARCHIVED_FILE_SIZE, MAX_CACHED_ELEMENTS, random, tempFilenameGenerator);
+ archiveManager = new ArchiveManager(MAX_ARCHIVE_HANDLERS, MAX_CACHED_ARCHIVE_DATA, MAX_ARCHIVE_SIZE, MAX_ARCHIVED_FILE_SIZE, MAX_CACHED_ELEMENTS, random, node.fastWeakRandom, tempFilenameGenerator);
Logger.normal(this, "Initializing USK Manager");
System.out.println("Initializing USK Manager");
uskManager = new USKManager(this);
Modified: trunk/freenet/src/freenet/support/io/FilenameGenerator.java
===================================================================
--- trunk/freenet/src/freenet/support/io/FilenameGenerator.java 2008-05-03 11:50:20 UTC (rev 19695)
+++ trunk/freenet/src/freenet/support/io/FilenameGenerator.java 2008-05-03 13:25:08 UTC (rev 19696)
@@ -5,14 +5,14 @@
import org.tanukisoftware.wrapper.WrapperManager;
-import freenet.crypt.RandomSource;
import freenet.support.Fields;
import freenet.support.Logger;
import freenet.support.TimeUtil;
+import java.util.Random;
public class FilenameGenerator {
- private final RandomSource random;
+ private final Random random;
private final String prefix;
private final File tmpDir;
@@ -23,7 +23,7 @@
* @param prefix
* @throws IOException
*/
- public FilenameGenerator(RandomSource random, boolean wipeFiles, File dir, String prefix) throws IOException {
+ public FilenameGenerator(Random random, boolean wipeFiles, File dir, String prefix) throws IOException {
this.random = random;
this.prefix = prefix;
if (dir == null)
Modified: trunk/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucket.java
===================================================================
--- trunk/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucket.java 2008-05-03 11:50:20 UTC (rev 19695)
+++ trunk/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucket.java 2008-05-03 13:25:08 UTC (rev 19696)
@@ -8,8 +8,6 @@
import java.io.OutputStream;
import java.lang.ref.SoftReference;
-import org.spaceroots.mantissa.random.MersenneTwister;
-
import freenet.crypt.PCFBMode;
import freenet.crypt.RandomSource;
import freenet.crypt.UnsupportedCipherException;
@@ -18,6 +16,7 @@
import freenet.support.Logger;
import freenet.support.SimpleFieldSet;
import freenet.support.api.Bucket;
+import java.util.Random;
/**
* A proxy Bucket which adds:
@@ -28,7 +27,7 @@
private final Bucket bucket;
private final int minPaddedSize;
- private final RandomSource randomSource;
+ private final Random randomSource;
private SoftReference /* */ aesRef;
/** The decryption key. */
private final byte[] key;
@@ -41,10 +40,10 @@
* @param bucket The bucket which we are proxying to. Must be empty.
* @param pcfb The encryption mode with which to encipher/decipher the data.
* @param minSize The minimum padded size of the file (after it has been closed).
- * @param origRandom Hard random number generator from which to obtain a seed for padding.
+ * @param origRandom a week prng we will padd from.
* @throws UnsupportedCipherException
*/
- public PaddedEphemerallyEncryptedBucket(Bucket bucket, int minSize, RandomSource origRandom) {
+ public PaddedEphemerallyEncryptedBucket(Bucket bucket, int minSize, Random origRandom) {
this.randomSource = origRandom;
this.bucket = bucket;
if(bucket.size() != 0) throw new IllegalArgumentException("Bucket must be empty");
Modified: trunk/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucketFactory.java
===================================================================
--- trunk/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucketFactory.java 2008-05-03 11:50:20 UTC (rev 19695)
+++ trunk/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucketFactory.java 2008-05-03 13:25:08 UTC (rev 19696)
@@ -2,9 +2,9 @@
import java.io.IOException;
-import freenet.crypt.RandomSource;
import freenet.support.api.Bucket;
import freenet.support.api.BucketFactory;
+import java.util.Random;
/**
* Factory wrapper for PaddedEphemerallyEncryptedBucket's, which are themselves
@@ -13,10 +13,10 @@
public class PaddedEphemerallyEncryptedBucketFactory implements BucketFactory {
final BucketFactory baseFactory;
- final RandomSource random;
+ final Random random;
final int minSize;
- public PaddedEphemerallyEncryptedBucketFactory(BucketFactory factory, RandomSource r, int minSize) {
+ public PaddedEphemerallyEncryptedBucketFactory(BucketFactory factory, Random r, int minSize) {
baseFactory = factory;
this.minSize = minSize;
this.random = r;
Modified: trunk/freenet/src/freenet/support/io/PersistentTempBucketFactory.java
===================================================================
--- trunk/freenet/src/freenet/support/io/PersistentTempBucketFactory.java 2008-05-03 11:50:20 UTC (rev 19695)
+++ trunk/freenet/src/freenet/support/io/PersistentTempBucketFactory.java 2008-05-03 13:25:08 UTC (rev 19696)
@@ -13,6 +13,7 @@
import freenet.support.Logger;
import freenet.support.api.Bucket;
import freenet.support.api.BucketFactory;
+import java.util.Random;
/**
* Handles persistent temp files. These are used for e.g. persistent downloads.
@@ -35,12 +36,12 @@
private final FilenameGenerator fg;
/** Random number generator */
- private final RandomSource rand;
+ private final Random rand;
/** Buckets to free */
private final LinkedList bucketsToFree;
- public PersistentTempBucketFactory(File dir, String prefix, RandomSource rand) throws IOException {
+ public PersistentTempBucketFactory(File dir, String prefix, Random rand) throws IOException {
boolean logMINOR = Logger.shouldLog(Logger.MINOR, this);
this.dir = dir;
this.rand = rand;
From nextgens at freenetproject.org Sat May 3 13:40:26 2008
From: nextgens at freenetproject.org (nextgens at freenetproject.org)
Date: Sat, 3 May 2008 13:40:26 +0000 (UTC)
Subject: [freenet-cvs] r19697 - trunk/freenet/src/freenet/support/io
Message-ID: <20080503134026.BD8E8478D52@freenetproject.org>
Author: nextgens
Date: 2008-05-03 13:40:26 +0000 (Sat, 03 May 2008)
New Revision: 19697
Modified:
trunk/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucket.java
Log:
cheap optimization
Modified: trunk/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucket.java
===================================================================
--- trunk/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucket.java 2008-05-03 13:25:08 UTC (rev 19696)
+++ trunk/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucket.java 2008-05-03 13:40:26 UTC (rev 19697)
@@ -154,6 +154,7 @@
if(closed) throw new IOException("Already closed!");
if(streamNumber != lastOutputStream)
throw new IllegalStateException("Writing to old stream in "+getName());
+ if(length == 0) return;
byte[] enc = new byte[length];
System.arraycopy(buf, offset, enc, 0, length);
pcfb.blockEncipher(enc, 0, enc.length);
From saces at freenetproject.org Sat May 3 14:02:15 2008
From: saces at freenetproject.org (saces at freenetproject.org)
Date: Sat, 3 May 2008 14:02:15 +0000 (UTC)
Subject: [freenet-cvs] r19698 - trunk/plugins/KeyExplorer
Message-ID: <20080503140215.F3B3D478E0E@freenetproject.org>
Author: saces
Date: 2008-05-03 14:02:15 +0000 (Sat, 03 May 2008)
New Revision: 19698
Modified:
trunk/plugins/KeyExplorer/KeyExplorer.java
Log:
catch cast exception (USK) and reply with an error msg.
Modified: trunk/plugins/KeyExplorer/KeyExplorer.java
===================================================================
--- trunk/plugins/KeyExplorer/KeyExplorer.java 2008-05-03 13:40:26 UTC (rev 19697)
+++ trunk/plugins/KeyExplorer/KeyExplorer.java 2008-05-03 14:02:15 UTC (rev 19698)
@@ -96,7 +96,7 @@
return;
} catch (MalformedURLException e) {
- sendError(replysender, 5, "malformed freenet uri");
+ sendError(replysender, 5, "Malformed freenet uri: "+e.getMessage());
return;
} catch (LowLevelGetException e) {
sendError(replysender, 6, "Get failed: " + e.toString());
@@ -129,7 +129,12 @@
}
private GetResult simpleGet(FreenetURI uri) throws MalformedURLException, LowLevelGetException {
- ClientKey ck = (ClientKey) BaseClientKey.getBaseKey(uri);
+ ClientKey ck;
+ try {
+ ck = (ClientKey) BaseClientKey.getBaseKey(uri);
+ } catch (ClassCastException cce) {
+ throw new MalformedURLException("Not a supported freenet uri: "+uri);
+ }
VerySimpleGetter vsg = new VerySimpleGetter((short) 1, m_pr.getNode().clientCore.requestStarters.chkFetchScheduler, m_pr
.getNode().clientCore.requestStarters.sskFetchScheduler, uri, null);
VerySimpleGet vs = new VerySimpleGet(ck, 3, m_pr.getHLSimpleClient().getFetchContext(), vsg);
From toad at freenetproject.org Sat May 3 14:47:21 2008
From: toad at freenetproject.org (toad at freenetproject.org)
Date: Sat, 3 May 2008 14:47:21 +0000 (UTC)
Subject: [freenet-cvs] r19699 - trunk/freenet/src/freenet/client/async
Message-ID: <20080503144721.3934747819C@freenetproject.org>
Author: toad
Date: 2008-05-03 14:47:21 +0000 (Sat, 03 May 2008)
New Revision: 19699
Modified:
trunk/freenet/src/freenet/client/async/USKManager.java
Log:
Fix NPE from FMS.
Modified: trunk/freenet/src/freenet/client/async/USKManager.java
===================================================================
--- trunk/freenet/src/freenet/client/async/USKManager.java 2008-05-03 14:02:15 UTC (rev 19698)
+++ trunk/freenet/src/freenet/client/async/USKManager.java 2008-05-03 14:47:21 UTC (rev 19699)
@@ -238,6 +238,9 @@
}
if(runBackgroundFetch) {
USKFetcher f = (USKFetcher) backgroundFetchersByClearUSK.get(clear);
+ if(f == null) {
+ Logger.error(this, "Unsubscribing "+cb+" for "+origUSK+" but not already subscribed", new Exception("error"));
+ } else {
f.removeSubscriber(cb);
if(!f.hasSubscribers()) {
if(!temporaryBackgroundFetchersLRU.contains(clear)) {
@@ -245,6 +248,7 @@
backgroundFetchersByClearUSK.remove(clear);
}
}
+ }
}
}
if(toCancel != null) toCancel.cancel();
From toad at freenetproject.org Sat May 3 14:47:36 2008
From: toad at freenetproject.org (toad at freenetproject.org)
Date: Sat, 3 May 2008 14:47:36 +0000 (UTC)
Subject: [freenet-cvs] r19700 - trunk/freenet/src/freenet/client/async
Message-ID: <20080503144736.E8B0547819E@freenetproject.org>
Author: toad
Date: 2008-05-03 14:47:36 +0000 (Sat, 03 May 2008)
New Revision: 19700
Modified:
trunk/freenet/src/freenet/client/async/USKManager.java
Log:
indenting
Modified: trunk/freenet/src/freenet/client/async/USKManager.java
===================================================================
--- trunk/freenet/src/freenet/client/async/USKManager.java 2008-05-03 14:47:21 UTC (rev 19699)
+++ trunk/freenet/src/freenet/client/async/USKManager.java 2008-05-03 14:47:36 UTC (rev 19700)
@@ -241,14 +241,14 @@
if(f == null) {
Logger.error(this, "Unsubscribing "+cb+" for "+origUSK+" but not already subscribed", new Exception("error"));
} else {
- f.removeSubscriber(cb);
- if(!f.hasSubscribers()) {
- if(!temporaryBackgroundFetchersLRU.contains(clear)) {
- toCancel = f;
- backgroundFetchersByClearUSK.remove(clear);
+ f.removeSubscriber(cb);
+ if(!f.hasSubscribers()) {
+ if(!temporaryBackgroundFetchersLRU.contains(clear)) {
+ toCancel = f;
+ backgroundFetchersByClearUSK.remove(clear);
+ }
}
}
- }
}
}
if(toCancel != null) toCancel.cancel();
From svn-build at freenetproject.org Sat May 3 14:48:26 2008
From: svn-build at freenetproject.org (svn-build at freenetproject.org)
Date: Sat, 3 May 2008 14:48:26 +0000 (UTC)
Subject: [freenet-cvs] Verification of r19700 on emu
Message-ID: <20080503144826.45C624781A6@freenetproject.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
toad has declared that 19700 is an 'indent only' commit:
That's TRUE.
orig/USKManager$1.class : 5e5082897e61175f184382725dfff2ab39840290
orig/USKManager$2.class : 50144b56114f3b59fa845c7afefa89b177435bb4
orig/USKManager.class : 6b785ed0d9ef605b1ed9cf441947d7810dbbe8a4
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iQIVAwUBSBx7OliZGG6DH7hRAQIcoxAA4qewqOkRIh3mNvM1UgY7ED/SRzXLadyA
nxHz+pzuLOwE3J0migcR9I6lYuLoXXqVpCYrxJiDygJNgT5dkRBn45R35tKuIXli
dGkWe5t6xYWWNZNuosx1l2jz7XjZI5Sd1HwgWYrFDbKSaeiixeZ88kJoej7xLY0P
Mo3Q0X7yzglO407MWTJiFSs1M1XZXedUoLQUpyACp3B/S8s+MNFjrplS4o8sQEmG
RKMgq4BnbpwwaDGOsCsRXa4oqbYEDXXfWl7HDr54wNnsj3Msb2g/ZIzgpbkk+ZHQ
RApO7tRt3IBaqE+vx3xcsyQUroO29SlwqexuOLvfSimeGyHbazRG/Ob205BrCwmA
B0iCop7GFR8k2UU7prs84MsemQyizvFXJzJcgkgO7/4oNhZL93NQ8Sb4RMWY22Mi
NmDLIU140oY+n/okYdgJlIqqVNwc52FT6ilP9+BkC4HAdpwPQ/YIH65gaLBL717h
0l6kW/5jfYOVqG36zwc6dPre/XzoIovo2rl4OLnJ2rsxHMdeI2apyGUAtgOR7s4a
MffHzH5lb4VzaxGkESqNTH6Aa/xehKyz7v3PBRmIh/H6K6mkkwhLo9JNsQVijlMx
ffEIl/SQIeYcwo+jydNzzZ9mR8I577kR7xVinj90Tf8SOBYRT4eRAMdQMS80Dcff
1ypYFgVoaP0=
=Ts1E
-----END PGP SIGNATURE-----
From nextgens at freenetproject.org Sat May 3 14:50:10 2008
From: nextgens at freenetproject.org (nextgens at freenetproject.org)
Date: Sat, 3 May 2008 14:50:10 +0000 (UTC)
Subject