From nextgens at freenetproject.org Sun Jul 1 00:11:58 2007 From: nextgens at freenetproject.org (nextgens at freenetproject.org) Date: Sun, 1 Jul 2007 00:11:58 +0000 (UTC) Subject: [freenet-cvs] r13855 - in trunk/freenet/src/freenet: clients/http/bookmark node/useralerts Message-ID: <20070701001158.2B37D4793F3@emu.freenetproject.org> Author: nextgens Date: 2007-07-01 00:11:56 +0000 (Sun, 01 Jul 2007) New Revision: 13855 Modified: trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java trunk/freenet/src/freenet/node/useralerts/UserAlertManager.java Log: Add a few "final" statements where appropriate Modified: trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java =================================================================== --- trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java 2007-06-30 23:39:45 UTC (rev 13854) +++ trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java 2007-07-01 00:11:56 UTC (rev 13855) @@ -22,7 +22,7 @@ private final BookmarkUpdatedUserAlert alert; - private UserAlertManager alerts; + private final UserAlertManager alerts; public BookmarkItem(FreenetURI k, String n, UserAlertManager uam) throws MalformedURLException { Modified: trunk/freenet/src/freenet/node/useralerts/UserAlertManager.java =================================================================== --- trunk/freenet/src/freenet/node/useralerts/UserAlertManager.java 2007-06-30 23:39:45 UTC (rev 13854) +++ trunk/freenet/src/freenet/node/useralerts/UserAlertManager.java 2007-07-01 00:11:56 UTC (rev 13855) @@ -6,6 +6,7 @@ import java.util.Arrays; import java.util.Comparator; import java.util.HashSet; +import java.util.LinkedHashSet; import freenet.support.HTMLNode; import freenet.l10n.L10n; @@ -17,11 +18,11 @@ public class UserAlertManager implements Comparator { private final HashSet alerts; - private NodeClientCore core; + private final NodeClientCore core; public UserAlertManager(NodeClientCore core) { this.core = core; - alerts = new HashSet(); + alerts = new LinkedHashSet(); } public void register(UserAlert alert) { From nextgens at freenetproject.org Sun Jul 1 00:16:50 2007 From: nextgens at freenetproject.org (nextgens at freenetproject.org) Date: Sun, 1 Jul 2007 00:16:50 +0000 (UTC) Subject: [freenet-cvs] r13856 - trunk/freenet/src/freenet/node/useralerts Message-ID: <20070701001650.39D1447954F@emu.freenetproject.org> Author: nextgens Date: 2007-07-01 00:16:49 +0000 (Sun, 01 Jul 2007) New Revision: 13856 Modified: trunk/freenet/src/freenet/node/useralerts/UserAlertManager.java Log: UserAlertManager: don't register the same useralert more than once; should resolve #1450 but might have border effects Modified: trunk/freenet/src/freenet/node/useralerts/UserAlertManager.java =================================================================== --- trunk/freenet/src/freenet/node/useralerts/UserAlertManager.java 2007-07-01 00:11:56 UTC (rev 13855) +++ trunk/freenet/src/freenet/node/useralerts/UserAlertManager.java 2007-07-01 00:16:49 UTC (rev 13856) @@ -27,7 +27,8 @@ public void register(UserAlert alert) { synchronized (alerts) { - alerts.add(alert); + if(!alerts.contains(alert)) + alerts.add(alert); } } From nextgens at freenetproject.org Sun Jul 1 00:24:29 2007 From: nextgens at freenetproject.org (nextgens at freenetproject.org) Date: Sun, 1 Jul 2007 00:24:29 +0000 (UTC) Subject: [freenet-cvs] r13857 - trunk/freenet/src/freenet/clients/http Message-ID: <20070701002429.BAB2A47970A@emu.freenetproject.org> Author: nextgens Date: 2007-07-01 00:24:28 +0000 (Sun, 01 Jul 2007) New Revision: 13857 Modified: trunk/freenet/src/freenet/clients/http/WelcomeToadlet.java Log: Fix #1449: Trying to delete a notification multiple times causes temporar hangs Modified: trunk/freenet/src/freenet/clients/http/WelcomeToadlet.java =================================================================== --- trunk/freenet/src/freenet/clients/http/WelcomeToadlet.java 2007-07-01 00:16:49 UTC (rev 13856) +++ trunk/freenet/src/freenet/clients/http/WelcomeToadlet.java 2007-07-01 00:24:28 UTC (rev 13857) @@ -183,10 +183,10 @@ Logger.normal(this,"Disabling the userAlert "+alert.hashCode()); alert.isValid(false); } - - writePermanentRedirect(ctx, l10n("disabledAlert"), "/"); } } + writePermanentRedirect(ctx, l10n("disabledAlert"), "/"); + return; } else if(request.isPartSet("boardname")&&(request.isPartSet("filename")||request.isPartSet("message"))) { // Inserting into a frost board FIN // boardname From nextgens at freenetproject.org Sun Jul 1 00:32:19 2007 From: nextgens at freenetproject.org (nextgens at freenetproject.org) Date: Sun, 1 Jul 2007 00:32:19 +0000 (UTC) Subject: [freenet-cvs] r13858 - trunk/plugins/MDNSDiscovery/javax/jmdns Message-ID: <20070701003219.B70F9479806@emu.freenetproject.org> Author: nextgens Date: 2007-07-01 00:32:18 +0000 (Sun, 01 Jul 2007) New Revision: 13858 Modified: trunk/plugins/MDNSDiscovery/javax/jmdns/JmDNS.java Log: Maybe fix #1374: JMDNS doesn't verify the size of the send buffer! Modified: trunk/plugins/MDNSDiscovery/javax/jmdns/JmDNS.java =================================================================== --- trunk/plugins/MDNSDiscovery/javax/jmdns/JmDNS.java 2007-07-01 00:24:28 UTC (rev 13857) +++ trunk/plugins/MDNSDiscovery/javax/jmdns/JmDNS.java 2007-07-01 00:32:18 UTC (rev 13858) @@ -1091,7 +1091,12 @@ { logger.throwing(getClass().toString(), "send(DNSOutgoing) - JmDNS can not parse what it sends!!!", e); } - socket.send(packet); + + if(packet.getLength() > socket.getSendBufferSize()) { + logger.log(Level.SEVERE , "send(DNSOutgoing) - JmDNS can not send such a big packet!!!"); + return; + } else + socket.send(packet); } } From nextgens at freenetproject.org Sun Jul 1 11:39:33 2007 From: nextgens at freenetproject.org (nextgens at freenetproject.org) Date: Sun, 1 Jul 2007 11:39:33 +0000 (UTC) Subject: [freenet-cvs] r13859 - trunk/freenet Message-ID: <20070701113933.E59974791A7@emu.freenetproject.org> Author: nextgens Date: 2007-07-01 11:39:33 +0000 (Sun, 01 Jul 2007) New Revision: 13859 Modified: trunk/freenet/.classpath Log: Tell eclipse to include every Junit test in the classpath Modified: trunk/freenet/.classpath =================================================================== --- trunk/freenet/.classpath 2007-07-01 00:32:18 UTC (rev 13858) +++ trunk/freenet/.classpath 2007-07-01 11:39:33 UTC (rev 13859) @@ -1,7 +1,7 @@ - - + + From nextgens at freenetproject.org Sun Jul 1 11:43:04 2007 From: nextgens at freenetproject.org (nextgens at freenetproject.org) Date: Sun, 1 Jul 2007 11:43:04 +0000 (UTC) Subject: [freenet-cvs] r13860 - in trunk: freenet/src/freenet/client/async freenet/src/freenet/clients/http/filter freenet/src/freenet/keys freenet/src/freenet/node freenet/src/freenet/node/fcp freenet/src/freenet/support freenet/test/freenet/support plugins/MDNSDiscovery/com/strangeberry/jmdns/tools plugins/XMLLibrarian Message-ID: <20070701114304.D5BBF479757@emu.freenetproject.org> Author: nextgens Date: 2007-07-01 11:43:04 +0000 (Sun, 01 Jul 2007) New Revision: 13860 Modified: trunk/freenet/src/freenet/client/async/SingleBlockInserter.java trunk/freenet/src/freenet/clients/http/filter/CSSReadFilter.java trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.java trunk/freenet/src/freenet/keys/NodeCHK.java trunk/freenet/src/freenet/node/NodeCrypto.java trunk/freenet/src/freenet/node/SimpleSendableInsert.java trunk/freenet/src/freenet/node/fcp/AddPeer.java trunk/freenet/src/freenet/support/Fields.java trunk/freenet/src/freenet/support/HTMLNode.java trunk/freenet/test/freenet/support/SimpleFieldSetTest.java trunk/plugins/MDNSDiscovery/com/strangeberry/jmdns/tools/Browser.java trunk/plugins/XMLLibrarian/XMLLibrarian.java Log: imports Modified: trunk/freenet/src/freenet/client/async/SingleBlockInserter.java =================================================================== --- trunk/freenet/src/freenet/client/async/SingleBlockInserter.java 2007-07-01 11:39:33 UTC (rev 13859) +++ trunk/freenet/src/freenet/client/async/SingleBlockInserter.java 2007-07-01 11:43:04 UTC (rev 13860) @@ -21,7 +21,6 @@ import freenet.node.RequestScheduler; import freenet.node.SendableInsert; import freenet.support.Logger; -import freenet.support.RandomGrabArray; import freenet.support.SimpleFieldSet; import freenet.support.api.Bucket; Modified: trunk/freenet/src/freenet/clients/http/filter/CSSReadFilter.java =================================================================== --- trunk/freenet/src/freenet/clients/http/filter/CSSReadFilter.java 2007-07-01 11:39:33 UTC (rev 13859) +++ trunk/freenet/src/freenet/clients/http/filter/CSSReadFilter.java 2007-07-01 11:43:04 UTC (rev 13860) @@ -15,9 +15,6 @@ import java.io.Writer; import java.util.HashMap; -import freenet.l10n.L10n; -import freenet.support.HTMLEncoder; -import freenet.support.HTMLNode; import freenet.support.Logger; import freenet.support.api.Bucket; import freenet.support.api.BucketFactory; Modified: trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.java =================================================================== --- trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.java 2007-07-01 11:39:33 UTC (rev 13859) +++ trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.java 2007-07-01 11:43:04 UTC (rev 13860) @@ -5,7 +5,6 @@ * http://www.gnu.org/ for further details of the GPL. */ package freenet.clients.http.filter; import java.io.*; -import java.util.*; import freenet.l10n.L10n; /* This class tokenizes a CSS2 Reader stream, writes it out to the output Writer, and filters any URLs found */ // WARNING: this is not as thorough as the HTML parser - new versions of the standard could lead to anonymity risks. See comments in SaferFilter.java Modified: trunk/freenet/src/freenet/keys/NodeCHK.java =================================================================== --- trunk/freenet/src/freenet/keys/NodeCHK.java 2007-07-01 11:39:33 UTC (rev 13859) +++ trunk/freenet/src/freenet/keys/NodeCHK.java 2007-07-01 11:43:04 UTC (rev 13860) @@ -7,8 +7,6 @@ import java.io.DataOutput; import java.io.DataOutputStream; import java.io.IOException; -import java.util.Arrays; - import freenet.support.Base64; /** Modified: trunk/freenet/src/freenet/node/NodeCrypto.java =================================================================== --- trunk/freenet/src/freenet/node/NodeCrypto.java 2007-07-01 11:39:33 UTC (rev 13859) +++ trunk/freenet/src/freenet/node/NodeCrypto.java 2007-07-01 11:43:04 UTC (rev 13860) @@ -9,7 +9,6 @@ import java.io.OutputStreamWriter; import java.io.UnsupportedEncodingException; import java.math.BigInteger; -import java.net.InetAddress; import java.net.MalformedURLException; import java.security.MessageDigest; import java.util.zip.DeflaterOutputStream; Modified: trunk/freenet/src/freenet/node/SimpleSendableInsert.java =================================================================== --- trunk/freenet/src/freenet/node/SimpleSendableInsert.java 2007-07-01 11:39:33 UTC (rev 13859) +++ trunk/freenet/src/freenet/node/SimpleSendableInsert.java 2007-07-01 11:43:04 UTC (rev 13860) @@ -9,7 +9,6 @@ import freenet.keys.KeyBlock; import freenet.keys.SSKBlock; import freenet.support.Logger; -import freenet.support.RandomGrabArray; /** * Simple SendableInsert implementation. No feedback, no retries, just insert the Modified: trunk/freenet/src/freenet/node/fcp/AddPeer.java =================================================================== --- trunk/freenet/src/freenet/node/fcp/AddPeer.java 2007-07-01 11:39:33 UTC (rev 13859) +++ trunk/freenet/src/freenet/node/fcp/AddPeer.java 2007-07-01 11:43:04 UTC (rev 13860) @@ -16,7 +16,6 @@ import freenet.io.comm.PeerParseException; import freenet.io.comm.ReferenceSignatureVerificationException; -import freenet.node.DarknetPeerNode; import freenet.node.FSParseException; import freenet.node.Node; import freenet.node.PeerNode; Modified: trunk/freenet/src/freenet/support/Fields.java =================================================================== --- trunk/freenet/src/freenet/support/Fields.java 2007-07-01 11:39:33 UTC (rev 13859) +++ trunk/freenet/src/freenet/support/Fields.java 2007-07-01 11:43:04 UTC (rev 13860) @@ -1,6 +1,5 @@ package freenet.support; -import java.io.DataInputStream; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; Modified: trunk/freenet/src/freenet/support/HTMLNode.java =================================================================== --- trunk/freenet/src/freenet/support/HTMLNode.java 2007-07-01 11:39:33 UTC (rev 13859) +++ trunk/freenet/src/freenet/support/HTMLNode.java 2007-07-01 11:43:04 UTC (rev 13860) @@ -9,8 +9,6 @@ import java.util.Map; import java.util.Set; -import freenet.l10n.L10n; - public class HTMLNode { protected final String name; Modified: trunk/freenet/test/freenet/support/SimpleFieldSetTest.java =================================================================== --- trunk/freenet/test/freenet/support/SimpleFieldSetTest.java 2007-07-01 11:39:33 UTC (rev 13859) +++ trunk/freenet/test/freenet/support/SimpleFieldSetTest.java 2007-07-01 11:43:04 UTC (rev 13860) @@ -23,7 +23,6 @@ import java.util.Iterator; import freenet.node.FSParseException; -import freenet.support.io.LineReader; import junit.framework.TestCase; /** Modified: trunk/plugins/MDNSDiscovery/com/strangeberry/jmdns/tools/Browser.java =================================================================== --- trunk/plugins/MDNSDiscovery/com/strangeberry/jmdns/tools/Browser.java 2007-07-01 11:39:33 UTC (rev 13859) +++ trunk/plugins/MDNSDiscovery/com/strangeberry/jmdns/tools/Browser.java 2007-07-01 11:43:04 UTC (rev 13860) @@ -17,10 +17,8 @@ package plugins.MDNSDiscovery.com.strangeberry.jmdns.tools; import java.io.*; -import java.net.*; import java.util.*; import java.awt.*; -import java.awt.event.*; import javax.swing.*; import javax.swing.table.*; import javax.swing.border.*; Modified: trunk/plugins/XMLLibrarian/XMLLibrarian.java =================================================================== --- trunk/plugins/XMLLibrarian/XMLLibrarian.java 2007-07-01 11:39:33 UTC (rev 13859) +++ trunk/plugins/XMLLibrarian/XMLLibrarian.java 2007-07-01 11:43:04 UTC (rev 13860) @@ -1,6 +1,5 @@ package plugins.XMLLibrarian; -import java.io.File; import java.io.FileWriter; import java.io.UnsupportedEncodingException; import java.security.MessageDigest; @@ -16,10 +15,8 @@ import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; -import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; -import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.Attributes; import org.xml.sax.Locator; From nextgens at freenetproject.org Sun Jul 1 20:43:15 2007 From: nextgens at freenetproject.org (nextgens at freenetproject.org) Date: Sun, 1 Jul 2007 20:43:15 +0000 (UTC) Subject: [freenet-cvs] r13865 - trunk/freenet/src/freenet/l10n Message-ID: <20070701204315.A27FD479FF7@emu.freenetproject.org> Author: nextgens Date: 2007-07-01 20:43:15 +0000 (Sun, 01 Jul 2007) New Revision: 13865 Modified: trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties Log: l10n fix: fix a typo Modified: trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties =================================================================== --- trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties 2007-07-01 19:58:21 UTC (rev 13864) +++ trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties 2007-07-01 20:43:15 UTC (rev 13865) @@ -726,7 +726,7 @@ QueueToadlet.persistence=Persistence QueueToadlet.persistenceForever=forever QueueToadlet.persistenceNone=none -QueueToadlet.persistenceRebootr=reboot +QueueToadlet.persistenceReboot=reboot QueueToadlet.pleaseEnableFCP=You need to enable the FCP server to access this page QueueToadlet.priority0=emergency QueueToadlet.priority1=very high From nextgens at freenetproject.org Sun Jul 1 20:51:22 2007 From: nextgens at freenetproject.org (nextgens at freenetproject.org) Date: Sun, 1 Jul 2007 20:51:22 +0000 (UTC) Subject: [freenet-cvs] r13866 - trunk/freenet/src/freenet/l10n Message-ID: <20070701205122.8213747A22C@emu.freenetproject.org> Author: nextgens Date: 2007-07-01 20:51:22 +0000 (Sun, 01 Jul 2007) New Revision: 13866 Modified: trunk/freenet/src/freenet/l10n/freenet.l10n.fr.properties trunk/freenet/src/freenet/l10n/freenet.l10n.it.properties trunk/freenet/src/freenet/l10n/freenet.l10n.se.properties Log: l10n: fix it for all languages Modified: trunk/freenet/src/freenet/l10n/freenet.l10n.fr.properties =================================================================== --- trunk/freenet/src/freenet/l10n/freenet.l10n.fr.properties 2007-07-01 20:43:15 UTC (rev 13865) +++ trunk/freenet/src/freenet/l10n/freenet.l10n.fr.properties 2007-07-01 20:51:22 UTC (rev 13866) @@ -684,7 +684,7 @@ QueueToadlet.persistence=Persistance QueueToadlet.persistenceForever=toujours QueueToadlet.persistenceNone=aucune -QueueToadlet.persistenceRebootr=Red?marrer +QueueToadlet.persistenceReboot=Red?marrer QueueToadlet.pleaseEnableFCP=Vous devez activer les serveur FCP pour acc?der ? cette page QueueToadlet.priority=Priorit? QueueToadlet.priority0=urgent Modified: trunk/freenet/src/freenet/l10n/freenet.l10n.it.properties =================================================================== --- trunk/freenet/src/freenet/l10n/freenet.l10n.it.properties 2007-07-01 20:43:15 UTC (rev 13865) +++ trunk/freenet/src/freenet/l10n/freenet.l10n.it.properties 2007-07-01 20:51:22 UTC (rev 13866) @@ -735,7 +735,7 @@ QueueToadlet.persistence=Persistenza QueueToadlet.persistenceForever=illimitata QueueToadlet.persistenceNone=nessuna -QueueToadlet.persistenceRebootr=reboot +QueueToadlet.persistenceReboot=reboot QueueToadlet.pleaseEnableFCP=Per accedere a questa pagina ? necessario abilitare il server FCP QueueToadlet.priority=Priorit? QueueToadlet.priority0=urgenza estrema Modified: trunk/freenet/src/freenet/l10n/freenet.l10n.se.properties =================================================================== --- trunk/freenet/src/freenet/l10n/freenet.l10n.se.properties 2007-07-01 20:43:15 UTC (rev 13865) +++ trunk/freenet/src/freenet/l10n/freenet.l10n.se.properties 2007-07-01 20:51:22 UTC (rev 13866) @@ -513,7 +513,7 @@ QueueToadlet.panicButtonConfirmation=Radera allt utan att fr?ga!\u00a0 QueueToadlet.persistenceForever=F?revigt QueueToadlet.persistenceNone=ingen -QueueToadlet.persistenceRebootr=starta om +QueueToadlet.persistenceReboot=starta om QueueToadlet.pleaseEnableFCP=Du m?ste aktivera FCP f?r att f? ?tkomst till den h?r sidan. QueueToadlet.priority=Prioritet QueueToadlet.priority0=n?dfall @@ -688,4 +688,4 @@ WelcomeToadlet.homepageFullTitleWithName=Freenet FProxy Hemsida f?r ${name} WelcomeToadlet.ieWarning=Du verkar anv?nda Microsoft Internet Explorer. Ondsint skrivna Freenet sidor kan vara en fara f?r din anonymitet! WelcomeToadlet.ieWarningTitle=S?kerhetsrisk! -WelcomeToadlet.insertCount \ No newline at end of file +WelcomeToadlet.insertCount From nextgens at freenetproject.org Mon Jul 2 18:44:23 2007 From: nextgens at freenetproject.org (nextgens at freenetproject.org) Date: Mon, 2 Jul 2007 18:44:23 +0000 (UTC) Subject: [freenet-cvs] r13880 - trunk/plugins Message-ID: <20070702184423.DCD0547981D@emu.freenetproject.org> Author: nextgens Date: 2007-07-02 18:44:23 +0000 (Mon, 02 Jul 2007) New Revision: 13880 Removed: trunk/plugins/JabberLinker/ Log: Remove JabberLinker; it's not ready yet From nextgens at freenetproject.org Tue Jul 3 11:13:20 2007 From: nextgens at freenetproject.org (nextgens at freenetproject.org) Date: Tue, 3 Jul 2007 11:13:20 +0000 (UTC) Subject: [freenet-cvs] r13881 - trunk/plugins Message-ID: <20070703111320.9D63A4791BA@emu.freenetproject.org> Author: nextgens Date: 2007-07-03 11:13:20 +0000 (Tue, 03 Jul 2007) New Revision: 13881 Modified: trunk/plugins/build.xml Log: indent Modified: trunk/plugins/build.xml =================================================================== --- trunk/plugins/build.xml 2007-07-02 18:44:23 UTC (rev 13880) +++ trunk/plugins/build.xml 2007-07-03 11:13:20 UTC (rev 13881) @@ -8,43 +8,43 @@ - - - - - - + + + + + + - - - - - + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - + + + + + From nextgens at freenetproject.org Tue Jul 3 11:14:32 2007 From: nextgens at freenetproject.org (nextgens at freenetproject.org) Date: Tue, 3 Jul 2007 11:14:32 +0000 (UTC) Subject: [freenet-cvs] r13882 - trunk/plugins Message-ID: <20070703111432.52A354791BE@emu.freenetproject.org> Author: nextgens Date: 2007-07-03 11:14:32 +0000 (Tue, 03 Jul 2007) New Revision: 13882 Modified: trunk/plugins/build.xml Log: tweak the ant buildfile for plugins ... so that it will bundle things from the resources/ directory and license files Modified: trunk/plugins/build.xml =================================================================== --- trunk/plugins/build.xml 2007-07-03 11:13:20 UTC (rev 13881) +++ trunk/plugins/build.xml 2007-07-03 11:14:32 UTC (rev 13882) @@ -35,10 +35,13 @@ - + + + + From nextgens at freenetproject.org Tue Jul 3 11:19:08 2007 From: nextgens at freenetproject.org (nextgens at freenetproject.org) Date: Tue, 3 Jul 2007 11:19:08 +0000 (UTC) Subject: [freenet-cvs] r13883 - trunk/plugins Message-ID: <20070703111908.3B097479856@emu.freenetproject.org> Author: nextgens Date: 2007-07-03 11:19:08 +0000 (Tue, 03 Jul 2007) New Revision: 13883 Modified: trunk/plugins/build.xml Log: doh Modified: trunk/plugins/build.xml =================================================================== --- trunk/plugins/build.xml 2007-07-03 11:14:32 UTC (rev 13882) +++ trunk/plugins/build.xml 2007-07-03 11:19:08 UTC (rev 13883) @@ -2,8 +2,8 @@ - - + + @@ -39,8 +39,8 @@ - - + + From nextgens at freenetproject.org Tue Jul 3 11:21:12 2007 From: nextgens at freenetproject.org (nextgens at freenetproject.org) Date: Tue, 3 Jul 2007 11:21:12 +0000 (UTC) Subject: [freenet-cvs] r13884 - trunk/plugins Message-ID: <20070703112112.BAB9747973D@emu.freenetproject.org> Author: nextgens Date: 2007-07-03 11:21:12 +0000 (Tue, 03 Jul 2007) New Revision: 13884 Modified: trunk/plugins/build.xml Log: doh2 Modified: trunk/plugins/build.xml =================================================================== --- trunk/plugins/build.xml 2007-07-03 11:19:08 UTC (rev 13883) +++ trunk/plugins/build.xml 2007-07-03 11:21:12 UTC (rev 13884) @@ -11,6 +11,7 @@ + From nextgens at freenetproject.org Tue Jul 3 11:32:41 2007 From: nextgens at freenetproject.org (nextgens at freenetproject.org) Date: Tue, 3 Jul 2007 11:32:41 +0000 (UTC) Subject: [freenet-cvs] r13885 - trunk/plugins Message-ID: <20070703113241.127C347A1D9@emu.freenetproject.org> Author: nextgens Date: 2007-07-03 11:32:40 +0000 (Tue, 03 Jul 2007) New Revision: 13885 Modified: trunk/plugins/build.xml Log: fix it once for all Modified: trunk/plugins/build.xml =================================================================== --- trunk/plugins/build.xml 2007-07-03 11:21:12 UTC (rev 13884) +++ trunk/plugins/build.xml 2007-07-03 11:32:40 UTC (rev 13885) @@ -41,7 +41,9 @@ - + + + From nextgens at freenetproject.org Tue Jul 3 11:53:35 2007 From: nextgens at freenetproject.org (nextgens at freenetproject.org) Date: Tue, 3 Jul 2007 11:53:35 +0000 (UTC) Subject: [freenet-cvs] r13887 - trunk/plugins Message-ID: <20070703115335.5F76D47A22E@emu.freenetproject.org> Author: nextgens Date: 2007-07-03 11:53:35 +0000 (Tue, 03 Jul 2007) New Revision: 13887 Modified: trunk/plugins/build.xml Log: include the resources folder in the classpath Modified: trunk/plugins/build.xml =================================================================== --- trunk/plugins/build.xml 2007-07-03 11:50:25 UTC (rev 13886) +++ trunk/plugins/build.xml 2007-07-03 11:53:35 UTC (rev 13887) @@ -27,6 +27,7 @@ + From nextgens at freenetproject.org Tue Jul 3 12:07:16 2007 From: nextgens at freenetproject.org (nextgens at freenetproject.org) Date: Tue, 3 Jul 2007 12:07:16 +0000 (UTC) Subject: [freenet-cvs] r13888 - trunk/plugins Message-ID: <20070703120716.9013F47A2D7@emu.freenetproject.org> Author: nextgens Date: 2007-07-03 12:07:16 +0000 (Tue, 03 Jul 2007) New Revision: 13888 Modified: trunk/plugins/build.xml Log: The whole 'resources' hack was a *bad* idea... we dont want binaries to be commited anyway Modified: trunk/plugins/build.xml =================================================================== --- trunk/plugins/build.xml 2007-07-03 11:53:35 UTC (rev 13887) +++ trunk/plugins/build.xml 2007-07-03 12:07:16 UTC (rev 13888) @@ -11,7 +11,6 @@ - @@ -27,7 +26,6 @@ - @@ -41,7 +39,6 @@ - From toad at freenetproject.org Tue Jul 3 13:30:16 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Tue, 3 Jul 2007 13:30:16 +0000 (UTC) Subject: [freenet-cvs] r13889 - trunk/freenet/src/freenet/config Message-ID: <20070703133016.446DD479836@emu.freenetproject.org> Author: toad Date: 2007-07-03 13:30:16 +0000 (Tue, 03 Jul 2007) New Revision: 13889 Modified: trunk/freenet/src/freenet/config/FreenetFilePersistentConfig.java Log: Logging Modified: trunk/freenet/src/freenet/config/FreenetFilePersistentConfig.java =================================================================== --- trunk/freenet/src/freenet/config/FreenetFilePersistentConfig.java 2007-07-03 12:07:16 UTC (rev 13888) +++ trunk/freenet/src/freenet/config/FreenetFilePersistentConfig.java 2007-07-03 13:30:16 UTC (rev 13889) @@ -48,7 +48,7 @@ public void store() { synchronized(this) { if(!finishedInit) { - Logger.error(this, "Initialization not finished, refusing to write config", new Exception("error")); + Logger.minor(this, "Initialization not finished, refusing to write config", new Exception("error")); return; } } From toad at freenetproject.org Tue Jul 3 13:31:24 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Tue, 3 Jul 2007 13:31:24 +0000 (UTC) Subject: [freenet-cvs] r13890 - trunk/freenet/src/freenet/io/comm Message-ID: <20070703133124.E671C47A083@emu.freenetproject.org> Author: toad Date: 2007-07-03 13:31:24 +0000 (Tue, 03 Jul 2007) New Revision: 13890 Modified: trunk/freenet/src/freenet/io/comm/UdpSocketHandler.java Log: Don't crash on a normal completion (e.g. turning opennet off) Modified: trunk/freenet/src/freenet/io/comm/UdpSocketHandler.java =================================================================== --- trunk/freenet/src/freenet/io/comm/UdpSocketHandler.java 2007-07-03 13:30:16 UTC (rev 13889) +++ trunk/freenet/src/freenet/io/comm/UdpSocketHandler.java 2007-07-03 13:31:24 UTC (rev 13890) @@ -102,8 +102,8 @@ t.printStackTrace(); } catch (Throwable tt) {}; } finally { - System.err.println("run() exiting"); - Logger.error(this, "run() exiting"); + System.err.println("run() exiting for UdpSocketHandler on port "+_sock.getLocalPort()); + Logger.error(this, "run() exiting for UdpSocketHandler on port "+_sock.getLocalPort()); synchronized (this) { _isDone = true; notifyAll(); @@ -319,6 +319,11 @@ } } } else { + if(_isDone) return; + // Final check + synchronized(this) { + if(_isDone) return; + } Logger.error(this, "MAIN LOOP TERMINATED"); System.err.println("MAIN LOOP TERMINATED!"); node.exit(NodeInitException.EXIT_MAIN_LOOP_LOST); From toad at freenetproject.org Tue Jul 3 13:42:25 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Tue, 3 Jul 2007 13:42:25 +0000 (UTC) Subject: [freenet-cvs] r13891 - trunk/freenet/src/freenet/io/comm Message-ID: <20070703134225.B2333479835@emu.freenetproject.org> Author: toad Date: 2007-07-03 13:42:25 +0000 (Tue, 03 Jul 2007) New Revision: 13891 Modified: trunk/freenet/src/freenet/io/comm/UdpSocketHandler.java Log: Should be NORMAL at most Modified: trunk/freenet/src/freenet/io/comm/UdpSocketHandler.java =================================================================== --- trunk/freenet/src/freenet/io/comm/UdpSocketHandler.java 2007-07-03 13:31:24 UTC (rev 13890) +++ trunk/freenet/src/freenet/io/comm/UdpSocketHandler.java 2007-07-03 13:42:25 UTC (rev 13891) @@ -333,7 +333,7 @@ } public void close(boolean exit) { - Logger.error(this, "Closing.", new Exception("error")); + Logger.normal(this, "Closing.", new Exception("error")); synchronized (this) { _active = false; while (!_isDone) { From toad at freenetproject.org Tue Jul 3 13:47:13 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Tue, 3 Jul 2007 13:47:13 +0000 (UTC) Subject: [freenet-cvs] r13892 - trunk/freenet/src/freenet/client Message-ID: <20070703134713.8B80847A1D7@emu.freenetproject.org> Author: toad Date: 2007-07-03 13:47:13 +0000 (Tue, 03 Jul 2007) New Revision: 13892 Modified: trunk/freenet/src/freenet/client/ArchiveManager.java Log: Better logging Modified: trunk/freenet/src/freenet/client/ArchiveManager.java =================================================================== --- trunk/freenet/src/freenet/client/ArchiveManager.java 2007-07-03 13:42:25 UTC (rev 13891) +++ trunk/freenet/src/freenet/client/ArchiveManager.java 2007-07-03 13:47:13 UTC (rev 13892) @@ -330,6 +330,7 @@ throw new ArchiveFailureException("Failed to create metadata: "+e1, e1); } } catch (IOException e1) { + Logger.error(this, "Failed to create metadata: "+e1, e1); throw new ArchiveFailureException("Failed to create metadata: "+e1, e1); } } From toad at freenetproject.org Tue Jul 3 13:57:31 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Tue, 3 Jul 2007 13:57:31 +0000 (UTC) Subject: [freenet-cvs] r13893 - trunk/freenet/src/freenet/node Message-ID: <20070703135731.6E943479923@emu.freenetproject.org> Author: toad Date: 2007-07-03 13:57:31 +0000 (Tue, 03 Jul 2007) New Revision: 13893 Modified: trunk/freenet/src/freenet/node/Persister.java Log: Better logging Modified: trunk/freenet/src/freenet/node/Persister.java =================================================================== --- trunk/freenet/src/freenet/node/Persister.java 2007-07-03 13:47:13 UTC (rev 13892) +++ trunk/freenet/src/freenet/node/Persister.java 2007-07-03 13:57:31 UTC (rev 13893) @@ -91,7 +91,10 @@ } } if(!persistTemp.renameTo(persistTarget)) { - Logger.error(this, "Could not rename "+persistTemp+" to "+persistTarget+" - check permissions"); + Logger.error(this, "Could not rename "+persistTemp+" to "+persistTarget+ + (persistTarget.exists() ? " (target exists)" : "")+ + (persistTemp.exists() ? " (source exists)" : "")+ + " - check permissions"); } } } catch (FileNotFoundException e) { From toad at freenetproject.org Tue Jul 3 14:13:19 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Tue, 3 Jul 2007 14:13:19 +0000 (UTC) Subject: [freenet-cvs] r13894 - trunk/freenet/src/freenet/node Message-ID: <20070703141319.D92F8479747@emu.freenetproject.org> Author: toad Date: 2007-07-03 14:13:19 +0000 (Tue, 03 Jul 2007) New Revision: 13894 Modified: trunk/freenet/src/freenet/node/NodeCrypto.java Log: Put opennet in BEFORE signing the noderef Modified: trunk/freenet/src/freenet/node/NodeCrypto.java =================================================================== --- trunk/freenet/src/freenet/node/NodeCrypto.java 2007-07-03 13:57:31 UTC (rev 13893) +++ trunk/freenet/src/freenet/node/NodeCrypto.java 2007-07-03 14:13:19 UTC (rev 13894) @@ -273,6 +273,7 @@ fs.put("testnetPort", node.testnetHandler.getPort()); // Useful, saves a lot of complexity if(!isOpennet) fs.putSingle("myName", node.getMyName()); // FIXME see #942 + fs.put("opennet", isOpennet); synchronized (referenceSync) { if(myReferenceSignature == null || mySignedReference == null || !mySignedReference.equals(fs.toOrderedString())){ @@ -285,7 +286,6 @@ } fs.putSingle("sig", myReferenceSignature.toLongString()); } - fs.put("opennet", isOpennet); if(logMINOR) Logger.minor(this, "My reference: "+fs.toOrderedString()); return fs; From toad at freenetproject.org Tue Jul 3 14:17:07 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Tue, 3 Jul 2007 14:17:07 +0000 (UTC) Subject: [freenet-cvs] r13895 - trunk/freenet/src/freenet/node Message-ID: <20070703141707.53DF2479829@emu.freenetproject.org> Author: toad Date: 2007-07-03 14:17:07 +0000 (Tue, 03 Jul 2007) New Revision: 13895 Modified: trunk/freenet/src/freenet/node/NodeDispatcher.java Log: Fix NPE Modified: trunk/freenet/src/freenet/node/NodeDispatcher.java =================================================================== --- trunk/freenet/src/freenet/node/NodeDispatcher.java 2007-07-03 14:13:19 UTC (rev 13894) +++ trunk/freenet/src/freenet/node/NodeDispatcher.java 2007-07-03 14:17:07 UTC (rev 13895) @@ -867,7 +867,7 @@ // Just propagate back to source PeerNode origSource = (PeerNode) ctx.getSource(); - if(src != null) { + if(origSource != null) { Message complete = DMT.createFNPProbeReply(id, target, nearest, best, counter++, linearCounter); Message sub = m.getSubMessage(DMT.FNPBestRoutesNotTaken); if(sub != null) complete.addSubMessage(sub); From toad at freenetproject.org Tue Jul 3 14:21:13 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Tue, 3 Jul 2007 14:21:13 +0000 (UTC) Subject: [freenet-cvs] r13896 - trunk/freenet/src/freenet/node Message-ID: <20070703142113.EA7494798E1@emu.freenetproject.org> Author: toad Date: 2007-07-03 14:21:13 +0000 (Tue, 03 Jul 2007) New Revision: 13896 Modified: trunk/freenet/src/freenet/node/DarknetPeerNode.java trunk/freenet/src/freenet/node/OpennetPeerNode.java trunk/freenet/src/freenet/node/PeerNode.java Log: Actually check the opennet field Modified: trunk/freenet/src/freenet/node/DarknetPeerNode.java =================================================================== --- trunk/freenet/src/freenet/node/DarknetPeerNode.java 2007-07-03 14:17:07 UTC (rev 13895) +++ trunk/freenet/src/freenet/node/DarknetPeerNode.java 2007-07-03 14:21:13 UTC (rev 13896) @@ -95,7 +95,7 @@ * @param node2 The running Node we are part of. */ public DarknetPeerNode(SimpleFieldSet fs, Node node2, NodeCrypto crypto, PeerManager peers, boolean fromLocal, OutgoingPacketMangler mangler) throws FSParseException, PeerParseException, ReferenceSignatureVerificationException { - super(fs, node2, crypto, peers, fromLocal, mangler); + super(fs, node2, crypto, peers, fromLocal, mangler, false); logMINOR = Logger.shouldLog(Logger.MINOR, this); Modified: trunk/freenet/src/freenet/node/OpennetPeerNode.java =================================================================== --- trunk/freenet/src/freenet/node/OpennetPeerNode.java 2007-07-03 14:17:07 UTC (rev 13895) +++ trunk/freenet/src/freenet/node/OpennetPeerNode.java 2007-07-03 14:21:13 UTC (rev 13896) @@ -7,7 +7,7 @@ public class OpennetPeerNode extends PeerNode { public OpennetPeerNode(SimpleFieldSet fs, Node node2, NodeCrypto crypto, PeerManager peers, boolean fromLocal, OutgoingPacketMangler mangler) throws FSParseException, PeerParseException, ReferenceSignatureVerificationException { - super(fs, node2, crypto, peers, fromLocal, mangler); + super(fs, node2, crypto, peers, fromLocal, mangler, true); } public PeerNodeStatus getStatus() { Modified: trunk/freenet/src/freenet/node/PeerNode.java =================================================================== --- trunk/freenet/src/freenet/node/PeerNode.java 2007-07-03 14:17:07 UTC (rev 13895) +++ trunk/freenet/src/freenet/node/PeerNode.java 2007-07-03 14:21:13 UTC (rev 13896) @@ -314,7 +314,7 @@ * @param fs The SimpleFieldSet to parse * @param node2 The running Node we are part of. */ - public PeerNode(SimpleFieldSet fs, Node node2, NodeCrypto crypto, PeerManager peers, boolean fromLocal, OutgoingPacketMangler mangler) throws FSParseException, PeerParseException, ReferenceSignatureVerificationException { + public PeerNode(SimpleFieldSet fs, Node node2, NodeCrypto crypto, PeerManager peers, boolean fromLocal, OutgoingPacketMangler mangler, boolean isOpennet) throws FSParseException, PeerParseException, ReferenceSignatureVerificationException { logMINOR = Logger.shouldLog(Logger.MINOR, PeerNode.class); myRef = new WeakReference(this); this.outgoingMangler = mangler; @@ -385,6 +385,9 @@ if(negTypes == null || negTypes.length == 0) negTypes = new int[] { 0 }; + if((!fromLocal) && fs.getBoolean("opennet", false) != isOpennet) + throw new FSParseException("Trying to parse a darknet peer as opennet or an opennet peer as darknet"); + /* Read the DSA key material for the peer */ try { SimpleFieldSet sfs = fs.subset("dsaGroup"); From fred at freenetproject.org Tue Jul 3 14:46:27 2007 From: fred at freenetproject.org (fred at freenetproject.org) Date: Tue, 3 Jul 2007 14:46:27 +0000 (UTC) Subject: [freenet-cvs] r13897 - trunk/plugins Message-ID: <20070703144627.0F01E4790B0@emu.freenetproject.org> Author: fred Date: 2007-07-03 14:46:26 +0000 (Tue, 03 Jul 2007) New Revision: 13897 Added: trunk/plugins/echo/ Log: First commit! Echo is a CMS engine for Freenet From fred at freenetproject.org Tue Jul 3 14:51:22 2007 From: fred at freenetproject.org (fred at freenetproject.org) Date: Tue, 3 Jul 2007 14:51:22 +0000 (UTC) Subject: [freenet-cvs] r13898 - trunk/plugins Message-ID: <20070703145122.7EA584796ED@emu.freenetproject.org> Author: fred Date: 2007-07-03 14:51:22 +0000 (Tue, 03 Jul 2007) New Revision: 13898 Added: trunk/plugins/Echo/ Removed: trunk/plugins/echo/ Log: Better with an uppercase Copied: trunk/plugins/Echo (from rev 13897, trunk/plugins/echo) From toad at freenetproject.org Tue Jul 3 14:55:25 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Tue, 3 Jul 2007 14:55:25 +0000 (UTC) Subject: [freenet-cvs] r13899 - trunk/freenet/src/freenet/node Message-ID: <20070703145525.F2CC5479757@emu.freenetproject.org> Author: toad Date: 2007-07-03 14:55:25 +0000 (Tue, 03 Jul 2007) New Revision: 13899 Modified: trunk/freenet/src/freenet/node/NodeDispatcher.java Log: Fix linearCounter Modified: trunk/freenet/src/freenet/node/NodeDispatcher.java =================================================================== --- trunk/freenet/src/freenet/node/NodeDispatcher.java 2007-07-03 14:51:22 UTC (rev 13898) +++ trunk/freenet/src/freenet/node/NodeDispatcher.java 2007-07-03 14:55:25 UTC (rev 13899) @@ -574,6 +574,7 @@ } } if(linearCounter < 0) linearCounter = ctx.linearCounter; + ctx.linearCounter = linearCounter; if(locsNotVisited != null) { if(logMINOR) Logger.minor(this, "Locs not visited: "+locsNotVisited); From toad at freenetproject.org Tue Jul 3 15:22:46 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Tue, 3 Jul 2007 15:22:46 +0000 (UTC) Subject: [freenet-cvs] r13901 - trunk/freenet/src/freenet/node Message-ID: <20070703152246.4DB564798D9@emu.freenetproject.org> Author: toad Date: 2007-07-03 15:22:46 +0000 (Tue, 03 Jul 2007) New Revision: 13901 Modified: trunk/freenet/src/freenet/node/NodeDispatcher.java Log: Better tracing Modified: trunk/freenet/src/freenet/node/NodeDispatcher.java =================================================================== --- trunk/freenet/src/freenet/node/NodeDispatcher.java 2007-07-03 15:11:30 UTC (rev 13900) +++ trunk/freenet/src/freenet/node/NodeDispatcher.java 2007-07-03 15:22:46 UTC (rev 13901) @@ -573,6 +573,7 @@ recentProbeContexts.popValue(); } } + PeerNode origSource = ctx.getSource(); if(linearCounter < 0) linearCounter = ctx.linearCounter; ctx.linearCounter = linearCounter; if(locsNotVisited != null) { @@ -740,12 +741,12 @@ visited.add(pn); - if(src != null) { + if(origSource != null) { Message trace = DMT.createFNPProbeTrace(id, target, nearest, best, htl, counter, myLoc, node.swapIdentifier, LocationManager.extractLocs(peers, true), LocationManager.extractUIDs(peers), ctx.forkCount, linearCounter, callerReason, src == null ? -1 : src.swapIdentifier); trace.addSubMessage(sub); try { - src.sendAsync(trace, null, 0, null); + origSource.sendAsync(trace, null, 0, null); } catch (NotConnectedException e1) { // Ignore } From toad at freenetproject.org Tue Jul 3 15:37:36 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Tue, 3 Jul 2007 15:37:36 +0000 (UTC) Subject: [freenet-cvs] r13903 - trunk/freenet/src/freenet/node Message-ID: <20070703153736.A882647A088@emu.freenetproject.org> Author: toad Date: 2007-07-03 15:37:36 +0000 (Tue, 03 Jul 2007) New Revision: 13903 Modified: trunk/freenet/src/freenet/node/NodeDispatcher.java Log: Don't reject a rejection! Send the rejections to the right place Modified: trunk/freenet/src/freenet/node/NodeDispatcher.java =================================================================== --- trunk/freenet/src/freenet/node/NodeDispatcher.java 2007-07-03 15:24:49 UTC (rev 13902) +++ trunk/freenet/src/freenet/node/NodeDispatcher.java 2007-07-03 15:37:36 UTC (rev 13903) @@ -660,7 +660,7 @@ ctx.nearest = nearest; ctx.htl = htl; } else { - htl = node.decrementHTL(src, htl); + htl = node.decrementHTL(origSource, htl); ctx.htl = htl; if(logMINOR) Logger.minor(this, "Updated htl to "+htl+" - myLoc="+myLoc+", target="+target+", nearest="+nearest); @@ -668,13 +668,13 @@ // Complete ? if(htl == 0) { - if(src != null) { + if(origSource != null) { // Complete Message complete = DMT.createFNPProbeReply(id, target, nearest, best, counter++, linearCounter); Message sub = DMT.createFNPBestRoutesNotTaken((Double[])locsNotVisited.toArray(new Double[locsNotVisited.size()])); complete.addSubMessage(sub); try { - src.sendAsync(complete, null, 0, null); + origSource.sendAsync(complete, null, 0, null); } catch (NotConnectedException e) { Logger.error(this, "Not connected completing a probe request from "+src); } @@ -962,7 +962,7 @@ for(int i=0;i Author: toad Date: 2007-07-03 15:41:25 +0000 (Tue, 03 Jul 2007) New Revision: 13904 Modified: trunk/freenet/src/freenet/node/NodeDispatcher.java Log: In no case create a new ctx unless it's an incoming request Modified: trunk/freenet/src/freenet/node/NodeDispatcher.java =================================================================== --- trunk/freenet/src/freenet/node/NodeDispatcher.java 2007-07-03 15:37:36 UTC (rev 13903) +++ trunk/freenet/src/freenet/node/NodeDispatcher.java 2007-07-03 15:41:25 UTC (rev 13904) @@ -513,7 +513,7 @@ for(int i=0;i MAX_PROBE_CONTEXTS) @@ -862,7 +865,7 @@ furthestDist = dist; } } - if(innerHandleProbeRequest(src, id, lid, target, best, nearest, ctx.htl, counter, false, false, false, null, notVisitedList, mustBeBetterThan, true, linearCounter, "backtracking")) + if(innerHandleProbeRequest(src, id, lid, target, best, nearest, ctx.htl, counter, false, false, false, false, null, notVisitedList, mustBeBetterThan, true, linearCounter, "backtracking")) return true; } } @@ -962,7 +965,7 @@ for(int i=0;i d) ? nodeLoc : furthestGreater(d), nodeLoc, node.maxHTL(), (short)0, false, false, false, cb, new Vector(), 2.0, false, (short)-1, "start"); + innerHandleProbeRequest(null, l, ll, d, (nodeLoc > d) ? nodeLoc : furthestGreater(d), nodeLoc, node.maxHTL(), (short)0, false, false, false, true, cb, new Vector(), 2.0, false, (short)-1, "start"); } private double furthestLoc(double d) { From sback at freenetproject.org Tue Jul 3 21:38:24 2007 From: sback at freenetproject.org (sback at freenetproject.org) Date: Tue, 3 Jul 2007 21:38:24 +0000 (UTC) Subject: [freenet-cvs] r13905 - trunk/freenet/src/freenet/support Message-ID: <20070703213824.648B5391D6B@emu.freenetproject.org> Author: sback Date: 2007-07-03 21:38:24 +0000 (Tue, 03 Jul 2007) New Revision: 13905 Modified: trunk/freenet/src/freenet/support/TimeUtil.java Log: Some comments added to increase class readability Modified: trunk/freenet/src/freenet/support/TimeUtil.java =================================================================== --- trunk/freenet/src/freenet/support/TimeUtil.java 2007-07-03 15:41:25 UTC (rev 13904) +++ trunk/freenet/src/freenet/support/TimeUtil.java 2007-07-03 21:38:24 UTC (rev 13905) @@ -25,6 +25,17 @@ * Formats milliseconds into a week/day/hour/second/milliseconds string. */ public class TimeUtil { + + /** + * It converts a given time interval into a + * week/day/hour/second.milliseconds string. + * @param timeInterval interval to convert + * @param maxTerms the terms number to display + * (e.g. 2 means "h" and "m" if the time could be expressed in hour, + * 3 means "h","m","s" in the same example) + * @param withSecondFractions if true it displays seconds.milliseconds + * @return the formatted String + */ public static String formatTime(long timeInterval, int maxTerms, boolean withSecondFractions) { StringBuffer sb = new StringBuffer(64); long l = timeInterval; From sback at freenetproject.org Tue Jul 3 21:57:27 2007 From: sback at freenetproject.org (sback at freenetproject.org) Date: Tue, 3 Jul 2007 21:57:27 +0000 (UTC) Subject: [freenet-cvs] r13906 - trunk/freenet/src/freenet/support Message-ID: <20070703215727.B23A84798BA@emu.freenetproject.org> Author: sback Date: 2007-07-03 21:57:27 +0000 (Tue, 03 Jul 2007) New Revision: 13906 Modified: trunk/freenet/src/freenet/support/TimeUtil.java Log: Bugfix: now it works correctly when formatTime() is called with term argument 0 or 1 Modified: trunk/freenet/src/freenet/support/TimeUtil.java =================================================================== --- trunk/freenet/src/freenet/support/TimeUtil.java 2007-07-03 21:38:24 UTC (rev 13905) +++ trunk/freenet/src/freenet/support/TimeUtil.java 2007-07-03 21:57:27 UTC (rev 13906) @@ -48,6 +48,9 @@ if( !withSecondFractions && l < 1000 ) { return ""; } + if(termCount >= maxTerms) { + return sb.toString(); + } // int weeks = (int)(l / ((long)7*24*60*60*1000)); if (weeks > 0) { @@ -55,6 +58,9 @@ termCount++; l = l - ((long)weeks * ((long)7*24*60*60*1000)); } + if(termCount >= maxTerms) { + return sb.toString(); + } // int days = (int)(l / ((long)24*60*60*1000)); if (days > 0) { From sback at freenetproject.org Tue Jul 3 22:26:03 2007 From: sback at freenetproject.org (sback at freenetproject.org) Date: Tue, 3 Jul 2007 22:26:03 +0000 (UTC) Subject: [freenet-cvs] r13907 - trunk/freenet/src/freenet/support Message-ID: <20070703222603.BD4B847A022@emu.freenetproject.org> Author: sback Date: 2007-07-03 22:26:03 +0000 (Tue, 03 Jul 2007) New Revision: 13907 Modified: trunk/freenet/src/freenet/support/TimeUtil.java Log: Now it throws a IllegalArgumentException if the client wants to display more than 6 terms (which is the maximum) Modified: trunk/freenet/src/freenet/support/TimeUtil.java =================================================================== --- trunk/freenet/src/freenet/support/TimeUtil.java 2007-07-03 21:57:27 UTC (rev 13906) +++ trunk/freenet/src/freenet/support/TimeUtil.java 2007-07-03 22:26:03 UTC (rev 13907) @@ -32,12 +32,17 @@ * @param timeInterval interval to convert * @param maxTerms the terms number to display * (e.g. 2 means "h" and "m" if the time could be expressed in hour, - * 3 means "h","m","s" in the same example) + * 3 means "h","m","s" in the same example). + * The maximum terms number available is 6 * @param withSecondFractions if true it displays seconds.milliseconds * @return the formatted String */ public static String formatTime(long timeInterval, int maxTerms, boolean withSecondFractions) { - StringBuffer sb = new StringBuffer(64); + + if (maxTerms > 6 ) + throw new IllegalArgumentException(); + + StringBuffer sb = new StringBuffer(64); long l = timeInterval; int termCount = 0; // From sback at freenetproject.org Tue Jul 3 22:28:11 2007 From: sback at freenetproject.org (sback at freenetproject.org) Date: Tue, 3 Jul 2007 22:28:11 +0000 (UTC) Subject: [freenet-cvs] r13908 - trunk/freenet/test/freenet/support Message-ID: <20070703222811.E090F47A079@emu.freenetproject.org> Author: sback Date: 2007-07-03 22:28:11 +0000 (Tue, 03 Jul 2007) New Revision: 13908 Added: trunk/freenet/test/freenet/support/TimeUtilTest.java Log: Test class for support.TimeUtil. Three tests methods are commented due to bug 0001492 Added: trunk/freenet/test/freenet/support/TimeUtilTest.java =================================================================== --- trunk/freenet/test/freenet/support/TimeUtilTest.java (rev 0) +++ trunk/freenet/test/freenet/support/TimeUtilTest.java 2007-07-03 22:28:11 UTC (rev 13908) @@ -0,0 +1,103 @@ +package freenet.support; + +import junit.framework.TestCase; + +public class TimeUtilTest extends TestCase { + + private long oneForTermLong = 694861001; //1w+1d+1h+1m+1s+1ms + + /** + * Tests formatTime(long,int,boolean) method + * trying the biggest long value + */ + public void testFormatTime_LongIntBoolean_MaxValue() { + // TimeUtil.formatTime(Long.MAX_VALUE,6,true); + // it does not works correctly yet, see bug: 0001492 + } + + /** + * Tests formatTime(long,int) method + * trying the biggest long value + */ + public void testFormatTime_LongInt() { + // TimeUtil.formatTime(Long.MAX_VALUE,6); + // it does not works correctly yet, see bug: 0001492 + } + + /** + * Tests formatTime(long) method + * trying the biggest long value + */ + public void testFormatTime_Long() { + // Long methodBiggestValue = Long.valueOf("9223372036854771"); //biggest value + // TimeUtil.formatTime(methodBiggestValue.longValue()); + // it does not works correctly yet, see bug: 0001492 + } + + /** + * Tests formatTime(long) method + * using known values. + * They could be checked using Google Calculator + * http://www.google.com/intl/en/help/features.html#calculator + */ + public void testFormatTime_KnownValues() { + Long methodLong; + String[][] valAndExpected = { + {"604800000","1w"}, //one week + {"86400000","1d"}, //one day + {"3600000","1h"}, //one hour + {"60000","1m"}, //one minute + {"1000","1s"} //one second + }; + for(int i = 0; i < valAndExpected.length; i++) { + methodLong = Long.valueOf(valAndExpected[i][0]); + assertEquals(TimeUtil.formatTime(methodLong.longValue()),valAndExpected[i][1]); } + } + + /** + * Tests formatTime(long,int) method + * using a long value that generate every possible + * term kind. It tests if the maxTerms arguments + * works correctly + */ + public void testFormatTime_LongIntBoolean_maxTerms() { + String[] valAndExpected = { + "", //0 terms + "1w", //1 term + "1w1d", //2 terms + "1w1d1h", //3 terms + "1w1d1h1m", //4 terms + "1w1d1h1m1s", //5 terms + "1w1d1h1m1.001s" //6 terms + }; + for(int i = 0; i < valAndExpected.length; i++) + assertEquals(TimeUtil.formatTime(oneForTermLong,i,true),valAndExpected[i]); + } + + /** + * Tests formatTime(long,int) method + * using one millisecond time interval. + * It tests if the withSecondFractions argument + * works correctly + */ + public void testFormatTime_LongIntBoolean_milliseconds() { + long methodValue = 1; //1ms + assertEquals(TimeUtil.formatTime(methodValue,6,false),""); + assertEquals(TimeUtil.formatTime(methodValue,6,true),"0.001s"); + } + + /** + * Tests formatTime(long,int) method + * using a long value that generate every possible + * term kind. It tests if the maxTerms arguments + * works correctly + */ + public void testFormatTime_LongIntBoolean_tooManyTerms() { + try { + TimeUtil.formatTime(oneForTermLong,7); + fail("Expected IllegalArgumentException not thrown"); } + catch (IllegalArgumentException anException) { + assertNotNull(anException); } + } + +} From zothar at freenetproject.org Tue Jul 3 23:12:25 2007 From: zothar at freenetproject.org (zothar at freenetproject.org) Date: Tue, 3 Jul 2007 23:12:25 +0000 (UTC) Subject: [freenet-cvs] r13909 - trunk/freenet/src/freenet/support Message-ID: <20070703231225.B592F4791A9@emu.freenetproject.org> Author: zothar Date: 2007-07-03 23:12:25 +0000 (Tue, 03 Jul 2007) New Revision: 13909 Modified: trunk/freenet/src/freenet/support/TimeUtil.java Log: Don't assume we won't have more than int weeks, etc in TimeUtil; fixes Bug #1492 Modified: trunk/freenet/src/freenet/support/TimeUtil.java =================================================================== --- trunk/freenet/src/freenet/support/TimeUtil.java 2007-07-03 22:28:11 UTC (rev 13908) +++ trunk/freenet/src/freenet/support/TimeUtil.java 2007-07-03 23:12:25 UTC (rev 13909) @@ -57,7 +57,7 @@ return sb.toString(); } // - int weeks = (int)(l / ((long)7*24*60*60*1000)); + long weeks = (long)(l / ((long)7*24*60*60*1000)); if (weeks > 0) { sb.append(weeks).append('w'); termCount++; @@ -67,7 +67,7 @@ return sb.toString(); } // - int days = (int)(l / ((long)24*60*60*1000)); + long days = (long)(l / ((long)24*60*60*1000)); if (days > 0) { sb.append(days).append('d'); termCount++; @@ -77,7 +77,7 @@ return sb.toString(); } // - int hours = (int)(l / ((long)60*60*1000)); + long hours = (long)(l / ((long)60*60*1000)); if (hours > 0) { sb.append(hours).append('h'); termCount++; @@ -87,7 +87,7 @@ return sb.toString(); } // - int minutes = (int)(l / ((long)60*1000)); + long minutes = (long)(l / ((long)60*1000)); if (minutes > 0) { sb.append(minutes).append('m'); termCount++; @@ -105,7 +105,7 @@ //l = l - ((long)fractionalSeconds * (long)1000); } } else { - int seconds = (int)(l / (long)1000); + long seconds = (long)(l / (long)1000); if (seconds > 0) { sb.append(seconds).append('s'); termCount++; From sback at freenetproject.org Tue Jul 3 23:30:44 2007 From: sback at freenetproject.org (sback at freenetproject.org) Date: Tue, 3 Jul 2007 23:30:44 +0000 (UTC) Subject: [freenet-cvs] r13910 - trunk/freenet/test/freenet/support Message-ID: <20070703233044.A8BE447A202@emu.freenetproject.org> Author: sback Date: 2007-07-03 23:30:44 +0000 (Tue, 03 Jul 2007) New Revision: 13910 Modified: trunk/freenet/test/freenet/support/TimeUtilTest.java Log: All tests work correctly after Zothar's bugfix #1492 Modified: trunk/freenet/test/freenet/support/TimeUtilTest.java =================================================================== --- trunk/freenet/test/freenet/support/TimeUtilTest.java 2007-07-03 23:12:25 UTC (rev 13909) +++ trunk/freenet/test/freenet/support/TimeUtilTest.java 2007-07-03 23:30:44 UTC (rev 13910) @@ -11,8 +11,8 @@ * trying the biggest long value */ public void testFormatTime_LongIntBoolean_MaxValue() { - // TimeUtil.formatTime(Long.MAX_VALUE,6,true); - // it does not works correctly yet, see bug: 0001492 + String expectedForMaxLongValue = "15250284452w3d7h12m55.807s"; + assertEquals(TimeUtil.formatTime(Long.MAX_VALUE,6,true),expectedForMaxLongValue); } /** @@ -20,8 +20,8 @@ * trying the biggest long value */ public void testFormatTime_LongInt() { - // TimeUtil.formatTime(Long.MAX_VALUE,6); - // it does not works correctly yet, see bug: 0001492 + String expectedForMaxLongValue = "15250284452w3d7h12m55s"; + assertEquals(TimeUtil.formatTime(Long.MAX_VALUE,6),expectedForMaxLongValue); } /** @@ -29,9 +29,8 @@ * trying the biggest long value */ public void testFormatTime_Long() { - // Long methodBiggestValue = Long.valueOf("9223372036854771"); //biggest value - // TimeUtil.formatTime(methodBiggestValue.longValue()); - // it does not works correctly yet, see bug: 0001492 + String expectedForMaxLongValue = "15250284452w3d"; //it uses two terms by default + assertEquals(TimeUtil.formatTime(Long.MAX_VALUE),expectedForMaxLongValue); } /** From sback at freenetproject.org Tue Jul 3 23:50:38 2007 From: sback at freenetproject.org (sback at freenetproject.org) Date: Tue, 3 Jul 2007 23:50:38 +0000 (UTC) Subject: [freenet-cvs] r13911 - trunk/freenet/test/freenet/support Message-ID: <20070703235038.CBC154797BA@emu.freenetproject.org> Author: sback Date: 2007-07-03 23:50:38 +0000 (Tue, 03 Jul 2007) New Revision: 13911 Added: trunk/freenet/test/freenet/support/SizeUtilTest.java Log: UnitTest for SizeUtil class Added: trunk/freenet/test/freenet/support/SizeUtilTest.java =================================================================== --- trunk/freenet/test/freenet/support/SizeUtilTest.java (rev 0) +++ trunk/freenet/test/freenet/support/SizeUtilTest.java 2007-07-03 23:50:38 UTC (rev 13911) @@ -0,0 +1,47 @@ +package freenet.support; + +import junit.framework.TestCase; + +public class SizeUtilTest extends TestCase { + + String[][] valAndExpected = { + {"1","B"}, //one byte + {"1024","KiB"}, //one kilobyte + {"1048576","MiB"}, //one megabyte + {"1073741824","GiB"}, //one gigabyte + {"1099511627776","TiB"}, //one terabyte + //{"1125899906842624","1.0 PiB"}, //one petabyte + //{"1152921504606846976", "1.0 EiB"}, //one exabyte + //{"1180591620717411303424", "1.0 ZiB"}, //one zettabyte + //{"1208925819614629174706176","1.0 YiB"}, //one yottabyte + }; + + public void testFormatSizeLong() { + Long methodLong; + methodLong = Long.valueOf(valAndExpected[0][0]); + assertEquals(SizeUtil.formatSize(methodLong.longValue()),"1 "+valAndExpected[0][1]); + + for(int i = 1; i < valAndExpected.length; i++) { + methodLong = Long.valueOf(valAndExpected[i][0]); + System.out.println(SizeUtil.formatSize(methodLong.longValue())); + assertEquals(SizeUtil.formatSize(methodLong.longValue()),"1.0 "+valAndExpected[i][1]); } + } + + /** + * Tests if formatSize(long) method + * works correctly with intermediate values + * (i.e. 1/4,1/2,3/4) + */ + public void testFormatSizeLong_WithIntermediateValues() { + Long methodLong; + String[] actualValue = {"1.0","1.25","1.5","1.75"}; + + for(int i = 1; i < valAndExpected.length; i++) { + methodLong = Long.valueOf(valAndExpected[i][0]); + for(int j = 0; j < 4; j++) + assertEquals(SizeUtil.formatSize(methodLong.longValue()+(methodLong.longValue()*j/4)), + actualValue[j]+" "+valAndExpected[i][1]); + } + } + +} From sback at freenetproject.org Wed Jul 4 10:01:04 2007 From: sback at freenetproject.org (sback at freenetproject.org) Date: Wed, 4 Jul 2007 10:01:04 +0000 (UTC) Subject: [freenet-cvs] r13912 - trunk/freenet/test/freenet/support Message-ID: <20070704100104.4A41447AA4D@emu.freenetproject.org> Author: sback Date: 2007-07-04 10:01:03 +0000 (Wed, 04 Jul 2007) New Revision: 13912 Modified: trunk/freenet/test/freenet/support/SizeUtilTest.java Log: Removed a debug print Modified: trunk/freenet/test/freenet/support/SizeUtilTest.java =================================================================== --- trunk/freenet/test/freenet/support/SizeUtilTest.java 2007-07-03 23:50:38 UTC (rev 13911) +++ trunk/freenet/test/freenet/support/SizeUtilTest.java 2007-07-04 10:01:03 UTC (rev 13912) @@ -23,7 +23,6 @@ for(int i = 1; i < valAndExpected.length; i++) { methodLong = Long.valueOf(valAndExpected[i][0]); - System.out.println(SizeUtil.formatSize(methodLong.longValue())); assertEquals(SizeUtil.formatSize(methodLong.longValue()),"1.0 "+valAndExpected[i][1]); } } From sback at freenetproject.org Wed Jul 4 10:47:02 2007 From: sback at freenetproject.org (sback at freenetproject.org) Date: Wed, 4 Jul 2007 10:47:02 +0000 (UTC) Subject: [freenet-cvs] r13913 - trunk/freenet/test/freenet/support Message-ID: <20070704104702.E10F747996B@emu.freenetproject.org> Author: sback Date: 2007-07-04 10:47:02 +0000 (Wed, 04 Jul 2007) New Revision: 13913 Modified: trunk/freenet/test/freenet/support/SizeUtilTest.java trunk/freenet/test/freenet/support/TimeUtilTest.java Log: GPL disclaimer added Modified: trunk/freenet/test/freenet/support/SizeUtilTest.java =================================================================== --- trunk/freenet/test/freenet/support/SizeUtilTest.java 2007-07-04 10:01:03 UTC (rev 13912) +++ trunk/freenet/test/freenet/support/SizeUtilTest.java 2007-07-04 10:47:02 UTC (rev 13913) @@ -1,3 +1,18 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ package freenet.support; import junit.framework.TestCase; @@ -2,2 +17,7 @@ +/** + * Test case for {@link freenet.support.SizeUtil} class. + * + * @author Alberto Bacchelli <sback at freenetproject.org> + */ public class SizeUtilTest extends TestCase { Modified: trunk/freenet/test/freenet/support/TimeUtilTest.java =================================================================== --- trunk/freenet/test/freenet/support/TimeUtilTest.java 2007-07-04 10:01:03 UTC (rev 13912) +++ trunk/freenet/test/freenet/support/TimeUtilTest.java 2007-07-04 10:47:02 UTC (rev 13913) @@ -1,3 +1,18 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ package freenet.support; import junit.framework.TestCase; @@ -2,2 +17,7 @@ +/** + * Test case for {@link freenet.support.TimeUtil} class. + * + * @author Alberto Bacchelli <sback at freenetproject.org> + */ public class TimeUtilTest extends TestCase { From nextgens at freenetproject.org Wed Jul 4 11:56:22 2007 From: nextgens at freenetproject.org (nextgens at freenetproject.org) Date: Wed, 4 Jul 2007 11:56:22 +0000 (UTC) Subject: [freenet-cvs] r13914 - trunk/freenet/src/freenet/crypt Message-ID: <20070704115622.3B14547A23C@emu.freenetproject.org> Author: nextgens Date: 2007-07-04 11:56:22 +0000 (Wed, 04 Jul 2007) New Revision: 13914 Modified: trunk/freenet/src/freenet/crypt/DiffieHellman.java trunk/freenet/src/freenet/crypt/KEProtocol.java Log: fix a typo: Diffie-Helman => Diffie-Hellman Modified: trunk/freenet/src/freenet/crypt/DiffieHellman.java =================================================================== --- trunk/freenet/src/freenet/crypt/DiffieHellman.java 2007-07-04 10:47:02 UTC (rev 13913) +++ trunk/freenet/src/freenet/crypt/DiffieHellman.java 2007-07-04 11:56:22 UTC (rev 13914) @@ -44,7 +44,7 @@ private static class PrecalcBufferFill extends Thread { public PrecalcBufferFill() { - setName("Diffie-Helman-Precalc"); + setName("Diffie-Hellman-Precalc"); setDaemon(true); } Modified: trunk/freenet/src/freenet/crypt/KEProtocol.java =================================================================== --- trunk/freenet/src/freenet/crypt/KEProtocol.java 2007-07-04 10:47:02 UTC (rev 13913) +++ trunk/freenet/src/freenet/crypt/KEProtocol.java 2007-07-04 11:56:22 UTC (rev 13914) @@ -9,7 +9,7 @@ /** * Defines the interface that must be implemented by key-exchange protocols - * such as RSA and Diffie-Helman + * such as RSA and Diffie-Hellman */ public abstract class KEProtocol { protected RandomSource randomSource; From kryptos at freenetproject.org Wed Jul 4 14:20:26 2007 From: kryptos at freenetproject.org (kryptos at freenetproject.org) Date: Wed, 4 Jul 2007 14:20:26 +0000 (UTC) Subject: [freenet-cvs] r13915 - in branches/freenet-jfk: devnotes src/freenet/node Message-ID: <20070704142026.36C6F4798E4@emu.freenetproject.org> Author: kryptos Date: 2007-07-04 14:20:25 +0000 (Wed, 04 Jul 2007) New Revision: 13915 Added: branches/freenet-jfk/devnotes/jfkNotes.txt Modified: branches/freenet-jfk/src/freenet/node/FNPPacketMangler.java Log: JFK description as will be implemented Added: branches/freenet-jfk/devnotes/jfkNotes.txt =================================================================== --- branches/freenet-jfk/devnotes/jfkNotes.txt (rev 0) +++ branches/freenet-jfk/devnotes/jfkNotes.txt 2007-07-04 14:20:25 UTC (rev 13915) @@ -0,0 +1,20 @@ +Initiator-Responder: +This is a straightforward DiffieHellman exponential. +The Initiator Nonce serves two purposes;it allows the initiator to use the same +exponentials during different sessions while ensuring that the resulting session key will be different,can be used to differentiate between parallel sessions + +Responder-Initiator: +Responder replies with a signed copy of his own exponential, a random nonce and an authenticator calculated from a transient hash key private to the responder. +We slightly deviate JFK here;we do not send any public key information +as specified in the JFK docs + +Initiator-Responder: +Initiator echoes the data sent by the responder including the authenticator. This helps +the responder verify the authenticity of the returned data. Rejection messages do not +concern us because grpinfo which is sent in Message2 indicates which groups and algorithms +are acceptable avoiding the need for explicit message rejection. + +Responder-Initiator: +Encrypted message of the signature +on both nonces, both exponentials using the same keys as in the previous message + Modified: branches/freenet-jfk/src/freenet/node/FNPPacketMangler.java =================================================================== --- branches/freenet-jfk/src/freenet/node/FNPPacketMangler.java 2007-07-04 11:56:22 UTC (rev 13914) +++ branches/freenet-jfk/src/freenet/node/FNPPacketMangler.java 2007-07-04 14:20:25 UTC (rev 13915) @@ -324,12 +324,17 @@ * Initiator- This is a straightforward DiffieHellman exponential. The Init * iator Nonce serves two purposes;it allows the initiator to use the same * exponentials during different sessions while ensuring that the resulting * session key will be different,can be used to differentiate between * parallel sessions */ + DiffieHellmanContext ctx = + processDHZeroOrOne(0, payload, pn); + if(ctx == null) return; + + } else if(packetType==1){ /* * Responder replies with a signed copy of his own exponential, a random * nonce and an authenticator calculated from a transient hash key private - * to the responder + * to the responder. We slightly deviate JFK here;we do not send any public * key information as specified in the JFK docs */ } else if(packetType==2){ From toad at freenetproject.org Wed Jul 4 15:25:24 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Wed, 4 Jul 2007 15:25:24 +0000 (UTC) Subject: [freenet-cvs] r13916 - trunk/freenet/src/freenet/support Message-ID: <20070704152524.83FEF47A040@emu.freenetproject.org> Author: toad Date: 2007-07-04 15:25:24 +0000 (Wed, 04 Jul 2007) New Revision: 13916 Modified: trunk/freenet/src/freenet/support/SimpleFieldSet.java Log: Fix NPE Modified: trunk/freenet/src/freenet/support/SimpleFieldSet.java =================================================================== --- trunk/freenet/src/freenet/support/SimpleFieldSet.java 2007-07-04 14:20:25 UTC (rev 13915) +++ trunk/freenet/src/freenet/support/SimpleFieldSet.java 2007-07-04 15:25:24 UTC (rev 13916) @@ -788,6 +788,7 @@ public int[] getIntArray(String key) { String[] strings = getAll(key); + if(strings == null) return null; int[] ret = new int[strings.length]; for(int i=0;i Author: nextgens Date: 2007-07-04 17:13:33 +0000 (Wed, 04 Jul 2007) New Revision: 13917 Modified: trunk/freenet/src/freenet/l10n/freenet.l10n.fr.properties Log: l10n: fix a typo in the french translation before the release ... thanks to toom for noticing it Modified: trunk/freenet/src/freenet/l10n/freenet.l10n.fr.properties =================================================================== --- trunk/freenet/src/freenet/l10n/freenet.l10n.fr.properties 2007-07-04 15:25:24 UTC (rev 13916) +++ trunk/freenet/src/freenet/l10n/freenet.l10n.fr.properties 2007-07-04 17:13:33 UTC (rev 13917) @@ -97,7 +97,7 @@ DarknetConnectionsToadlet.busyShort=Occup? DarknetConnectionsToadlet.cantFetchNoderefURL=Impossible de r?cup?rer une r?f?rence ? partir de ${url}. Essayez ? nouveau. DarknetConnectionsToadlet.cantParseTryAgain=Ce texte n'est pas une r?f?rence : (${error}). Essayez ? nouveau. -DarknetConnectionsToadlet.cantParseWrongEnding=Impossible d'analyser cette r?f?rence : elle devrait se terminer par une lige contenant "End", mais elle se termine par : ${end} +DarknetConnectionsToadlet.cantParseWrongEnding=Impossible d'analyser cette r?f?rence : elle devrait se terminer par une ligne contenant "End", mais elle se termine par : ${end} DarknetConnectionsToadlet.confirmRemoveNode=Etes-vous s?r de vouloir supprimer "+peerNodes[i].getName()+" ? Ce n'est pas recommand? avant une semaine d'inactivit?, cette inactivit? peut ?tre temporaire, et beaucoup d'utilisateurs ne peuvent pas laisser leur noeud tourner 24h/24. DarknetConnectionsToadlet.confirmRemoveNodeTitle=Veuillez confirmer DarknetConnectionsToadlet.confirmRemoveNodeWarningTitle=Suppression de noeud From toad at freenetproject.org Wed Jul 4 17:27:47 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Wed, 4 Jul 2007 17:27:47 +0000 (UTC) Subject: [freenet-cvs] r13918 - trunk/freenet/src/freenet/node Message-ID: <20070704172747.DA0244798DF@emu.freenetproject.org> Author: toad Date: 2007-07-04 17:27:47 +0000 (Wed, 04 Jul 2007) New Revision: 13918 Modified: trunk/freenet/src/freenet/node/NodeCrypto.java trunk/freenet/src/freenet/node/PeerNode.java Log: Don't include identity, it's invariant. Don't parse it either. Modified: trunk/freenet/src/freenet/node/NodeCrypto.java =================================================================== --- trunk/freenet/src/freenet/node/NodeCrypto.java 2007-07-04 17:13:33 UTC (rev 13917) +++ trunk/freenet/src/freenet/node/NodeCrypto.java 2007-07-04 17:27:47 UTC (rev 13918) @@ -295,9 +295,9 @@ SimpleFieldSet fs = new SimpleFieldSet(true); int[] negTypes = packetMangler.supportedNegTypes(); fs.put("auth.negTypes", negTypes); - fs.putSingle("identity", Base64.encode(myIdentity)); // FIXME !forSetup after 11104 is mandatory if(!forSetup) { // These are invariant. They cannot change on connection setup. They can safely be excluded. + fs.putSingle("identity", Base64.encode(myIdentity)); fs.put("dsaGroup", cryptoGroup.asFieldSet()); fs.put("dsaPubKey", pubKey.asFieldSet()); } Modified: trunk/freenet/src/freenet/node/PeerNode.java =================================================================== --- trunk/freenet/src/freenet/node/PeerNode.java 2007-07-04 17:13:33 UTC (rev 13917) +++ trunk/freenet/src/freenet/node/PeerNode.java 2007-07-04 17:27:47 UTC (rev 13918) @@ -1670,21 +1670,6 @@ * @throws FSParseException */ protected synchronized boolean innerProcessNewNoderef(SimpleFieldSet fs, boolean forARK) throws FSParseException { boolean changedAnything = false; - String identityString = fs.get("identity"); - if(identityString != null) { - // REDFLAG this is optional now, because it is invariant. - // But if it IS there, check it. - try { - byte[] newIdentity = Base64.decode(identityString); - if(!Arrays.equals(newIdentity, identity)) - throw new FSParseException("Identity changed!!"); - - } catch (NumberFormatException e) { - throw new FSParseException(e); - } catch (IllegalBase64Exception e) { - throw new FSParseException(e); - } - } if(node.testnetEnabled != Fields.stringToBool(fs.get("testnet"), true)) { String err = "Preventing connection to node "+detectedPeer+" - peer.testnet="+!node.testnetEnabled+'(' +fs.get("testnet")+") but node.testnet="+node.testnetEnabled; Logger.error(this, err); From toad at freenetproject.org Wed Jul 4 17:42:18 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Wed, 4 Jul 2007 17:42:18 +0000 (UTC) Subject: [freenet-cvs] r13919 - trunk/freenet/src/freenet/node Message-ID: <20070704174218.57D664790AC@emu.freenetproject.org> Author: toad Date: 2007-07-04 17:42:18 +0000 (Wed, 04 Jul 2007) New Revision: 13919 Modified: trunk/freenet/src/freenet/node/OpennetManager.java trunk/freenet/src/freenet/node/OpennetPeerNode.java trunk/freenet/src/freenet/node/PeerManager.java Log: Remove opennet peers when opennet is disabled, don't route to opennet peers if opennet is disabled Modified: trunk/freenet/src/freenet/node/OpennetManager.java =================================================================== --- trunk/freenet/src/freenet/node/OpennetManager.java 2007-07-04 17:27:47 UTC (rev 13918) +++ trunk/freenet/src/freenet/node/OpennetManager.java 2007-07-04 17:42:18 UTC (rev 13919) @@ -38,6 +38,7 @@ } } node.peers.tryReadPeers(new File(node.nodeDir, "openpeers-"+crypto.portNumber).toString(), crypto, true); + } private void readFile(String filename) throws IOException { @@ -80,6 +81,7 @@ */ public void stop() { crypto.stop(); + node.peers.removeOpennetPeers(); } } Modified: trunk/freenet/src/freenet/node/OpennetPeerNode.java =================================================================== --- trunk/freenet/src/freenet/node/OpennetPeerNode.java 2007-07-04 17:27:47 UTC (rev 13918) +++ trunk/freenet/src/freenet/node/OpennetPeerNode.java 2007-07-04 17:42:18 UTC (rev 13919) @@ -14,4 +14,8 @@ return new OpennetPeerNodeStatus(this); } + public boolean isRoutingCompatible() { + if(node.isOpennetEnabled()) return false; + return super.isRoutingCompatible(); + } } Modified: trunk/freenet/src/freenet/node/PeerManager.java =================================================================== --- trunk/freenet/src/freenet/node/PeerManager.java 2007-07-04 17:27:47 UTC (rev 13918) +++ trunk/freenet/src/freenet/node/PeerManager.java 2007-07-04 17:42:18 UTC (rev 13919) @@ -1211,4 +1211,20 @@ } return false; } + + public void removeOpennetPeers() { + synchronized(this) { + Vector keep = new Vector(); + Vector conn = new Vector(); + for(int i=0;i Author: toad Date: 2007-07-04 17:47:27 +0000 (Wed, 04 Jul 2007) New Revision: 13920 Modified: trunk/freenet/src/freenet/node/OpennetManager.java Log: Write opennet crypto identity on startup (we don't need to write it later as there's nothing volatile in it). Modified: trunk/freenet/src/freenet/node/OpennetManager.java =================================================================== --- trunk/freenet/src/freenet/node/OpennetManager.java 2007-07-04 17:42:18 UTC (rev 13919) +++ trunk/freenet/src/freenet/node/OpennetManager.java 2007-07-04 17:47:27 UTC (rev 13920) @@ -1,13 +1,17 @@ package freenet.node; import java.io.BufferedReader; +import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; +import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; +import java.io.OutputStreamWriter; import freenet.io.comm.Peer; import freenet.io.comm.PeerParseException; +import freenet.support.Logger; import freenet.support.SimpleFieldSet; /** @@ -27,21 +31,53 @@ crypto = new NodeCrypto(1 /* 0 is enabled */, node, true, opennetConfig); + File nodeFile = new File(node.nodeDir, "opennet-"+crypto.portNumber); + File backupNodeFile = new File("node-"+crypto.portNumber+".bak"); + // Keep opennet crypto details in a separate file try { - readFile(new File(node.nodeDir, "opennet-"+crypto.portNumber).getPath()); + readFile(nodeFile); } catch (IOException e) { try { - readFile(new File("node-"+crypto.portNumber+".bak").getPath()); + readFile(backupNodeFile); } catch (IOException e1) { crypto.initCrypto(); } } node.peers.tryReadPeers(new File(node.nodeDir, "openpeers-"+crypto.portNumber).toString(), crypto, true); + writeFile(backupNodeFile, nodeFile); + } + + private void writeFile(File orig, File backup) { + SimpleFieldSet fs = crypto.exportPrivateFieldSet(); + if(orig.exists()) backup.delete(); + + FileOutputStream fos = null; + try { + fos = new FileOutputStream(backup); + OutputStreamWriter osr = new OutputStreamWriter(fos, "UTF-8"); + BufferedWriter bw = new BufferedWriter(osr); + fs.writeTo(bw); + bw.close(); + if(!backup.renameTo(orig)) { + orig.delete(); + if(!backup.renameTo(orig)) { + Logger.error(this, "Could not rename new node file "+backup+" to "+orig); + } + } + } catch (IOException e) { + if(fos != null) { + try { + fos.close(); + } catch (IOException e1) { + Logger.error(this, "Cannot close "+backup+": "+e1, e1); + } + } + } } - private void readFile(String filename) throws IOException { + private void readFile(File filename) throws IOException { // REDFLAG: Any way to share this code with Node and NodePeer? FileInputStream fis = new FileInputStream(filename); InputStreamReader isr = new InputStreamReader(fis, "UTF-8"); From toad at freenetproject.org Wed Jul 4 17:52:58 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Wed, 4 Jul 2007 17:52:58 +0000 (UTC) Subject: [freenet-cvs] r13921 - trunk/freenet/src/freenet/node Message-ID: <20070704175258.DB84847990D@emu.freenetproject.org> Author: toad Date: 2007-07-04 17:52:58 +0000 (Wed, 04 Jul 2007) New Revision: 13921 Modified: trunk/freenet/src/freenet/node/OpennetManager.java Log: Doh Modified: trunk/freenet/src/freenet/node/OpennetManager.java =================================================================== --- trunk/freenet/src/freenet/node/OpennetManager.java 2007-07-04 17:47:27 UTC (rev 13920) +++ trunk/freenet/src/freenet/node/OpennetManager.java 2007-07-04 17:52:58 UTC (rev 13921) @@ -32,7 +32,7 @@ new NodeCrypto(1 /* 0 is enabled */, node, true, opennetConfig); File nodeFile = new File(node.nodeDir, "opennet-"+crypto.portNumber); - File backupNodeFile = new File("node-"+crypto.portNumber+".bak"); + File backupNodeFile = new File("opennet-"+crypto.portNumber+".bak"); // Keep opennet crypto details in a separate file try { @@ -45,7 +45,7 @@ } } node.peers.tryReadPeers(new File(node.nodeDir, "openpeers-"+crypto.portNumber).toString(), crypto, true); - writeFile(backupNodeFile, nodeFile); + writeFile(nodeFile, backupNodeFile); } private void writeFile(File orig, File backup) { From toad at freenetproject.org Wed Jul 4 17:58:23 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Wed, 4 Jul 2007 17:58:23 +0000 (UTC) Subject: [freenet-cvs] r13922 - trunk/freenet/src/freenet/node Message-ID: <20070704175823.B627F47A0CC@emu.freenetproject.org> Author: toad Date: 2007-07-04 17:58:23 +0000 (Wed, 04 Jul 2007) New Revision: 13922 Modified: trunk/freenet/src/freenet/node/NodeIPPortDetector.java Log: Register on IP detector. Should re-enable ARKs. Modified: trunk/freenet/src/freenet/node/NodeIPPortDetector.java =================================================================== --- trunk/freenet/src/freenet/node/NodeIPPortDetector.java 2007-07-04 17:52:58 UTC (rev 13921) +++ trunk/freenet/src/freenet/node/NodeIPPortDetector.java 2007-07-04 17:58:23 UTC (rev 13922) @@ -35,6 +35,7 @@ this.ipDetector = ipDetector; this.crypto = crypto; arkPutter = new NodeARKInserter(node, crypto, this); + ipDetector.addPortDetector(this); } /** From toad at freenetproject.org Wed Jul 4 18:48:37 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Wed, 4 Jul 2007 18:48:37 +0000 (UTC) Subject: [freenet-cvs] r13923 - trunk/freenet/src/freenet/node Message-ID: <20070704184837.E7AC3479829@emu.freenetproject.org> Author: toad Date: 2007-07-04 18:48:37 +0000 (Wed, 04 Jul 2007) New Revision: 13923 Modified: trunk/freenet/src/freenet/node/OpennetPeerNode.java Log: Doh Modified: trunk/freenet/src/freenet/node/OpennetPeerNode.java =================================================================== --- trunk/freenet/src/freenet/node/OpennetPeerNode.java 2007-07-04 17:58:23 UTC (rev 13922) +++ trunk/freenet/src/freenet/node/OpennetPeerNode.java 2007-07-04 18:48:37 UTC (rev 13923) @@ -15,7 +15,7 @@ } public boolean isRoutingCompatible() { - if(node.isOpennetEnabled()) return false; + if(!node.isOpennetEnabled()) return false; return super.isRoutingCompatible(); } } From nextgens at freenetproject.org Wed Jul 4 18:53:48 2007 From: nextgens at freenetproject.org (nextgens at freenetproject.org) Date: Wed, 4 Jul 2007 18:53:48 +0000 (UTC) Subject: [freenet-cvs] r13924 - trunk/freenet/src/freenet/node Message-ID: <20070704185348.335934798E0@emu.freenetproject.org> Author: nextgens Date: 2007-07-04 18:53:48 +0000 (Wed, 04 Jul 2007) New Revision: 13924 Modified: trunk/freenet/src/freenet/node/Node.java Log: Prevent empty node names from beeing used Modified: trunk/freenet/src/freenet/node/Node.java =================================================================== --- trunk/freenet/src/freenet/node/Node.java 2007-07-04 18:48:37 UTC (rev 13923) +++ trunk/freenet/src/freenet/node/Node.java 2007-07-04 18:53:48 UTC (rev 13924) @@ -128,6 +128,8 @@ } public void set(String val) throws InvalidConfigValueException { + if("".equals(val)) + val = "~none~"; myName = val; if(myName.startsWith("Node id|")|| myName.equals("MyFirstFreenetNode")){ clientCore.alerts.register(nodeNameUserAlert); From toad at freenetproject.org Wed Jul 4 19:00:34 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Wed, 4 Jul 2007 19:00:34 +0000 (UTC) Subject: [freenet-cvs] r13925 - trunk/freenet/src/freenet/node Message-ID: <20070704190034.13495479FBC@emu.freenetproject.org> Author: toad Date: 2007-07-04 19:00:33 +0000 (Wed, 04 Jul 2007) New Revision: 13925 Modified: trunk/freenet/src/freenet/node/NodeCrypto.java Log: Hmmm... maybe fix opennet connection Modified: trunk/freenet/src/freenet/node/NodeCrypto.java =================================================================== --- trunk/freenet/src/freenet/node/NodeCrypto.java 2007-07-04 18:53:48 UTC (rev 13924) +++ trunk/freenet/src/freenet/node/NodeCrypto.java 2007-07-04 19:00:33 UTC (rev 13925) @@ -394,10 +394,10 @@ // Disallow multiple connections to the same address if(node.peers.anyConnectedPeerHasAddress(addr, pn) && !detector.includes(addr)) { Logger.normal(this, "Not sending handshake packets to "+addr+" for "+pn+" : Same IP address as another node"); - return true; + return false; } } - return false; + return true; } } From nextgens at freenetproject.org Wed Jul 4 19:13:10 2007 From: nextgens at freenetproject.org (nextgens at freenetproject.org) Date: Wed, 4 Jul 2007 19:13:10 +0000 (UTC) Subject: [freenet-cvs] r13926 - trunk/freenet/src/freenet/clients/http Message-ID: <20070704191310.BDBA94795FD@emu.freenetproject.org> Author: nextgens Date: 2007-07-04 19:13:10 +0000 (Wed, 04 Jul 2007) New Revision: 13926 Modified: trunk/freenet/src/freenet/clients/http/ConnectionsToadlet.java Log: Fix a classcastexception Modified: trunk/freenet/src/freenet/clients/http/ConnectionsToadlet.java =================================================================== --- trunk/freenet/src/freenet/clients/http/ConnectionsToadlet.java 2007-07-04 19:00:33 UTC (rev 13925) +++ trunk/freenet/src/freenet/clients/http/ConnectionsToadlet.java 2007-07-04 19:13:10 UTC (rev 13926) @@ -16,7 +16,6 @@ import freenet.client.HighLevelSimpleClient; import freenet.io.xfer.PacketThrottle; import freenet.l10n.L10n; -import freenet.node.DarknetPeerNodeStatus; import freenet.node.FSParseException; import freenet.node.Node; import freenet.node.NodeClientCore; @@ -46,8 +45,8 @@ public int compare(Object first, Object second) { int result = 0; boolean isSet = true; - PeerNodeStatus firstNode = (DarknetPeerNodeStatus) first; - PeerNodeStatus secondNode = (DarknetPeerNodeStatus) second; + PeerNodeStatus firstNode = (PeerNodeStatus) first; + PeerNodeStatus secondNode = (PeerNodeStatus) second; if(sortBy != null){ result = customCompare(firstNode, secondNode, sortBy); From sback at freenetproject.org Wed Jul 4 19:23:10 2007 From: sback at freenetproject.org (sback at freenetproject.org) Date: Wed, 4 Jul 2007 19:23:10 +0000 (UTC) Subject: [freenet-cvs] r13927 - trunk/freenet/test/freenet/support Message-ID: <20070704192310.9D67E388002@emu.freenetproject.org> Author: sback Date: 2007-07-04 19:23:10 +0000 (Wed, 04 Jul 2007) New Revision: 13927 Added: trunk/freenet/test/freenet/support/URLEncoderDecoderTest.java Log: Introducing a UnitTest class for support.URLDecoder and support.URLEncoder classes Added: trunk/freenet/test/freenet/support/URLEncoderDecoderTest.java =================================================================== --- trunk/freenet/test/freenet/support/URLEncoderDecoderTest.java (rev 0) +++ trunk/freenet/test/freenet/support/URLEncoderDecoderTest.java 2007-07-04 19:23:10 UTC (rev 13927) @@ -0,0 +1,51 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package freenet.support; + +import junit.framework.TestCase; + +/** + * Test case for {@link freenet.support.URLEncoder} and + * {@link freenet.support.URLDecoder} classes. + * + * @author Alberto Bacchelli <sback at freenetproject.org> + */ +public class URLEncoderDecoderTest extends TestCase { + + /** + * Tests if URLEncode.encode(String) and + * URLDecode.decode(String,boolean) methods + * work correctly together, both with safe + * characters and not safe. + */ + public void testEncodeDecodeString() { + String[][] toEncode_encoded = { + {"*-_./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",""}, //safe chars + {"!@#$%^&()+={}[]:;\"'<>,?~`\n",""} //not safe chars + }; + + for (int i = 0; i < toEncode_encoded.length; i++) //encoding + toEncode_encoded[i][1] = URLEncoder.encode(toEncode_encoded[i][0]); + + try { + for (int i = 0; i < toEncode_encoded.length; i++) //decoding + assertEquals(URLDecoder.decode(toEncode_encoded[i][1],false),toEncode_encoded[i][0]); + } catch (URLEncodedFormatException anException) { + fail("Not expected exception thrown : " + anException.getMessage()); } + + } + +} From zothar at freenetproject.org Wed Jul 4 19:27:42 2007 From: zothar at freenetproject.org (zothar at freenetproject.org) Date: Wed, 4 Jul 2007 19:27:42 +0000 (UTC) Subject: [freenet-cvs] r13928 - trunk/freenet/src/freenet/node Message-ID: <20070704192742.83E77479931@emu.freenetproject.org> Author: zothar Date: 2007-07-04 19:27:42 +0000 (Wed, 04 Jul 2007) New Revision: 13928 Modified: trunk/freenet/src/freenet/node/PeerManager.java Log: Fix read peers from file counts Modified: trunk/freenet/src/freenet/node/PeerManager.java =================================================================== --- trunk/freenet/src/freenet/node/PeerManager.java 2007-07-04 19:23:10 UTC (rev 13927) +++ trunk/freenet/src/freenet/node/PeerManager.java 2007-07-04 19:27:42 UTC (rev 13928) @@ -120,7 +120,12 @@ // Try to read the node list from disk if(peersFile.exists()) { if(readPeers(peersFile, mangler, crypto)) { - String msg = "Read "+myPeers.length+" peers from "+peersFile; + String msg; + if(isOpennet) { + msg = "Read "+getOpennetPeers().length+" peers from "+peersFile; + } else { + msg = "Read "+getDarknetPeers().length+" peers from "+peersFile; + } Logger.normal(this, msg); System.out.println(msg); return; @@ -129,7 +134,12 @@ // Try the backup if(backupFile.exists()) { if(readPeers(backupFile, mangler, crypto)) { - String msg = "Read "+myPeers.length+" peers from "+backupFile; + String msg; + if(isOpennet) { + msg = "Read "+getOpennetPeers().length+" peers from "+backupFile; + } else { + msg = "Read "+getDarknetPeers().length+" peers from "+backupFile; + } Logger.normal(this, msg); System.out.println(msg); } else { From zothar at freenetproject.org Wed Jul 4 20:48:21 2007 From: zothar at freenetproject.org (zothar at freenetproject.org) Date: Wed, 4 Jul 2007 20:48:21 +0000 (UTC) Subject: [freenet-cvs] r13929 - trunk/freenet/src/freenet/node/fcp Message-ID: <20070704204821.D6984479FBC@emu.freenetproject.org> Author: zothar Date: 2007-07-04 20:48:21 +0000 (Wed, 04 Jul 2007) New Revision: 13929 Modified: trunk/freenet/src/freenet/node/fcp/NodeData.java Log: Handle the boolean cases correctly Modified: trunk/freenet/src/freenet/node/fcp/NodeData.java =================================================================== --- trunk/freenet/src/freenet/node/fcp/NodeData.java 2007-07-04 19:27:42 UTC (rev 13928) +++ trunk/freenet/src/freenet/node/fcp/NodeData.java 2007-07-04 20:48:21 UTC (rev 13929) @@ -22,9 +22,9 @@ public SimpleFieldSet getFieldSet() { SimpleFieldSet fs; if(withPrivate) { + fs = node.exportDarknetPrivateFieldSet(); + } else { fs = node.exportDarknetPublicFieldSet(); - } else { - fs = node.exportDarknetPrivateFieldSet(); } if(withVolatile) { SimpleFieldSet vol = node.exportVolatileFieldSet(); From toad at freenetproject.org Wed Jul 4 20:53:46 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Wed, 4 Jul 2007 20:53:46 +0000 (UTC) Subject: [freenet-cvs] r13930 - trunk/freenet/src/freenet/node Message-ID: <20070704205346.7636647A079@emu.freenetproject.org> Author: toad Date: 2007-07-04 20:53:46 +0000 (Wed, 04 Jul 2007) New Revision: 13930 Modified: trunk/freenet/src/freenet/node/NodeIPDetector.java trunk/freenet/src/freenet/node/NodeIPPortDetector.java Log: comments Modified: trunk/freenet/src/freenet/node/NodeIPDetector.java =================================================================== --- trunk/freenet/src/freenet/node/NodeIPDetector.java 2007-07-04 20:48:21 UTC (rev 13929) +++ trunk/freenet/src/freenet/node/NodeIPDetector.java 2007-07-04 20:53:46 UTC (rev 13930) @@ -80,8 +80,7 @@ * What is my IP address? Use all globally available information (everything which isn't * specific to a given port i.e. opennet or darknet) to determine our current IP addresses. * Will include more than one IP in many cases when we are not strictly multi-homed. For - * example, if we have a DNS name set, we will usually return an IP as well; if we are - * behind a NAT we may return both a rewritten port number and the original; etc. + * example, if we have a DNS name set, we will usually return an IP as well. * * Will warn the user with a UserAlert if we don't have sufficient information. */ Modified: trunk/freenet/src/freenet/node/NodeIPPortDetector.java =================================================================== --- trunk/freenet/src/freenet/node/NodeIPPortDetector.java 2007-07-04 20:48:21 UTC (rev 13929) +++ trunk/freenet/src/freenet/node/NodeIPPortDetector.java 2007-07-04 20:53:46 UTC (rev 13930) @@ -56,6 +56,12 @@ return addresses; } + /** + * Get our Peer's. This is a list of IP:port's at which we might be contactable. Some of them + * will have the same port as the listenPort, but if we are behind a NAT which rewrites our + * port number, some of them may not. (If we're behind a symmetric NAT which rewrites it + * differently for each connection, we're stuffed, and we tell the user). + */ Peer[] detectPrimaryPeers() { Vector addresses = new Vector(); FreenetInetAddress[] addrs = detectPrimaryIPAddress(); From toad at freenetproject.org Wed Jul 4 21:02:18 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Wed, 4 Jul 2007 21:02:18 +0000 (UTC) Subject: [freenet-cvs] r13931 - trunk/freenet/src/freenet/node Message-ID: <20070704210218.B39FC47A11C@emu.freenetproject.org> Author: toad Date: 2007-07-04 21:02:18 +0000 (Wed, 04 Jul 2007) New Revision: 13931 Modified: trunk/freenet/src/freenet/node/NodeIPDetector.java Log: delete confusing comment Modified: trunk/freenet/src/freenet/node/NodeIPDetector.java =================================================================== --- trunk/freenet/src/freenet/node/NodeIPDetector.java 2007-07-04 20:53:46 UTC (rev 13930) +++ trunk/freenet/src/freenet/node/NodeIPDetector.java 2007-07-04 21:02:18 UTC (rev 13931) @@ -159,7 +159,6 @@ if(p == null || p.isNull()) continue; FreenetInetAddress addr = p.getFreenetAddress(); if(addr == null) continue; - // DNSRequester doesn't deal with our own node if(!IPUtil.isValidAddress(addr.getAddress(false), false)) continue; Logger.normal(this, "Peer "+peerList[i].getPeer()+" thinks we are "+addr); if(countsByPeer.containsKey(addr)) { From toad at freenetproject.org Wed Jul 4 21:07:06 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Wed, 4 Jul 2007 21:07:06 +0000 (UTC) Subject: [freenet-cvs] r13932 - trunk/freenet/src/freenet/node Message-ID: <20070704210706.DB7D73882C4@emu.freenetproject.org> Author: toad Date: 2007-07-04 21:07:06 +0000 (Wed, 04 Jul 2007) New Revision: 13932 Modified: trunk/freenet/src/freenet/node/NodeIPPortDetector.java Log: comment Modified: trunk/freenet/src/freenet/node/NodeIPPortDetector.java =================================================================== --- trunk/freenet/src/freenet/node/NodeIPPortDetector.java 2007-07-04 21:02:18 UTC (rev 13931) +++ trunk/freenet/src/freenet/node/NodeIPPortDetector.java 2007-07-04 21:07:06 UTC (rev 13932) @@ -23,7 +23,7 @@ final Node node; /** The NodeIPDetector which determines the node's IP address but not its port number */ final NodeIPDetector ipDetector; - /** The NodeCrypto with the node's port number */ + /** The NodeCrypto with the node's port number and list of peers */ final NodeCrypto crypto; /** ARK inserter. */ private final NodeARKInserter arkPutter; From nextgens at freenetproject.org Wed Jul 4 22:25:01 2007 From: nextgens at freenetproject.org (nextgens at freenetproject.org) Date: Wed, 4 Jul 2007 22:25:01 +0000 (UTC) Subject: [freenet-cvs] r13933 - trunk/freenet/test/freenet/support Message-ID: <20070704222501.39CC9479906@emu.freenetproject.org> Author: nextgens Date: 2007-07-04 22:25:01 +0000 (Wed, 04 Jul 2007) New Revision: 13933 Modified: trunk/freenet/test/freenet/support/TimeUtilTest.java Log: Fix TimeUtilTest on my system; thanks to Muixirt for the heads up... We probably need to find a better hack than that : we need our tests to be locale independent Modified: trunk/freenet/test/freenet/support/TimeUtilTest.java =================================================================== --- trunk/freenet/test/freenet/support/TimeUtilTest.java 2007-07-04 21:07:06 UTC (rev 13932) +++ trunk/freenet/test/freenet/support/TimeUtilTest.java 2007-07-04 22:25:01 UTC (rev 13933) @@ -32,7 +32,7 @@ */ public void testFormatTime_LongIntBoolean_MaxValue() { String expectedForMaxLongValue = "15250284452w3d7h12m55.807s"; - assertEquals(TimeUtil.formatTime(Long.MAX_VALUE,6,true),expectedForMaxLongValue); + assertEquals(TimeUtil.formatTime(Long.MAX_VALUE,6,true).replace(',','.'),expectedForMaxLongValue); } /** @@ -90,7 +90,7 @@ "1w1d1h1m1.001s" //6 terms }; for(int i = 0; i < valAndExpected.length; i++) - assertEquals(TimeUtil.formatTime(oneForTermLong,i,true),valAndExpected[i]); + assertEquals(TimeUtil.formatTime(oneForTermLong,i,true).replace(',','.'),valAndExpected[i]); } /** @@ -102,7 +102,7 @@ public void testFormatTime_LongIntBoolean_milliseconds() { long methodValue = 1; //1ms assertEquals(TimeUtil.formatTime(methodValue,6,false),""); - assertEquals(TimeUtil.formatTime(methodValue,6,true),"0.001s"); + assertEquals(TimeUtil.formatTime(methodValue,6,true).replace(',','.'),"0.001s"); } /** From toad at freenetproject.org Wed Jul 4 22:59:32 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Wed, 4 Jul 2007 22:59:32 +0000 (UTC) Subject: [freenet-cvs] r13934 - trunk/freenet/src/freenet/node Message-ID: <20070704225932.BF7C73886E5@emu.freenetproject.org> Author: toad Date: 2007-07-04 22:59:32 +0000 (Wed, 04 Jul 2007) New Revision: 13934 Modified: trunk/freenet/src/freenet/node/FNPPacketMangler.java Log: Fix a connectivity bug (we were looping the first connectedPeers.length of myPeers!). Debugging opennet failure to connect. Modified: trunk/freenet/src/freenet/node/FNPPacketMangler.java =================================================================== --- trunk/freenet/src/freenet/node/FNPPacketMangler.java 2007-07-04 22:25:01 UTC (rev 13933) +++ trunk/freenet/src/freenet/node/FNPPacketMangler.java 2007-07-04 22:59:32 UTC (rev 13934) @@ -113,6 +113,10 @@ * occasionally change their IP addresses). */ PeerNode opn = node.peers.getByPeer(peer); + if(opn.getOutgoingMangler() != this) { + Logger.error(this, "Apparently contacted by "+opn+") on "+this); + opn = null; + } PeerNode pn; if(opn != null) { @@ -129,9 +133,10 @@ if(tryProcessAuth(buf, offset, length, opn, peer)) return; } } + PeerNode[] peers = crypto.getPeerNodes(); if(length > HASH_LENGTH + RANDOM_BYTES_LENGTH + 4 + 6) { - for(int i=0;i Node.SYMMETRIC_KEY_LENGTH /* iv */ + HASH_LENGTH + 2) { - for(int i=0;i Author: nextgens Date: 2007-07-04 23:04:37 +0000 (Wed, 04 Jul 2007) New Revision: 13935 Modified: trunk/freenet/src/freenet/support/SimpleFieldSet.java trunk/freenet/test/freenet/support/SimpleFieldSetTest.java Log: Resolve 1493: SimpleFieldSet get() method fails when a key with a couple of paired .. is put Modified: trunk/freenet/src/freenet/support/SimpleFieldSet.java =================================================================== --- trunk/freenet/src/freenet/support/SimpleFieldSet.java 2007-07-04 22:59:32 UTC (rev 13934) +++ trunk/freenet/src/freenet/support/SimpleFieldSet.java 2007-07-04 23:04:37 UTC (rev 13935) @@ -169,8 +169,8 @@ if(idx == -1) return (String) values.get(key); else if(idx == 0) - return null; - else { + return (subset("") == null) ? null : subset("").get(key.substring(1)); + else { if(subsets == null) return null; String before = key.substring(0, idx); String after = key.substring(idx+1); Modified: trunk/freenet/test/freenet/support/SimpleFieldSetTest.java =================================================================== --- trunk/freenet/test/freenet/support/SimpleFieldSetTest.java 2007-07-04 22:59:32 UTC (rev 13934) +++ trunk/freenet/test/freenet/support/SimpleFieldSetTest.java 2007-07-04 23:04:37 UTC (rev 13935) @@ -56,18 +56,8 @@ String methodKey = "foo..bar"; String methodValue = "foobar"; methodSFS.putSingle(methodKey,methodValue); - methodSFS.subset("foo").subset("").get("bar"); /*it returns "foobar" */ - - /*methodSFS.subset("foo").subset(null).get("bar"); /* it raises null exception - * because subset(null) returns - * null by default */ - - methodSFS.get("foo..bar"); /* it doesn't work - * but if I put("foo.bar.boo","bazoo") - * and I get("foo.bar.boo") -> it returns "bazoo" - * so it should do the same for "foo..bar" - * or it would raise an exception */ - //assertEquals(methodSFS.get(methodKey),methodValue); + assertEquals(methodSFS.subset("foo").subset("").get("bar"),methodValue); + assertEquals(methodSFS.get(methodKey),methodValue); } /** @@ -80,7 +70,7 @@ String methodKey = "foo..bar"; String methodValue = "foobar"; methodSFS.putAppend(methodKey,methodValue); - //assertEquals(methodSFS.get(methodKey),methodValue); + assertEquals(methodSFS.get(methodKey),methodValue); } /** @@ -672,4 +662,4 @@ Iterator itr = methodSFS.keyIterator(methodPrefix); assertTrue(areAllContainedKeys(SAMPLE_STRING_PAIRS,methodPrefix,itr)); } -} \ No newline at end of file +} From nextgens at freenetproject.org Wed Jul 4 23:07:23 2007 From: nextgens at freenetproject.org (nextgens at freenetproject.org) Date: Wed, 4 Jul 2007 23:07:23 +0000 (UTC) Subject: [freenet-cvs] r13936 - trunk/freenet/test/freenet/support Message-ID: <20070704230723.42759388002@emu.freenetproject.org> Author: nextgens Date: 2007-07-04 23:07:22 +0000 (Wed, 04 Jul 2007) New Revision: 13936 Modified: trunk/freenet/test/freenet/support/SimpleFieldSetTest.java Log: Improve the test: it's funnier to try the worst case Modified: trunk/freenet/test/freenet/support/SimpleFieldSetTest.java =================================================================== --- trunk/freenet/test/freenet/support/SimpleFieldSetTest.java 2007-07-04 23:04:37 UTC (rev 13935) +++ trunk/freenet/test/freenet/support/SimpleFieldSetTest.java 2007-07-04 23:07:22 UTC (rev 13936) @@ -53,10 +53,10 @@ */ public void testSimpleFieldSetPutSingle_StringString_WithTwoPairedMultiLevelChars() { SimpleFieldSet methodSFS = new SimpleFieldSet(true); - String methodKey = "foo..bar"; + String methodKey = "foo..bar."; String methodValue = "foobar"; methodSFS.putSingle(methodKey,methodValue); - assertEquals(methodSFS.subset("foo").subset("").get("bar"),methodValue); + assertEquals(methodSFS.subset("foo").subset("").subset("bar").get(""),methodValue); assertEquals(methodSFS.get(methodKey),methodValue); } From toad at freenetproject.org Wed Jul 4 23:09:33 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Wed, 4 Jul 2007 23:09:33 +0000 (UTC) Subject: [freenet-cvs] r13937 - trunk/freenet/src/freenet/node Message-ID: <20070704230933.82FA84791C0@emu.freenetproject.org> Author: toad Date: 2007-07-04 23:09:33 +0000 (Wed, 04 Jul 2007) New Revision: 13937 Modified: trunk/freenet/src/freenet/node/FNPPacketMangler.java Log: Fix NPE Modified: trunk/freenet/src/freenet/node/FNPPacketMangler.java =================================================================== --- trunk/freenet/src/freenet/node/FNPPacketMangler.java 2007-07-04 23:07:22 UTC (rev 13936) +++ trunk/freenet/src/freenet/node/FNPPacketMangler.java 2007-07-04 23:09:33 UTC (rev 13937) @@ -113,7 +113,7 @@ * occasionally change their IP addresses). */ PeerNode opn = node.peers.getByPeer(peer); - if(opn.getOutgoingMangler() != this) { + if(opn != null && opn.getOutgoingMangler() != this) { Logger.error(this, "Apparently contacted by "+opn+") on "+this); opn = null; } From nextgens at freenetproject.org Wed Jul 4 23:21:08 2007 From: nextgens at freenetproject.org (nextgens at freenetproject.org) Date: Wed, 4 Jul 2007 23:21:08 +0000 (UTC) Subject: [freenet-cvs] r13938 - in trunk/freenet: src/freenet/support test/freenet/support Message-ID: <20070704232108.840EE3886E5@emu.freenetproject.org> Author: nextgens Date: 2007-07-04 23:21:08 +0000 (Wed, 04 Jul 2007) New Revision: 13938 Modified: trunk/freenet/src/freenet/support/SimpleFieldSet.java trunk/freenet/test/freenet/support/SimpleFieldSetTest.java Log: Some work on SimpleFieldSet: enable a few disabled tests, handle border-cases Modified: trunk/freenet/src/freenet/support/SimpleFieldSet.java =================================================================== --- trunk/freenet/src/freenet/support/SimpleFieldSet.java 2007-07-04 23:09:33 UTC (rev 13937) +++ trunk/freenet/src/freenet/support/SimpleFieldSet.java 2007-07-04 23:21:08 UTC (rev 13938) @@ -640,11 +640,11 @@ } public Iterator directSubsetNameIterator() { - return subsets.keySet().iterator(); + return (subsets == null) ? null : subsets.keySet().iterator(); } public String[] namesOfDirectSubsets() { - return (String[]) subsets.keySet().toArray(new String[subsets.size()]); + return (subsets == null) ? null : (String[]) subsets.keySet().toArray(new String[subsets.size()]); } public static SimpleFieldSet readFrom(InputStream is, boolean allowMultiple, boolean shortLived) throws IOException { Modified: trunk/freenet/test/freenet/support/SimpleFieldSetTest.java =================================================================== --- trunk/freenet/test/freenet/support/SimpleFieldSetTest.java 2007-07-04 23:09:33 UTC (rev 13937) +++ trunk/freenet/test/freenet/support/SimpleFieldSetTest.java 2007-07-04 23:21:08 UTC (rev 13938) @@ -487,12 +487,10 @@ Iterator methodIter = methodSFS.directSubsetNameIterator(); while (methodIter.hasNext()) ((String)methodIter.next()).equals(SAMPLE_STRING_PAIRS[0][0]); + methodSFS = new SimpleFieldSet(true); - /*TODO: the code below should work, - instead atm it raises a not-so-good null exception methodIter = methodSFS.directSubsetNameIterator(); - while (methodIter.hasNext()) - fail("An empty SFS cannot have direct subset!"); */ + assertNull(methodIter); } /** @@ -502,12 +500,9 @@ String[] expectedResult = {SAMPLE_STRING_PAIRS[0][0]}; SimpleFieldSet methodSFS = sfsFromSampleStringPairs(); assertTrue(Arrays.equals(methodSFS.namesOfDirectSubsets(),expectedResult)); - /*TODO: the code below should work, - instead atm it raises a not-so-good null exception - expectedResult = new String[0]; + methodSFS = new SimpleFieldSet(true); - assertTrue(Arrays.equals(methodSFS.namesOfDirectSubsets(),expectedResult)); */ - + assertNull(methodSFS.namesOfDirectSubsets()); } public void testOrderedString() { From toad at freenetproject.org Wed Jul 4 23:37:25 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Wed, 4 Jul 2007 23:37:25 +0000 (UTC) Subject: [freenet-cvs] r13939 - trunk/freenet/src/freenet/io/comm Message-ID: <20070704233725.2468D47990C@emu.freenetproject.org> Author: toad Date: 2007-07-04 23:37:24 +0000 (Wed, 04 Jul 2007) New Revision: 13939 Modified: trunk/freenet/src/freenet/io/comm/MessageFilter.java Log: It's not timed out if it's matched Modified: trunk/freenet/src/freenet/io/comm/MessageFilter.java =================================================================== --- trunk/freenet/src/freenet/io/comm/MessageFilter.java 2007-07-04 23:21:08 UTC (rev 13938) +++ trunk/freenet/src/freenet/io/comm/MessageFilter.java 2007-07-04 23:37:24 UTC (rev 13939) @@ -201,6 +201,7 @@ } public boolean timedOut() { + if(_matched) return false; if(_callback != null && _callback.shouldTimeout()) _timeout = -1; // timeout immediately return _timeout < System.currentTimeMillis(); From toad at freenetproject.org Wed Jul 4 23:47:36 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Wed, 4 Jul 2007 23:47:36 +0000 (UTC) Subject: [freenet-cvs] r13940 - trunk/freenet/src/freenet/io/comm Message-ID: <20070704234736.5E7683886E5@emu.freenetproject.org> Author: toad Date: 2007-07-04 23:47:36 +0000 (Wed, 04 Jul 2007) New Revision: 13940 Modified: trunk/freenet/src/freenet/io/comm/MessageFilter.java Log: Record which connection was dropped! Modified: trunk/freenet/src/freenet/io/comm/MessageFilter.java =================================================================== --- trunk/freenet/src/freenet/io/comm/MessageFilter.java 2007-07-04 23:37:24 UTC (rev 13939) +++ trunk/freenet/src/freenet/io/comm/MessageFilter.java 2007-07-04 23:47:36 UTC (rev 13940) @@ -251,6 +251,7 @@ * @param ctx */ public synchronized void onDroppedConnection(PeerContext ctx) { + _droppedConnection = ctx; notifyAll(); } @@ -260,6 +261,7 @@ * @param ctx */ public synchronized void onRestartedConnection(PeerContext ctx) { + _droppedConnection = ctx; notifyAll(); } From toad at freenetproject.org Wed Jul 4 23:48:50 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Wed, 4 Jul 2007 23:48:50 +0000 (UTC) Subject: [freenet-cvs] r13941 - trunk/freenet/src/freenet/io/comm Message-ID: <20070704234850.032793886E4@emu.freenetproject.org> Author: toad Date: 2007-07-04 23:48:49 +0000 (Wed, 04 Jul 2007) New Revision: 13941 Modified: trunk/freenet/src/freenet/io/comm/MessageFilter.java Log: logging Modified: trunk/freenet/src/freenet/io/comm/MessageFilter.java =================================================================== --- trunk/freenet/src/freenet/io/comm/MessageFilter.java 2007-07-04 23:47:36 UTC (rev 13940) +++ trunk/freenet/src/freenet/io/comm/MessageFilter.java 2007-07-04 23:48:49 UTC (rev 13941) @@ -196,6 +196,9 @@ return _matched; } + /** + * Which connection dropped or was restarted? + */ public PeerContext droppedConnection() { return _droppedConnection; } From toad at freenetproject.org Wed Jul 4 23:57:15 2007 From: toad at freenetproject.org (toad at freenetproject.org) Date: Wed, 4 Jul 2007 23:57:15 +0000 (UTC) Subject: [freenet-cvs] r13942 - trunk/freenet/src/freenet/io/comm Message-ID: <20070704235715.EB5DE3886E5@emu.freenetproject.org> Author: toad Date: 2007-07-04 23:57:15 +0000 (Wed, 04 Jul 2007) New Revision: 13942 Modified: trunk/freenet/src/freenet/io/comm/UdpSocketHandler.java Log: Clearer code Modified: trunk/freenet/src/freenet/io/comm/UdpSocketHandler.java =================================================================== --- trunk/freenet/src/freenet/io/comm/UdpSocketHandler.java 2007-07-04 23:48:49 UTC (rev 13941) +++ trunk/freenet/src/freenet/io/comm/UdpSocketHandler.java 2007-07-04 23:57:15 UTC (rev 13942) @@ -251,7 +251,7 @@ Logger.error(this, "It shouldn't happen : we disabled the MTU detection algorithm because the advertised MTU is smallish !! ("+node.ipDetector.getMinimumDetectedMTU()+')'); return MAX_ALLOWED_MTU - UDP_HEADERS_LENGTH; } else - return (minAdvertisedMTU < MAX_ALLOWED_MTU ? minAdvertisedMTU : MAX_ALLOWED_MTU) - UDP_HEADERS_LENGTH; + return Math.min(MAX_ALLOWED_MTU, minAdvertisedMTU) - UDP_HEADERS_LENGTH; // UDP/IP header is 28 bytes. } From sbalh at freenetproject.org Wed Jul 4 22:57:31 2007 From: sbalh at freenetproject.org (Nora) Date: Wed, 04 Jul 2007 22:57:31 --500 (EET) Subject: [freenet-cvs] *****SPAM***** Super-Rocket Stock Report Message-ID: An embedded and charset-unspecified text was scrubbed... Name: not available Url: http://emu.freenetproject.org/pipermail/cvs/attachments/20070704/c92a9189/attachment.txt -------------- next part -------------- An embedded message was scrubbed... From: "Nora" Subject: Super-Rocket Stock Report Date: Wed, 04 Jul 2007 22:57:31 --500 (EET) Size: 1797 Url: http://emu.freenetproject.org/pipermail/cvs/attachments/20070704/c92a9189/attachment.eml From sback at freenetproject.org Thu Jul 5 07:41:12 2007 From: sback at freenetproject.org (sback at freenetproject.org) Date: Thu, 5 Jul 2007 07:41:12 +0000 (UTC) Subject: [freenet-cvs] r13943 - trunk/freenet/test/freenet/support Message-ID: <20070705074112.6142847954E@emu.freenetproject.org> Author: sback Date: 2007-07-05 07:41:11 +0000 (Thu, 05 Jul 2007) New Revision: 13943 Modified: trunk/freenet/test/freenet/support/TimeUtilTest.java Log: Properly fixed a bug, already worked around by nextgens, forcing a Locale, thanks to a nextgens advice. Modified: trunk/freenet/test/freenet/support/TimeUtilTest.java =================================================================== --- trunk/freenet/test/freenet/support/TimeUtilTest.java 2007-07-04 23:57:15 UTC (rev 13942) +++ trunk/freenet/test/freenet/support/TimeUtilTest.java 2007-07-05 07:41:11 UTC (rev 13943) @@ -15,6 +15,8 @@ */ package freenet.support; +import java.util.Locale; + import junit.framework.TestCase; /** @@ -26,13 +28,17 @@ private long oneForTermLong = 694861001; //1w+1d+1h+1m+1s+1ms + protected void setUp() throws Exception { + Locale.setDefault(Locale.US); + } + /** * Tests formatTime(long,int,boolean) method * trying the biggest long value */ public void testFormatTime_LongIntBoolean_MaxValue() { String expectedForMaxLongValue = "15250284452w3d7h12m55.807s"; - assertEquals(TimeUtil.formatTime(Long.MAX_VALUE,6,true).replace(',','.'),expectedForMaxLongValue); + assertEquals(TimeUtil.formatTime(Long.MAX_VALUE,6,true),expectedForMaxLongValue); } /** @@ -90,7 +96,7 @@ "1w1d1h1m1.001s" //6 terms }; for(int i = 0; i < valAndExpected.length; i++) - assertEquals(TimeUtil.formatTime(oneForTermLong,i,true).replace(',','.'),valAndExpected[i]); + assertEquals(TimeUtil.formatTime(oneForTermLong,i,true),valAndExpected[i]); } /** @@ -102,7 +108,7 @@ public void testFormatTime_LongIntBoolean_milliseconds() { long methodValue = 1; //1ms assertEquals(TimeUtil.formatTime(methodValue,6,false),""); - assertEquals(TimeUtil.formatTime(methodValue,6,true).replace(',','.'),"0.001s"); + assertEquals(TimeUtil.formatTime(methodValue,6,true),"0.001s"); } /** From sback at freenetproject.org Thu Jul 5 07:49:25 2007 From: sback at freenetproject.org (sback at freenetproject.org) Date: Thu, 5 Jul 2007 07:49:25 +0000 (UTC) Subject: [freenet-cvs] r13944 - trunk/freenet/test/freenet/support Message-ID: <20070705074925.3E0CC47974F@emu.freenetproject.org> Author: sback Date: 2007-07-05 07:49:24 +0000 (Thu, 05 Jul 2007) New Revision: 13944 Modified: trunk/freenet/test/freenet/support/SimpleFieldSetTest.java Log: Removed some obscurity from the code, thanks to toad Modified: trunk/freenet/test/freenet/support/SimpleFieldSetTest.java =================================================================== --- trunk/freenet/test/freenet/support/SimpleFieldSetTest.java 2007-07-05 07:41:11 UTC (rev 13943) +++ trunk/freenet/test/freenet/support/SimpleFieldSetTest.java 2007-07-05 07:49:24 UTC (rev 13944) @@ -481,13 +481,15 @@ /** * Tests directSubsetNameIterator() method. + * It uses SAMPLE_STRING_PAIRS and for this reason + * the expected subset is "foo". */ public void testDirectSubsetNameIterator() { SimpleFieldSet methodSFS = sfsFromSampleStringPairs(); + String expectedSubset = SAMPLE_STRING_PAIRS[0][0]; //"foo" Iterator methodIter = methodSFS.directSubsetNameIterator(); while (methodIter.hasNext()) - ((String)methodIter.next()).equals(SAMPLE_STRING_PAIRS[0][0]); - + ((String)methodIter.next()).equals(expectedSubset); methodSFS = new SimpleFieldSet(true); methodIter = methodSFS.directSubsetNameIterator(); assertNull(methodIter); @@ -505,11 +507,6 @@ assertNull(methodSFS.namesOfDirectSubsets()); } - public void testOrderedString() { - SimpleFieldSet methodSFS = sfsFromSampleStringPairs(); - System.out.println(methodSFS.toOrderedString()); - } - /** * Test the putOverwrite(String,String) method. */ From sback at freenetproject.org Thu Jul 5 12:50:01 2007 From: sback at freenetproject.org (sback at freenetproject.org) Date: Thu, 5 Jul 2007 12:50:01 +0000 (UTC) Subject: [freenet-cvs] r13945 - trunk/freenet/test/freenet/support Message-ID: <20070705125001.91EDF479853@emu.freenetproject.org> Author: sback Date: 2007-07-05 12:50:01 +0000 (Thu, 05 Jul 2007) New Revision: 13945 Modified: trunk/freenet/test/freenet/support/URLEncoderDecoderTest.java Log: Forcing chars encoding fully tested and not-ASCII encoding problem in evidence Modified: trunk/freenet/test/freenet/support/URLEncoderDecoderTest.java =================================================================== --- trunk/freenet/test/freenet/support/URLEncoderDecoderTest.java 2007-07-05 07:49:24 UTC (rev 13944) +++ trunk/freenet/test/freenet/support/URLEncoderDecoderTest.java 2007-07-05 12:50:01 UTC (rev 13945) @@ -15,6 +15,8 @@ */ package freenet.support; +import java.io.UnsupportedEncodingException; + import junit.framework.TestCase; /** @@ -29,23 +31,75 @@ * Tests if URLEncode.encode(String) and * URLDecode.decode(String,boolean) methods * work correctly together, both with safe - * characters and not safe. + * characters and not safe "base" (i.e. ASCII) chars . */ - public void testEncodeDecodeString() { - String[][] toEncode_encoded = { - {"*-_./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",""}, //safe chars - {"!@#$%^&()+={}[]:;\"'<>,?~`\n",""} //not safe chars + public void testEncodeDec