[freenet-dev] [freenet-cvs] r26261 - trunk/contrib/fec/src/csrc

2009-04-29 Thread Matthew Toseland
On Tuesday 31 March 2009 02:27:09 j16sdiz at freenetproject.org wrote:
> Author: j16sdiz
> Date: 2009-03-31 01:27:08 + (Tue, 31 Mar 2009)
> New Revision: 26261
> 
> Modified:
>trunk/contrib/fec/src/csrc/Makefile
> Log:
> Remove the reference to assembly in Makefile

What about embedded systems? Don't we want to keep this around if only 
commented out?
> 
> Modified: trunk/contrib/fec/src/csrc/Makefile
> ===
> --- trunk/contrib/fec/src/csrc/Makefile   2009-03-30 23:51:44 UTC (rev 
> 26260)
> +++ trunk/contrib/fec/src/csrc/Makefile   2009-03-31 01:27:08 UTC (rev 
> 26261)
> @@ -1,12 +1,6 @@
>  #
>  # makefile for vdm.
>  #
> -# fec.S.980624a is an optimized version for use on 486 and old pentium
> -# machines. It is only for GF_BITS=8 and generally does not work
> -# fast on systems with multiple instruction pipelines (PentiumPro,
> -# Pentium2)
> -# same for fec.S16.980624a , for use with GF_BITS=16
> -#
>  # gcc does something strange, so check the various opt. levels for
>  # best performance (or write addmul1 in assembly code).
>  #
> @@ -18,9 +12,7 @@
>  # COPT= -O9 -funroll-loops
>  COPT= -O1
>  CFLAGS=$(COPT) -Wall -fPIC# -DTEST -pedantic
> -SRCS= fec.c Makefile test.c fec.s.980621e \
> - fec.S.980624a \
> - fec.S16.980624a
> +SRCS= fec.c Makefile test.c
>  DOCS= README fec.3
>  ALLSRCS= $(SRCS) $(DOCS) fec.h
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/8a05739c/attachment.pgp>


[freenet-dev] "staging" and "official"

2009-04-29 Thread xor
On Wednesday 29 April 2009 21:36:53 Matthew Toseland wrote:
> On Wednesday 29 April 2009 20:15:43 xor wrote:
> > On Wednesday 29 April 2009 20:52:03 Ian Clarke wrote:
> > > Are we sure having separate projects for "staging" and "official" in
> > > github is the right way to organize this?  I don't see any other
> > > projects on github organized in this way.  Shouldn't they be separate
> > > branches or something, not entire separate projects?
> > >
> > > Ian.
> >
> > Mmh yes it is annoying to keep separate projects I guess: For example the
> > build.xml must be corrected for each project:
> >
> > - Fred-staging/Fred-official need different build files.
>
> They do? Why?

The ant builder ("New builder") has a configured build file of:
"${workspace_loc:/fred-staging/build.xml}"
OR
"${workspace_loc:/fred-official/build.xml}"

>
> > - WoT / Freetalk rely on Fred so the project name on which they are
>
> dependent
>
> > will not fit depending on whether you have checked out staging or
> > official
>
> of
>
> > Fred.
>
> Why is this a problem? Just rename the directory! (Or on a sensible
> operating system use a directory symlink).

I did so, yes. Not really a problem you just have to be smart enough to do so. 
And the last time I renamed the directory it screwed egit up. The safest way 
is to rename before checking out. Or to reconfigure the project dependancies of 
Freetalk / WoT.
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/f95c6377/attachment.pgp>


[freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread xor
On Tuesday 28 April 2009 00:11:41 xor wrote:
> Hi,
>
> I've been trying to set up my IDE to work with git and found the
> following one:
>
> http://www.jgit.org/
>
> It pulls, it diffs, everything, but push won't work:
> "Can't connect to any URI: git://github.com/freenet/fred-staging.git
> (Transport error occured during push operation: Protocol error: expected
> LF)"
>
> Notice that I did not specify the git:// URI when fetching the
> repository, I used the git@ one and enabled git+ssh.
>
> Does anyone know of an alternative git plugin for eclipse which is more
> stable?
>
> Greetings, xor

Eclipse git / JGit (whatever the official name is) seems to work now. Please 
ensure the following if you want to use it:

- Tutorial is available here:
 http://github.com/guides/using-the-egit-eclipse-plugin-with-github

- Use the latest testing version they provide when installing via update 
manager. They seem to have fixed the "Protocol error" bug today or yesterday or 
so.

- When entering the "git@" URI in the import dialog, it will complain "Host 
not supported on file protocol", you have to manually chose the "git" or 
"git+ssh" protocol in the "Connection" section of that dialog. All the other 
information is parsed automatically though, Username: "git" and blank password 
is correct.

xor

-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/2c467297/attachment.pgp>


[freenet-dev] [freenet-cvs] r27121 - trunk/freenet/src/freenet/client/async

2009-04-29 Thread xor
On Wednesday 29 April 2009 20:32:34 bo-le wrote:
>
>
> currently im not able to contribute until im able to serve git.
> i need an (intuitiv) usable git plugin for eclipse or a hg-git bridge?, i
> will use & continue with whatever what comes first. (i hope its the
> latter.)

I just managed to get "Eclipse git" working, please try it, it seems useable:
http://www.jgit.org/

For those using the Eclipse update manager they have something there:
"If you found yourself this far you may try to install using the update site 
available here. Point the update manager to http://www.jgit.org/update-site  
and install."

If you need any further help getting eclipse git to work please ask me.


> ?) http://github.com/schacon/hg-git
> ___
> Devl mailing list
> Devl at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/065b4640/attachment.pgp>


[freenet-dev] "staging" and "official"

2009-04-29 Thread xor
On Wednesday 29 April 2009 20:52:03 Ian Clarke wrote:
> Are we sure having separate projects for "staging" and "official" in
> github is the right way to organize this?  I don't see any other
> projects on github organized in this way.  Shouldn't they be separate
> branches or something, not entire separate projects?
>
> Ian.

Mmh yes it is annoying to keep separate projects I guess: For example the 
build.xml must be corrected for each project:

- Fred-staging/Fred-official need different build files.
- WoT / Freetalk rely on Fred so the project name on which they are dependent 
will not fit depending on whether you have checked out staging or official of 
Fred.
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/1944f520/attachment.pgp>


[freenet-dev] [freenet-cvs] r27137 - trunk/freenet/src/freenet/support/io

2009-04-29 Thread Matthew Toseland
On Wednesday 29 April 2009 16:39:38 Daniel Cheng wrote:
> On Wed, Apr 29, 2009 at 11:14 PM, Matthew Toseland
>  wrote:
> > On Wednesday 29 April 2009 02:58:48 Daniel Cheng wrote:
> >> On Wed, Apr 29, 2009 at 9:21 AM, Matthew Toseland
> >>  wrote:
> >> > On Tuesday 21 April 2009 08:55:53 j16sdiz at freenetproject.org wrote:
> >> >> Author: j16sdiz
> >> >> Date: 2009-04-21 07:55:52 + (Tue, 21 Apr 2009)
> >> >> New Revision: 27137
> >> >>
> >> >> Modified:
> >> >> ? ?trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
> >> >> Log:
> >> >> Fix inputStream count
> >> >
> >> > What's the difference? Apart from your version breaks on an OOM and the
> >> > previous version didn't?
> >>
> >>
> >> If you close it twice, the counter get decreased twice.
> >
> > Doh! But why the inputStreams inc move?
> 
> hmm.. it does nothing different.
> it should not have been committed.

Fixed in 126c11e
> 
> >> >>
> >> >> Modified:
> > trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
> >> >> ===
> >> >> --- trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
> >> > 2009-04-21 07:55:31 UTC (rev 27136)
> >> >> +++ trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
> >> > 2009-04-21 07:55:52 UTC (rev 27137)
> >> >> @@ -75,17 +75,15 @@
> >> >> ? ? ? public InputStream getInputStream() throws IOException {
> >> >> ? ? ? ? ? ? ? if(freed) throw new IOException("Already freed");
> >> >> ? ? ? ? ? ? ? final FileChannel channel = factory.channel;
> >> >> +
> >> >> + ? ? ? ? ? ? synchronized(PersistentBlobTempBucket.this) {
> >> >> + ? ? ? ? ? ? ? ? ? ? inputStreams++;
> >> >> + ? ? ? ? ? ? }
> >> >> +
> >> >> ? ? ? ? ? ? ? return new InputStream() {
> >> >> -
> >> >> ? ? ? ? ? ? ? ? ? ? ? private int offset;
> >> >> ? ? ? ? ? ? ? ? ? ? ? private boolean closed;
> >> >>
> >> >> - ? ? ? ? ? ? ? ? ? ? {
> >> >> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? 
synchronized(PersistentBlobTempBucket.this)
> > {
> >> >> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? inputStreams++;
> >> >> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
> >> >> - ? ? ? ? ? ? ? ? ? ? }
> >> >> -
> >> >> ? ? ? ? ? ? ? ? ? ? ? @Override
> >> >> ? ? ? ? ? ? ? ? ? ? ? public int read() throws IOException {
> >> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if (closed) throw new
> > IOException("closed");
> >> >> @@ -130,6 +128,7 @@
> >> >>
> >> >> ? ? ? ? ? ? ? ? ? ? ? @Override
> >> >> ? ? ? ? ? ? ? ? ? ? ? public void close() {
> >> >> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? if (closed) return;
> >> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? closed = true;
> >> >>
> >> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 
synchronized(PersistentBlobTempBucket.this)
> > {
> >> >>
> >> >> ___
> >> >> cvs mailing list
> >> >> cvs at freenetproject.org
> >> >> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
> >> >>
> >> >>
> >> >
> >> >
> >> >
> >> > ___
> >> > Devl mailing list
> >> > Devl at freenetproject.org
> >> > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
> >> >
> >> ___
> >> Devl mailing list
> >> Devl at freenetproject.org
> >> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
> >>
> >>
> >
> >
> >
> > ___
> > Devl mailing list
> > Devl at freenetproject.org
> > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
> >
> ___
> Devl mailing list
> Devl at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
> 
> 


-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/37d0619d/attachment.pgp>


[freenet-dev] "staging" and "official"

2009-04-29 Thread Matthew Toseland
On Wednesday 29 April 2009 20:51:45 xor wrote:
> On Wednesday 29 April 2009 21:36:53 Matthew Toseland wrote:
> > On Wednesday 29 April 2009 20:15:43 xor wrote:
> > > On Wednesday 29 April 2009 20:52:03 Ian Clarke wrote:
> > > > Are we sure having separate projects for "staging" and "official" in
> > > > github is the right way to organize this?  I don't see any other
> > > > projects on github organized in this way.  Shouldn't they be separate
> > > > branches or something, not entire separate projects?
> > > >
> > > > Ian.
> > >
> > > Mmh yes it is annoying to keep separate projects I guess: For example 
the
> > > build.xml must be corrected for each project:
> > >
> > > - Fred-staging/Fred-official need different build files.
> >
> > They do? Why?
> 
> The ant builder ("New builder") has a configured build file of:
> "${workspace_loc:/fred-staging/build.xml}"
> OR
> "${workspace_loc:/fred-official/build.xml}"

Ugh. Well the project can be called anything...
> 
> >
> > > - WoT / Freetalk rely on Fred so the project name on which they are
> >
> > dependent
> >
> > > will not fit depending on whether you have checked out staging or
> > > official
> >
> > of
> >
> > > Fred.
> >
> > Why is this a problem? Just rename the directory! (Or on a sensible
> > operating system use a directory symlink).
> 
> I did so, yes. Not really a problem you just have to be smart enough to do 
so. 
> And the last time I renamed the directory it screwed egit up. The safest way 
> is to rename before checking out. Or to reconfigure the project dependancies 
of 
> Freetalk / WoT.

Aaaargh. Well, egit sucks, we have established this. git itself doesn't care 
what the directory is called.
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/abeb91b6/attachment.pgp>


[freenet-dev] [freenet-cvs] r27121 - trunk/freenet/src/freenet/client/async

2009-04-29 Thread Matthew Toseland
gt; > > +   final Metadata 
> > > > > > newMetadata;
> > > > > > +   try {
> > > > > > +
> > > > > > +   
> > > > > > newMetadata = Metadata.construct(data);
> > > > > > +   
> > > > > > continueWithNewMetadata(newMetadata,
> > >
> > > SingleFileFetcher.this.rcb,
> > >
> > > > > container, context);
> > > > >
> > > > > Here we are using the metadata we have just fetched as new metadata.
> > > > > ...
> > > > >
> > > > > > @@ -576,18 +653,7 @@
> > > > > > if(logMINOR) Logger.minor(this, "Is 
> > > > > > multi-level metadata");
> > > > > > // Fetch on a second SingleFileFetcher, 
> > > > > > like with archives.
> > > > > > metadata.setSimpleRedirect();
> > > > > > -   final SingleFileFetcher f = new 
> > > > > > SingleFileFetcher(this,
> > > > > > persistent,
> > > > >
> > > > > false, metadata, new MultiLevelMetadataCallback(), ctx, container,
> > > > > context);
> > > > >
> > > > > > -   // Clear our own metadata so it can be 
> > > > > > garbage collected, it
> > > > > > will
> > >
> > > be
> > >
> > > > > replaced by whatever is fetched.
> > > > >
> > > > > > -   // The new fetcher has our metadata so 
> > > > > > we don't need to
> > > > >
> > > > > removeMetadata().
> > > > >
> > > > > > -   this.metadata = null;
> > > > > > -   if(persistent) container.store(this);
> > > > > > -   if(persistent) container.store(f);
> > > > > > -
> > > > > > -   // We must transition to the 
> > > > > > sub-fetcher so that if the 
request
> > > > > > is
> > > > >
> > > > > cancelled, it will get deleted.
> > > > >
> > > > > > -   parent.onTransition(this, f, container);
> > > > > > -
> > > > > > -   f.wrapHandleMetadata(true, container, 
> > > > > > context);
> > > > > > -   if(persistent) container.deactivate(f, 
> > > > > > 1);
> > > > > > +   continueWithNewMetadata(metadata, new
> > > > > > MultiLevelMetadataCallback(),
> > > > >
> > > > > container, context);
> > > > >
> > > > > Here we are using the CURRENT metadata to fetch new metadata in 
order
> > > > > to unpack that metadata and use that. These are *two different
> > > > > operations*. The latter is fine, but the former is broken. What you
> > > > > want to do is
> > >
> > > simply
> > >
> > > > > remove the old metadata (if persistent) and set metadata to the new
> > > > > metadata, and go back around the loop.
> > > >
> > > > i got the ARCHIVE_METADATA_REDIRECT basicly working,
> > > > but get somewhat working does not allways include i have really
> > > > understand
> > >
> > > the
> > >
> > > > code i changed. :(
> > > >
> > > > is it better to revert the continueWithNewMetadata(..) and include the
> > > > code directly?
> > >
> > > Yes:
> > > - Revert continueWithNewMetadata and the changes to the constructor and 
to
> > > the section that starts fetching multi-level metadata.
> > > - Deal with the new metadata in exactly the same way as
> > > MultiLevelMetadataCallback.onSuccess() does: remove the old metadata,
> > > substitute the new and call back in to wrapHandleMetadata().
> > 
> > currently im not able to contribute until im able to serve git.
> > i need an (intuitiv) usable git plugin for eclipse or a hg-git bridge?, i 
> will 
> > use & continue with whatever what comes first. (i hope its the latter.)
> > 
> > ?) http://github.com/schacon/hg-git
> 
> Okay, I will fix these changes locally, especially as we would like to get a 
> new stable build out soon.

Fixed in a588df5. Testing of archive metadata would be helpful.
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/5cee673d/attachment.pgp>


[freenet-dev] [freenet-cvs] r27121 - trunk/freenet/src/freenet/client/async

2009-04-29 Thread Matthew Toseland
 > > > >   if(logMINOR) Logger.minor(this, "Is 
> > > > > multi-level metadata");
> > > > >   // Fetch on a second SingleFileFetcher, 
> > > > > like with archives.
> > > > >   metadata.setSimpleRedirect();
> > > > > - final SingleFileFetcher f = new 
> > > > > SingleFileFetcher(this,
> > > > > persistent,
> > > >
> > > > false, metadata, new MultiLevelMetadataCallback(), ctx, container,
> > > > context);
> > > >
> > > > > - // Clear our own metadata so it can be 
> > > > > garbage collected, it
> > > > > will
> >
> > be
> >
> > > > replaced by whatever is fetched.
> > > >
> > > > > - // The new fetcher has our metadata so 
> > > > > we don't need to
> > > >
> > > > removeMetadata().
> > > >
> > > > > - this.metadata = null;
> > > > > - if(persistent) container.store(this);
> > > > > - if(persistent) container.store(f);
> > > > > -
> > > > > - // We must transition to the 
> > > > > sub-fetcher so that if the request
> > > > > is
> > > >
> > > > cancelled, it will get deleted.
> > > >
> > > > > - parent.onTransition(this, f, container);
> > > > > -
> > > > > - f.wrapHandleMetadata(true, container, 
> > > > > context);
> > > > > - if(persistent) container.deactivate(f, 
> > > > > 1);
> > > > > + continueWithNewMetadata(metadata, new
> > > > > MultiLevelMetadataCallback(),
> > > >
> > > > container, context);
> > > >
> > > > Here we are using the CURRENT metadata to fetch new metadata in order
> > > > to unpack that metadata and use that. These are *two different
> > > > operations*. The latter is fine, but the former is broken. What you
> > > > want to do is
> >
> > simply
> >
> > > > remove the old metadata (if persistent) and set metadata to the new
> > > > metadata, and go back around the loop.
> > >
> > > i got the ARCHIVE_METADATA_REDIRECT basicly working,
> > > but get somewhat working does not allways include i have really
> > > understand
> >
> > the
> >
> > > code i changed. :(
> > >
> > > is it better to revert the continueWithNewMetadata(..) and include the
> > > code directly?
> >
> > Yes:
> > - Revert continueWithNewMetadata and the changes to the constructor and to
> > the section that starts fetching multi-level metadata.
> > - Deal with the new metadata in exactly the same way as
> > MultiLevelMetadataCallback.onSuccess() does: remove the old metadata,
> > substitute the new and call back in to wrapHandleMetadata().
> 
> currently im not able to contribute until im able to serve git.
> i need an (intuitiv) usable git plugin for eclipse or a hg-git bridge?, i 
will 
> use & continue with whatever what comes first. (i hope its the latter.)
> 
> ?) http://github.com/schacon/hg-git

Okay, I will fix these changes locally, especially as we would like to get a 
new stable build out soon.
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/7af49af8/attachment.pgp>


[freenet-dev] [freenet-cvs] r27121 - trunk/freenet/src/freenet/client/async

2009-04-29 Thread Matthew Toseland
 > > > >   if(logMINOR) Logger.minor(this, "Is 
> > > > > multi-level metadata");
> > > > >   // Fetch on a second SingleFileFetcher, 
> > > > > like with archives.
> > > > >   metadata.setSimpleRedirect();
> > > > > - final SingleFileFetcher f = new 
> > > > > SingleFileFetcher(this,
> > > > > persistent,
> > > >
> > > > false, metadata, new MultiLevelMetadataCallback(), ctx, container,
> > > > context);
> > > >
> > > > > - // Clear our own metadata so it can be 
> > > > > garbage collected, it
> > > > > will
> >
> > be
> >
> > > > replaced by whatever is fetched.
> > > >
> > > > > - // The new fetcher has our metadata so 
> > > > > we don't need to
> > > >
> > > > removeMetadata().
> > > >
> > > > > - this.metadata = null;
> > > > > - if(persistent) container.store(this);
> > > > > - if(persistent) container.store(f);
> > > > > -
> > > > > - // We must transition to the 
> > > > > sub-fetcher so that if the request
> > > > > is
> > > >
> > > > cancelled, it will get deleted.
> > > >
> > > > > - parent.onTransition(this, f, container);
> > > > > -
> > > > > - f.wrapHandleMetadata(true, container, 
> > > > > context);
> > > > > - if(persistent) container.deactivate(f, 
> > > > > 1);
> > > > > + continueWithNewMetadata(metadata, new
> > > > > MultiLevelMetadataCallback(),
> > > >
> > > > container, context);
> > > >
> > > > Here we are using the CURRENT metadata to fetch new metadata in order
> > > > to unpack that metadata and use that. These are *two different
> > > > operations*. The latter is fine, but the former is broken. What you
> > > > want to do is
> >
> > simply
> >
> > > > remove the old metadata (if persistent) and set metadata to the new
> > > > metadata, and go back around the loop.
> > >
> > > i got the ARCHIVE_METADATA_REDIRECT basicly working,
> > > but get somewhat working does not allways include i have really
> > > understand
> >
> > the
> >
> > > code i changed. :(
> > >
> > > is it better to revert the continueWithNewMetadata(..) and include the
> > > code directly?
> >
> > Yes:
> > - Revert continueWithNewMetadata and the changes to the constructor and to
> > the section that starts fetching multi-level metadata.
> > - Deal with the new metadata in exactly the same way as
> > MultiLevelMetadataCallback.onSuccess() does: remove the old metadata,
> > substitute the new and call back in to wrapHandleMetadata().
> 
> currently im not able to contribute until im able to serve git.
> i need an (intuitiv) usable git plugin for eclipse or a hg-git bridge?, i 
will 
> use & continue with whatever what comes first. (i hope its the latter.)
> 
> ?) http://github.com/schacon/hg-git

I recommend you just use the command line. Really it's not that hard:

Checkout:

git clone git at github.com:freenet/fred-staging.git

... edit some files ...

Review your changes:
git diff

Commit your changes locally:
git commit

Check for updates:
git pull origin

Commit your changes to the remote server:
git push origin


Alternative update checking procedure for the paranoid:

Fetch the remote repo:
git fetch origin

Inspect the changes:
git log -p master..origin/master

Merge them:
git merge origin/master
OR if your local changes are minor:
git rebase origin/master


Other useful commands include:

View history:
git log

View history with patches and rename detection:
git log -p -M

Lose everything since a specific commit:
git reset [ id of the last good commit ]

Create a branch:
git branch mybranchname

Revert a file:
git checkout filename
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/fbeef868/attachment.pgp>


[freenet-dev] "staging" and "official"

2009-04-29 Thread Matthew Toseland
On Wednesday 29 April 2009 19:52:03 Ian Clarke wrote:
> Are we sure having separate projects for "staging" and "official" in
> github is the right way to organize this?  I don't see any other
> projects on github organized in this way.  Shouldn't they be separate
> branches or something, not entire separate projects?

Security. Anyone with write access (i.e. just about anyone who asks for 
access, whether we trust them or not) can clobber the whole tree or rewrite 
history with a forced (non-fast-forward) update.
> 
> Ian.
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/20fe8e9c/attachment.pgp>


[freenet-dev] "staging" and "official"

2009-04-29 Thread Matthew Toseland
On Wednesday 29 April 2009 20:15:43 xor wrote:
> On Wednesday 29 April 2009 20:52:03 Ian Clarke wrote:
> > Are we sure having separate projects for "staging" and "official" in
> > github is the right way to organize this?  I don't see any other
> > projects on github organized in this way.  Shouldn't they be separate
> > branches or something, not entire separate projects?
> >
> > Ian.
> 
> Mmh yes it is annoying to keep separate projects I guess: For example the 
> build.xml must be corrected for each project:
> 
> - Fred-staging/Fred-official need different build files.

They do? Why?

> - WoT / Freetalk rely on Fred so the project name on which they are 
dependent 
> will not fit depending on whether you have checked out staging or official 
of 
> Fred.

Why is this a problem? Just rename the directory! (Or on a sensible operating 
system use a directory symlink).
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/e28b76db/attachment.pgp>


[freenet-dev] [freenet-cvs] r27121 - trunk/freenet/src/freenet/client/async

2009-04-29 Thread bo-le
Am Mittwoch, 29. April 2009 17:13:11 schrieb Matthew Toseland:
> On Wednesday 29 April 2009 10:39:02 bo-le wrote:
> > Am Mittwoch, 29. April 2009 03:21:00 schrieb Matthew Toseland:
> > > On Monday 20 April 2009 22:21:12 saces at freenetproject.org wrote:
> > > > Author: saces
> > > > Date: 2009-04-20 21:21:11 + (Mon, 20 Apr 2009)
> > > > New Revision: 27121
> > > >
> > > > Modified:
> > > >trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
> > > > Log:
> > > > teach the SFI how to fetch the new metadata format
> > >
> > > (ARCHIVE_METADATA_REDIRECT)
> > >
> > > > needs review
> > >
> > > As requested ... this commit has problems...
> > >
> > > > Modified:
> > > > trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
> > > > ===
> > > > ---
> > > > trunk/freenet/src/freenet/client/async/SingleFileFetcher.java   2009-04
> > > >-20
> > >
> > > 21:16:19 UTC (rev 27120)
> > >
> > > > +++
> > > > trunk/freenet/src/freenet/client/async/SingleFileFetcher.java   2009-04
> > > >-20
> > >
> > > 21:21:11 UTC (rev 27121)
> > >
> > > > @@ -114,7 +114,7 @@
> > > > /** Copy constructor, modifies a few given fields, don't call
> > > > schedule(). * Used for things like slave fetchers for
>
> MultiLevelMetadata,
>
> > > > therefore
> > >
> > > does not remember returnBucket,
> > >
> > > >  * metaStrings etc. */
> > > > -   public SingleFileFetcher(SingleFileFetcher fetcher, boolean
>
> persistent,
>
> > > boolean deleteFetchContext, Metadata newMeta, GetCompletionCallback
> > > callback, FetchContext ctx2, ObjectContainer container, ClientContext
> > > context) throws FetchException {
> > >
> > > > +   public SingleFileFetcher(SingleFileFetcher fetcher, boolean
>
> persistent,
>
> > > boolean deleteFetchContext, Metadata newMeta, ArrayList
> > > metaStrings2, GetCompletionCallback callback, FetchContext ctx2,
> > > ObjectContainer container, ClientContext context) throws FetchException
> > > {
> > >
> > > > // Don't add a block, we have already fetched the data, 
> > > > we are
> > > > just
> > >
> > > handling the metadata in a different fetcher.
> > >
> > > > super(persistent ? fetcher.key.cloneKey() : fetcher.key,
> > >
> > > fetcher.maxRetries, ctx2, fetcher.parent, callback, false, true,
> > > fetcher.token, container, context, deleteFetchContext);
> > >
> > > > if(logMINOR) Logger.minor(this, "Creating 
> > > > SingleFileFetcher
> > >
> > > for "+fetcher.key+" meta="+fetcher.metaStrings.toString(), new
> > > Exception("debug"));
> > >
> > > > @@ -128,7 +128,7 @@
> > > > this.archiveMetadata = null;
> > > > this.clientMetadata = (fetcher.clientMetadata != null ?
> > >
> > > fetcher.clientMetadata.clone() : new ClientMetadata());
> > >
> > > > this.metadata = newMeta;
> > > > -   this.metaStrings = new ArrayList();
> > > > +   this.metaStrings = metaStrings2;
> > >
> > > This should be copied unless you can guarantee that the caller will
> > > always copy it unless nonpersistent.
> > >
> > > > this.addedMetaStrings = 0;
> > > > this.recursionLevel = fetcher.recursionLevel + 1;
> > > > if(recursionLevel > ctx.maxRecursionLevel)
> > > > @@ -471,6 +471,83 @@
> > > > }
> > > > metadataBucket.free();
> > > > continue;
> > > > +   } else if(metadata.isArchiveMetadataRedirect()) 
> > > > {
> > > > +   if(logMINOR) Logger.minor(this, "Is 
> > > > archive-metadata");
> > > > +   // Fetch it from the archive
> > > > +   if(ah == null)
> > > > +   throw new 
> > > > FetchException(FetchException.UNKNOWN_METADATA,
> > > > "Archive
> > >
> > > redirect not in an archive manifest");
> > >
> > > > +   String filename = 
> > > > metadata.getArchiveInternalName();
> > > > +   if(logMINOR) Logger.minor(this, 
> > > > "Fetching "+filename);
> > > > +   Bucket dataBucket = ah.get(filename, 
> > > > actx,
> > > > context.archiveManager); +  if(dataBucket 
> > > > != null) {
> > > > +   if(logMINOR) Logger.minor(this, 
> > > > "Returning data");
> > > > +   final Metadata newMetadata;
> > > > +   try {
> > > > +
> > > > +   newMetadata = 
> > > > Metadata.construct(dataBucket);
> > > > +   dataBucket.free();
> > > > +   } catch (IOException e) {
> > > > + 

[freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread bbac...@googlemail.com
> Be warned that if you use the puttygen program to create your keypair
> you probably need to reformat the .pub file before uploading.

Can you please tell me more about   reformat the .pub file before uploading.

;)

On Tue, Apr 28, 2009 at 13:44, Ed Tomlinson  wrote:
> On Tuesday 28 April 2009 01:24:16 bbackde at googlemail.com wrote:
>> On Tue, Apr 28, 2009 at 03:08, Daniel Cheng  
>> wrote:
>> > Okay, after reading the irc log, i guess i know what's happending here.
>> >
>> > You have to generate a ssh-key using ? `ssh-keygen` and upload your
>> > *.pub file to your github account.
>>
>> It seems as I will run into some trouble because I use Windows and all
>> those nifty tools and howtos are for Linux
>> It will take some time until I can continue to contribute code :(
>> Even the egit eclipse plugin often hangs during checkout on my box.
>> ___
>> Devl mailing list
>> Devl at freenetproject.org
>> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>
> If you want a good command line ssh client for windows look at putty.
> Be warned that if you use the puttygen program to create your keypair
> you probably need to reformat the .pub file before uploading.
>
> Ed
> ___
> Devl mailing list
> Devl at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>



-- 
__
GnuPG key:   (0x48DBFA8A)
Keyserver:   pgpkeys.pca.dfn.de
Fingerprint:
477D F057 1BD4 1AE7 8A54 8679 6690 E2EC 48DB FA8A
__



[freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread Thomas Sachau
freenetwork at web.de schrieb:
> Well, I felt kind of sorry to see the project move away from SVN.
> I've got good results with SVN; I use it for my home projects, at work,
> have contact to other SVN-users, etc.
> And it has that wonderful TortoiseSVN Windoze-Explorer-Extension.
> 
> What I found out, now that the shift to git has happened, is that
> there's a Tortoise-* clone for git, too!
> I wonder how it will perform from a SVN-user's point of view.
> 
> So maybe this could help you: http://code.google.com/p/tortoisegit/
> 
> BTW - where can I find the official git repository again?... How to
> fetch development from others? or is there a head where all patches go
> into like it was with SVN head?

You can find all repos at github.com/freenet.
-official repos will contain reviewed patches and commits of trusted devs
-staging repos will contain patches from other devs and may not be reviewed at 
every time
-if a dev maintains his own repo, you may need to fetch it, if you want his 
changes

-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 315 bytes
Desc: OpenPGP digital signature
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/61e37773/attachment.pgp>


[freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread xor
On Wednesday 29 April 2009 18:47:57 Juiceman wrote:
> On Wed, Apr 29, 2009 at 6:34 AM, xor  wrote:
> > On Tue, 2009-04-28 at 08:32 +0800, Daniel Cheng wrote:
> >> On Tue, Apr 28, 2009 at 6:11 AM, xor  wrote:
> >> > Hi,
> >> >
> >> > I've been trying to set up my IDE to work with git and found the
> >> > following one:
> >> >
> >> > http://www.jgit.org/
> >> >
> >> > It pulls, it diffs, everything, but push won't work:
> >> > "Can't connect to any URI: git://github.com/freenet/fred-staging.git
> >> > (Transport error occured during push operation: Protocol error:
> >> > expected LF)"
> >> >
> >> > Notice that I did not specify the git:// URI when fetching the
> >> > repository, I used the git@ one and enabled git+ssh.
> >>
> >> try to fix this in command line:
> >>
> >> $ cd fred
> >> $ git remote show
> >>
> >> this should show your current git remote detail, that is the git:// uri.
> >> If it is wrong, you can fix it with:
> >>
> >> $ git remote rm original
> >> $ git remote add original  git at github.com:freenet/fred-staging.git
> >>
> >> then go to eclipse and try again
> >
> > As I've said, I *did* specify the correct URI when creating the
> > repository. "get remote show origin -n" says the URI is:
> > git+ssh://git at github.com/freenet/fred-staging.git
>
> The correct URL is
> git at github.com:freenet/fred-staging.git   not
> git at github.com/freenet/fred-staging.git  (see the : ?)
>
> I repeat this because this is the first problem I had.

And I repeat that
git+ssh://git at github.com/freenet/fred-staging.git

is just another representation of the correct URI which tells the client that 
it shall use SSH.
If I enter the "git at github.com:freenet/fred-staging.git" URI then eclipsegit
auto-changes it to the URI which I told you.


-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/639bff36/attachment.pgp>


[freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread freenetw...@web.de
Well, I felt kind of sorry to see the project move away from SVN.
I've got good results with SVN; I use it for my home projects, at work,
have contact to other SVN-users, etc.
And it has that wonderful TortoiseSVN Windoze-Explorer-Extension.

What I found out, now that the shift to git has happened, is that
there's a Tortoise-* clone for git, too!
I wonder how it will perform from a SVN-user's point of view.

So maybe this could help you: http://code.google.com/p/tortoisegit/

BTW - where can I find the official git repository again?... How to
fetch development from others? or is there a head where all patches go
into like it was with SVN head?


bbackde at googlemail.com wrote:
> I have no problem with commits and updates from the command line.
> But when it comes to compare tasks (what was changed, what did I change
> compared to the HEAD, or to any other revision), then I really prefer Eclipse.
>
> If you like the command line, ok. But if I can't work with git using
> my prefered IDE,
> then I have a problem. I don't want to change anything just because you 
> decided
> to switch to some SCM that is mostly used by command line freaks ^^
>
> So I will fiddle with the Eclipse plugin, and if I fail I have to
> decide how to proceed...
>
> I fear that git could discourage some part-time devs from contributing
> to freenet.
> But I agree that some other devs might love git.
>
> On Wed, Apr 29, 2009 at 16:09, Ian Clarke  wrote:
>   
>> On Wed, Apr 29, 2009 at 5:38 AM, xor  wrote:
>> 
>>> I consider learning command line usage for stuff for which a GUI can be
>>> used as a waste of my personal lifetime and will not do so, I'd rather
>>> sit in the sun or listen to music or hang out with friends or whatever.
>>>   
>> Well, you are wrong.  If you made the effort to become proficient with
>> the command line you might find you have more time for listening to
>> music or hanging out with friends.  The command line remains the most
>> efficient way to do many things.  For example, I use a mac and I find
>> that stuff like moving files around is much more efficient with the
>> command line than with Finder, the Mac's file manager.
>>
>> Perhaps some day someone will invent a gui with the power, efficiency,
>> and flexibility of the command line, but it hasn't happened yet.
>>
>> Ian.
>>
>> --
>> Ian Clarke
>> CEO, Uprizer Labs
>> Email: ian at uprizer.com
>> Ph: +1 512 422 3588
>> Fax: +1 512 276 6674
>> ___
>> Devl mailing list
>> Devl at freenetproject.org
>> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>>
>> 
>
>
>
>   



[freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread xor
On Wed, 2009-04-29 at 09:48 -0500, Ian Clarke wrote:
> On Apr 29, 2009, at 9:37 AM, bbackde at googlemail.com wrote:
> 
> > I have no problem with commits and updates from the command line.
> > But when it comes to compare tasks (what was changed, what did I  
> > change
> > compared to the HEAD, or to any other revision), then I really  
> > prefer Eclipse.

That is exactly my point! I compare source very very often, it is > 70%
of the usage-time of version-control related software.

> 
> There are nice GUI tools for that, like gitk or gitx on the mac.  I  
> agree that diffs are easier with a GUI tool (I never said command line  
> was best for everything!)

Well there is no use in having a nice GUI if it is not integrated into
the IDE. The diff tool of Eclipse provides syntax highlighting,
auto-completion, javadoc and every other fancy stuff which Eclipse can
do. You cannot have that in a standalone git GUI. Further, using another
GUI besides Eclipse also eats time. It has to be configured, to be
maintained, to be started and you always have to switch to it. This
sucks :| Not to mention that you will not get the java-related
features...

Anyway, there is the git plugin for eclipse but it seems to be buggy. 
Currently I cannot push to the repository, I will check whether it works
with the new build which they released today or so.
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/5d2ecd10/attachment.pgp>


[freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread xor
On Wed, 2009-04-29 at 23:09 +0800, Daniel Cheng wrote:
> On Wed, Apr 29, 2009 at 6:35 PM, xor  wrote:
> > On Tue, 2009-04-28 at 09:08 +0800, Daniel Cheng wrote:
> >> Okay, after reading the irc log, i guess i know what's happending here.
> >>
> >> You have to generate a ssh-key using   `ssh-keygen` and upload your
> >> *.pub file to your github account.
> >
> > I did do that when creating my account, thats not the problem.
> >
> 
> The IRC log say you have entered the github password.
> You shouldn't have to do that.
> That's why I think you have missed the ssh key.

That was before I figured out that I have to enter the ssh key and I
*did* enter it.

> When it ask for username, enter "git", no password.
> your ssh-key should place in ~/.ssh/ as the default location.
> ___
> Devl mailing list
> Devl at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/2cd24fe7/attachment.pgp>


[freenet-dev] SVN repository archive

2009-04-29 Thread bbac...@googlemail.com
Started all 4 together, got the big one in 1 hour 5 minutes.
.sig and .sha256 took 1 minute, and .sha1 took 25 minutes.

On Wed, Apr 29, 2009 at 15:10, Matthew Toseland
 wrote:
> Please fetch and archive the following files, anyone who can. This is the SVN
> repository dump at the time of the migration (you can use it by creating an
> svn repo and then doing svn import, if you so desire). Everyone will have a
> copy of the git repository, but it may not have full history; it is a good
> idea to archive the SVN repo as well.
>
> http://127.0.0.1:/CHK at 
> TLozax5PHpYKPR26jW0IGPTn70qgJkC~t59QwNjHQGA,meHKwt1sWbCxc-jtVgF~wrI8TO5bzQvKXJ6hxbhBCXs,AAIC--8/freenet.svn-repository.dump
> http://127.0.0.1:/CHK at 
> hn3N2eACEE-MzJLtdE6XVxtk2te1KTURIrT~5BNxb98,irLRe2jXsjBWuoQ03bliOofvygo80iLB8V4Owbe7nrU,AAIC--8/freenet.svn-repository.dump.sha1
> http://127.0.0.1:/CHK at 
> qpuTUCX~hHEQA7uegljDsXKqECQnKlLTLE5JADKXwQg,GnWPmKQhnTLIok70UyA0TJdoXQ8QHwFqxy2qj6RQCd0,AAIC--8/freenet.svn-repository.dump.sha256
> http://127.0.0.1:/CHK at 
> 7UOfxspTlnZ7rFhUab38nKuQh3zd6~kF7WkwxrXf6DM,pTjksYXpuFNRixZ1Zw1UN66HZ0vcyRAGw5A0a~qdtL8,AAIC--8/freenet.svn-repository.dump.sig
>
> I am also curious how long it takes to fetch it, so let me know.
>
> The first file is 281MB, the others are hundreds of bytes or less. The last is
> a detached signature with my key.
>
> ___
> Devl mailing list
> Devl at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>



-- 
__
GnuPG key:   (0x48DBFA8A)
Keyserver:   pgpkeys.pca.dfn.de
Fingerprint:
477D F057 1BD4 1AE7 8A54 8679 6690 E2EC 48DB FA8A
__



[freenet-dev] [freenet-cvs] r27197 - trunk/freenet/src/freenet/crypt

2009-04-29 Thread Matthew Toseland
byte[seed.length];
> - System.arraycopy(seed, 0, obuf, 0, seed.length);
> - int pos = seed.length-1;
> - while(pos >= 0) {
> - byte b = (byte) (obuf[pos] + 1);
> - obuf[pos] = b;
> - if(b != 0) return obuf;
> - pos--;
> - }
> - return obuf;
> - }
> -
> - public static boolean isPrime(BigInteger b) {
> - if(BigInteger.ONE.compareTo(b) > -1)
> - throw new IllegalArgumentException("Can't be a prime 
> number!");
> - for(int i = 0; i < smallPrimes.length; i++) {
> - if(b.mod(smallPrimes[i]).equals(BigInteger.ZERO))
> - return false;
> - }
> - // FIPS 186-2 recommends 2^100:1 confidence
> -return b.isProbablePrime(200);
> -}
> -
> -}
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/695fb07c/attachment.pgp>


[freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread bbac...@googlemail.com
I have no problem with commits and updates from the command line.
But when it comes to compare tasks (what was changed, what did I change
compared to the HEAD, or to any other revision), then I really prefer Eclipse.

If you like the command line, ok. But if I can't work with git using
my prefered IDE,
then I have a problem. I don't want to change anything just because you decided
to switch to some SCM that is mostly used by command line freaks ^^

So I will fiddle with the Eclipse plugin, and if I fail I have to
decide how to proceed...

I fear that git could discourage some part-time devs from contributing
to freenet.
But I agree that some other devs might love git.

On Wed, Apr 29, 2009 at 16:09, Ian Clarke  wrote:
> On Wed, Apr 29, 2009 at 5:38 AM, xor  wrote:
>> I consider learning command line usage for stuff for which a GUI can be
>> used as a waste of my personal lifetime and will not do so, I'd rather
>> sit in the sun or listen to music or hang out with friends or whatever.
>
> Well, you are wrong. ?If you made the effort to become proficient with
> the command line you might find you have more time for listening to
> music or hanging out with friends. ?The command line remains the most
> efficient way to do many things. ?For example, I use a mac and I find
> that stuff like moving files around is much more efficient with the
> command line than with Finder, the Mac's file manager.
>
> Perhaps some day someone will invent a gui with the power, efficiency,
> and flexibility of the command line, but it hasn't happened yet.
>
> Ian.
>
> --
> Ian Clarke
> CEO, Uprizer Labs
> Email: ian at uprizer.com
> Ph: +1 512 422 3588
> Fax: +1 512 276 6674
> ___
> Devl mailing list
> Devl at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>



-- 
__
GnuPG key:   (0x48DBFA8A)
Keyserver:   pgpkeys.pca.dfn.de
Fingerprint:
477D F057 1BD4 1AE7 8A54 8679 6690 E2EC 48DB FA8A
__



[freenet-dev] [freenet-cvs] r27137 - trunk/freenet/src/freenet/support/io

2009-04-29 Thread Matthew Toseland
On Wednesday 29 April 2009 02:58:48 Daniel Cheng wrote:
> On Wed, Apr 29, 2009 at 9:21 AM, Matthew Toseland
>  wrote:
> > On Tuesday 21 April 2009 08:55:53 j16sdiz at freenetproject.org wrote:
> >> Author: j16sdiz
> >> Date: 2009-04-21 07:55:52 + (Tue, 21 Apr 2009)
> >> New Revision: 27137
> >>
> >> Modified:
> >> ? ?trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
> >> Log:
> >> Fix inputStream count
> >
> > What's the difference? Apart from your version breaks on an OOM and the
> > previous version didn't?
> 
> 
> If you close it twice, the counter get decreased twice.

Doh! But why the inputStreams inc move?
> 
> >>
> >> Modified: 
trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
> >> ===
> >> --- trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
> > 2009-04-21 07:55:31 UTC (rev 27136)
> >> +++ trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
> > 2009-04-21 07:55:52 UTC (rev 27137)
> >> @@ -75,17 +75,15 @@
> >> ? ? ? public InputStream getInputStream() throws IOException {
> >> ? ? ? ? ? ? ? if(freed) throw new IOException("Already freed");
> >> ? ? ? ? ? ? ? final FileChannel channel = factory.channel;
> >> +
> >> + ? ? ? ? ? ? synchronized(PersistentBlobTempBucket.this) {
> >> + ? ? ? ? ? ? ? ? ? ? inputStreams++;
> >> + ? ? ? ? ? ? }
> >> +
> >> ? ? ? ? ? ? ? return new InputStream() {
> >> -
> >> ? ? ? ? ? ? ? ? ? ? ? private int offset;
> >> ? ? ? ? ? ? ? ? ? ? ? private boolean closed;
> >>
> >> - ? ? ? ? ? ? ? ? ? ? {
> >> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? synchronized(PersistentBlobTempBucket.this) 
{
> >> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? inputStreams++;
> >> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
> >> - ? ? ? ? ? ? ? ? ? ? }
> >> -
> >> ? ? ? ? ? ? ? ? ? ? ? @Override
> >> ? ? ? ? ? ? ? ? ? ? ? public int read() throws IOException {
> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if (closed) throw new 
IOException("closed");
> >> @@ -130,6 +128,7 @@
> >>
> >> ? ? ? ? ? ? ? ? ? ? ? @Override
> >> ? ? ? ? ? ? ? ? ? ? ? public void close() {
> >> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? if (closed) return;
> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? closed = true;
> >>
> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? synchronized(PersistentBlobTempBucket.this) 
{
> >>
> >> ___
> >> cvs mailing list
> >> cvs at freenetproject.org
> >> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
> >>
> >>
> >
> >
> >
> > ___
> > Devl mailing list
> > Devl at freenetproject.org
> > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
> >
> ___
> Devl mailing list
> Devl at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
> 
> 


-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/26aaf0f8/attachment.pgp>


[freenet-dev] [freenet-cvs] r27121 - trunk/freenet/src/freenet/client/async

2009-04-29 Thread Matthew Toseland
a;
> > > + try {
> > > +
> > > + newMetadata = 
> > > Metadata.construct(dataBucket);
> > > + dataBucket.free();
> > > + } catch (IOException e) {
> > > + throw new 
> > > FetchException(FetchException.BUCKET_ERROR);
> > > + }
> > > + continueWithNewMetadata(newMetadata, 
> > > this.rcb, container, 
context);
> > > + return;
> > > + } else {
> > > + if(logMINOR) Logger.minor(this, 
> > > "Fetching archive
> >
> > (thisKey="+thisKey+ ')');
> >
> > > + // Metadata cannot contain pointers to 
> > > files which don't exist.
> > > + // We enforce this in ArchiveHandler.
> > > + // Therefore, the archive needs to be 
> > > fetched.
> > > + final boolean persistent = 
> > > this.persistent;
> > > + fetchArchive(true, archiveMetadata, 
> > > filename, new
> >
> > ArchiveExtractCallback() {
> >
> > > + public void gotBucket(Bucket 
> > > data, ObjectContainer container,
> >
> > ClientContext context) {
> >
> > > + if(persistent)
> > > + 
> > > container.activate(SingleFileFetcher.this, 1);
> > > + if(logMINOR) 
> > > Logger.minor(this, "Returning data");
> > > + final Metadata 
> > > newMetadata;
> > > + try {
> > > +
> > > + newMetadata = 
> > > Metadata.construct(data);
> > > + 
> > > continueWithNewMetadata(newMetadata, 
SingleFileFetcher.this.rcb,
> >
> > container, context);
> >
> > Here we are using the metadata we have just fetched as new metadata.
> > ...
> >
> > > @@ -576,18 +653,7 @@
> > >   if(logMINOR) Logger.minor(this, "Is multi-level 
> > > metadata");
> > >   // Fetch on a second SingleFileFetcher, like 
> > > with archives.
> > >   metadata.setSimpleRedirect();
> > > - final SingleFileFetcher f = new 
> > > SingleFileFetcher(this, persistent,
> >
> > false, metadata, new MultiLevelMetadataCallback(), ctx, container,
> > context);
> >
> > > - // Clear our own metadata so it can be garbage 
> > > collected, it will 
be
> >
> > replaced by whatever is fetched.
> >
> > > - // The new fetcher has our metadata so we don't 
> > > need to
> >
> > removeMetadata().
> >
> > > - this.metadata = null;
> > > - if(persistent) container.store(this);
> > > - if(persistent) container.store(f);
> > > -
> > > - // We must transition to the sub-fetcher so 
> > > that if the request is
> >
> > cancelled, it will get deleted.
> >
> > > - parent.onTransition(this, f, container);
> > > -
> > > - f.wrapHandleMetadata(true, container, context);
> > > - if(persistent) container.deactivate(f, 1);
> > > + continueWithNewMetadata(metadata, new 
> > > MultiLevelMetadataCallback(),
> >
> > container, context);
> >
> > Here we are using the CURRENT metadata to fetch new metadata in order to
> > unpack that metadata and use that. These are *two different operations*.
> > The latter is fine, but the former is broken. What you want to do is 
simply
> > remove the old metadata (if persistent) and set metadata to the new
> > metadata, and go back around the loop.
> 
> i got the ARCHIVE_METADATA_REDIRECT basicly working, 
> but get somewhat working does not allways include i have really understand 
the 
> code i changed. :(
> 
> is it better to revert the continueWithNewMetadata(..) and include the code 
> directly?

Yes:
- Revert continueWithNewMetadata and the changes to the constructor and to the 
section that starts fetching multi-level metadata.
- Deal with the new metadata in exactly the same way as  
MultiLevelMetadataCallback.onSuccess() does: remove the old metadata, 
substitute the new and call back in to wrapHandleMetadata().
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/5b0381d2/attachment.pgp>


[freenet-dev] "staging" and "official"

2009-04-29 Thread Ian Clarke
On Wed, Apr 29, 2009 at 2:38 PM, Matthew Toseland
 wrote:
> On Wednesday 29 April 2009 19:52:03 Ian Clarke wrote:
>> Are we sure having separate projects for "staging" and "official" in
>> github is the right way to organize this? ?I don't see any other
>> projects on github organized in this way. ?Shouldn't they be separate
>> branches or something, not entire separate projects?
>
> Security. Anyone with write access (i.e. just about anyone who asks for
> access, whether we trust them or not) can clobber the whole tree or rewrite
> history with a forced (non-fast-forward) update.

Are you sure there is no way to limit access on a per-branch basis?
Have you asked on #github or #git on freenode?

This seems inelegant.

Ian.

-- 
Ian Clarke
CEO, Uprizer Labs
Email: ian at uprizer.com
Ph: +1 512 422 3588
Fax: +1 512 276 6674



[freenet-dev] SVN repository archive

2009-04-29 Thread Matthew Toseland
Please fetch and archive the following files, anyone who can. This is the SVN 
repository dump at the time of the migration (you can use it by creating an 
svn repo and then doing svn import, if you so desire). Everyone will have a 
copy of the git repository, but it may not have full history; it is a good 
idea to archive the SVN repo as well.

http://127.0.0.1:/CHK at 
TLozax5PHpYKPR26jW0IGPTn70qgJkC~t59QwNjHQGA,meHKwt1sWbCxc-jtVgF~wrI8TO5bzQvKXJ6hxbhBCXs,AAIC--8/freenet.svn-repository.dump
http://127.0.0.1:/CHK at 
hn3N2eACEE-MzJLtdE6XVxtk2te1KTURIrT~5BNxb98,irLRe2jXsjBWuoQ03bliOofvygo80iLB8V4Owbe7nrU,AAIC--8/freenet.svn-repository.dump.sha1
http://127.0.0.1:/CHK at 
qpuTUCX~hHEQA7uegljDsXKqECQnKlLTLE5JADKXwQg,GnWPmKQhnTLIok70UyA0TJdoXQ8QHwFqxy2qj6RQCd0,AAIC--8/freenet.svn-repository.dump.sha256
http://127.0.0.1:/CHK at 
7UOfxspTlnZ7rFhUab38nKuQh3zd6~kF7WkwxrXf6DM,pTjksYXpuFNRixZ1Zw1UN66HZ0vcyRAGw5A0a~qdtL8,AAIC--8/freenet.svn-repository.dump.sig

I am also curious how long it takes to fetch it, so let me know.

The first file is 281MB, the others are hundreds of bytes or less. The last is 
a detached signature with my key.
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/70ce2375/attachment.pgp>


[freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread Arne Babenhauserheide
Am Mittwoch 29 April 2009 12:38:15 schrieb xor:
> We're in 2009 and graphical IDEs ought to be able to do the revision
> control, if that does not work then the wrong revision control system or
> IDE is being used. It is really not like revision control is something
> new, it has to be possible with GUI, it's been there for ages!

I'm currently walking the opposite direction: I find myself using TortoiseHG 
more and more instead of Mercurial at the command line, and I find that I am 
far more productive that way. 

Partial commits are far more efficient, when you can just select the hunks 
graphically, and a quick look at the history graph makes the log become much 
clearer in an instant. 

A GUI has the advantage, that it uses more of the perception and interaction 
capabilities of its user. Most of us are visually oriented, and our visual 
processing capability is far higher than our text processing. 

Best wishes, 
Arne

--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- 
   - singing a part of the history of free software -
  http://infinite-hands.draketo.de
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/c8ebdb0e/attachment.pgp>


[freenet-dev] "staging" and "official"

2009-04-29 Thread Ian Clarke
Are we sure having separate projects for "staging" and "official" in
github is the right way to organize this?  I don't see any other
projects on github organized in this way.  Shouldn't they be separate
branches or something, not entire separate projects?

Ian.

-- 
Ian Clarke
CEO, Uprizer Labs
Email: ian at uprizer.com
Ph: +1 512 422 3588
Fax: +1 512 276 6674



[freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread Juiceman
On Wed, Apr 29, 2009 at 6:34 AM, xor  wrote:
> On Tue, 2009-04-28 at 08:32 +0800, Daniel Cheng wrote:
>> On Tue, Apr 28, 2009 at 6:11 AM, xor  wrote:
>> >
>> > Hi,
>> >
>> > I've been trying to set up my IDE to work with git and found the
>> > following one:
>> >
>> > http://www.jgit.org/
>> >
>> > It pulls, it diffs, everything, but push won't work:
>> > "Can't connect to any URI: git://github.com/freenet/fred-staging.git
>> > (Transport error occured during push operation: Protocol error: expected
>> > LF)"
>> >
>> > Notice that I did not specify the git:// URI when fetching the
>> > repository, I used the git@ one and enabled git+ssh.
>>
>> try to fix this in command line:
>>
>> $ cd fred
>> $ git remote show
>>
>> this should show your current git remote detail, that is the git:// uri.
>> If it is wrong, you can fix it with:
>>
>> $ git remote rm original
>> $ git remote add original ?git at github.com:freenet/fred-staging.git
>>
>> then go to eclipse and try again
>
> As I've said, I *did* specify the correct URI when creating the
> repository. "get remote show origin -n" says the URI is:
> git+ssh://git at github.com/freenet/fred-staging.git

The correct URL is
git at github.com:freenet/fred-staging.git   not
git at github.com/freenet/fred-staging.git  (see the : ?)

I repeat this because this is the first problem I had.

> which is the one I specified when creating the repository and which
> seems correct to me because it uses the "git@" part.



-- 
I may disagree with what you have to say, but I shall defend, to the
death, your right to say it. - Voltaire
Those who would give up Liberty, to purchase temporary Safety, deserve
neither Liberty nor Safety. - Ben Franklin



[freenet-dev] Plugins and forced updates

2009-04-29 Thread xor
On Tue, 2009-04-28 at 18:29 +0100, Matthew Toseland wrote:
> 
> One exception: Freetalk does not currently build because of what seems to be 
> an unrelated compile error.

Yes, I have missed a file in my last commit to the SVN, I will commit it
as soon as git pushing works for me. I'm sorry.
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/9b979032/attachment.pgp>


[freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread xor
On Tue, 2009-04-28 at 12:47 -0500, Ian Clarke wrote:
> I know some people are religiously opposed to using the command-line
> git client, but I think those people are mistaken.  I used to think
> that I couldn't survive without Subclipse, but when I migrated to git
> I thought I'd bite the bullet and use the command line.
> 
> I quickly grew accustomed to it, and especially with stuff like git
> bash completion (http://budurl.com/8gyy), and some bash prompt magic
> (http://budurl.com/e6ma), I've found I'm very productive at the
> command line.
> 
> I now have little desire to switch back to a gui source control tool.
> 
> Ian.
> 

I consider learning command line usage for stuff for which a GUI can be
used as a waste of my personal lifetime and will not do so, I'd rather
sit in the sun or listen to music or hang out with friends or whatever.

We're in 2009 and graphical IDEs ought to be able to do the revision
control, if that does not work then the wrong revision control system or
IDE is being used. It is really not like revision control is something
new, it has to be possible with GUI, it's been there for ages!
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/e31940b6/attachment.pgp>


[freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread xor
On Tue, 2009-04-28 at 09:08 +0800, Daniel Cheng wrote:
> Okay, after reading the irc log, i guess i know what's happending here.
> 
> You have to generate a ssh-key using   `ssh-keygen` and upload your
> *.pub file to your github account.

I did do that when creating my account, thats not the problem.


-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/06a88696/attachment.pgp>


[freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread xor
On Tue, 2009-04-28 at 08:32 +0800, Daniel Cheng wrote:
> On Tue, Apr 28, 2009 at 6:11 AM, xor  wrote:
> >
> > Hi,
> >
> > I've been trying to set up my IDE to work with git and found the
> > following one:
> >
> > http://www.jgit.org/
> >
> > It pulls, it diffs, everything, but push won't work:
> > "Can't connect to any URI: git://github.com/freenet/fred-staging.git
> > (Transport error occured during push operation: Protocol error: expected
> > LF)"
> >
> > Notice that I did not specify the git:// URI when fetching the
> > repository, I used the git@ one and enabled git+ssh.
> 
> try to fix this in command line:
> 
> $ cd fred
> $ git remote show
> 
> this should show your current git remote detail, that is the git:// uri.
> If it is wrong, you can fix it with:
> 
> $ git remote rm original
> $ git remote add original  git at github.com:freenet/fred-staging.git
> 
> then go to eclipse and try again

As I've said, I *did* specify the correct URI when creating the
repository. "get remote show origin -n" says the URI is:
git+ssh://git at github.com/freenet/fred-staging.git

which is the one I specified when creating the repository and which
seems correct to me because it uses the "git@" part.
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/d3d7678c/attachment.pgp>


[freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread xor
On Mon, 2009-04-27 at 18:15 -0400, Juiceman wrote: 
> On Mon, Apr 27, 2009 at 6:11 PM, xor  wrote:
> >
> > Hi,
> >
> > I've been trying to set up my IDE to work with git and found the
> > following one:
> >
> > http://www.jgit.org/
> >
> > It pulls, it diffs, everything, but push won't work:
> > "Can't connect to any URI: git://github.com/freenet/fred-staging.git
> > (Transport error occured during push operation: Protocol error: expected
> > LF)"
> >
> > Notice that I did not specify the git:// URI when fetching the
> > repository, I used the git@ one and enabled git+ssh.
> >
> > Does anyone know of an alternative git plugin for eclipse which is more
> > stable?
> >
> > Greetings, xor
> >
> > ___
> > Devl mailing list
> > Devl at freenetproject.org
> > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
> >
> 
> Make sure you use git at github.com:freenet/fred-staging.git  (Note the colon)
> 

Quote of myself:

> Notice that I did not specify the git:// URI when fetching the
> repository, I used the git@ one and enabled git+ssh.

-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/3cb16ded/attachment.pgp>


[freenet-dev] [freenet-cvs] r27121 - trunk/freenet/src/freenet/client/async

2009-04-29 Thread bo-le
Am Mittwoch, 29. April 2009 03:21:00 schrieb Matthew Toseland:
> On Monday 20 April 2009 22:21:12 saces at freenetproject.org wrote:
> > Author: saces
> > Date: 2009-04-20 21:21:11 + (Mon, 20 Apr 2009)
> > New Revision: 27121
> >
> > Modified:
> >trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
> > Log:
> > teach the SFI how to fetch the new metadata format
>
> (ARCHIVE_METADATA_REDIRECT)
>
> > needs review
>
> As requested ... this commit has problems...
>
> > Modified: trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
> > ===
> > ---
> > trunk/freenet/src/freenet/client/async/SingleFileFetcher.java   
> > 2009-04-20
>
> 21:16:19 UTC (rev 27120)
>
> > +++
> > trunk/freenet/src/freenet/client/async/SingleFileFetcher.java   
> > 2009-04-20
>
> 21:21:11 UTC (rev 27121)
>
> > @@ -114,7 +114,7 @@
> > /** Copy constructor, modifies a few given fields, don't call
> > schedule(). * Used for things like slave fetchers for MultiLevelMetadata,
> > therefore
>
> does not remember returnBucket,
>
> >  * metaStrings etc. */
> > -   public SingleFileFetcher(SingleFileFetcher fetcher, boolean persistent,
>
> boolean deleteFetchContext, Metadata newMeta, GetCompletionCallback
> callback, FetchContext ctx2, ObjectContainer container, ClientContext
> context) throws FetchException {
>
> > +   public SingleFileFetcher(SingleFileFetcher fetcher, boolean persistent,
>
> boolean deleteFetchContext, Metadata newMeta, ArrayList
> metaStrings2, GetCompletionCallback callback, FetchContext ctx2,
> ObjectContainer container, ClientContext context) throws FetchException {
>
> > // Don't add a block, we have already fetched the data, we are 
> > just
>
> handling the metadata in a different fetcher.
>
> > super(persistent ? fetcher.key.cloneKey() : fetcher.key,
>
> fetcher.maxRetries, ctx2, fetcher.parent, callback, false, true,
> fetcher.token, container, context, deleteFetchContext);
>
> > if(logMINOR) Logger.minor(this, "Creating SingleFileFetcher
>
> for "+fetcher.key+" meta="+fetcher.metaStrings.toString(), new
> Exception("debug"));
>
> > @@ -128,7 +128,7 @@
> > this.archiveMetadata = null;
> > this.clientMetadata = (fetcher.clientMetadata != null ?
>
> fetcher.clientMetadata.clone() : new ClientMetadata());
>
> > this.metadata = newMeta;
> > -   this.metaStrings = new ArrayList();
> > +   this.metaStrings = metaStrings2;
>
> This should be copied unless you can guarantee that the caller will always
> copy it unless nonpersistent.
>
> > this.addedMetaStrings = 0;
> > this.recursionLevel = fetcher.recursionLevel + 1;
> > if(recursionLevel > ctx.maxRecursionLevel)
> > @@ -471,6 +471,83 @@
> > }
> > metadataBucket.free();
> > continue;
> > +   } else if(metadata.isArchiveMetadataRedirect()) {
> > +   if(logMINOR) Logger.minor(this, "Is 
> > archive-metadata");
> > +   // Fetch it from the archive
> > +   if(ah == null)
> > +   throw new 
> > FetchException(FetchException.UNKNOWN_METADATA, "Archive
>
> redirect not in an archive manifest");
>
> > +   String filename = 
> > metadata.getArchiveInternalName();
> > +   if(logMINOR) Logger.minor(this, "Fetching 
> > "+filename);
> > +   Bucket dataBucket = ah.get(filename, actx, 
> > context.archiveManager);
> > +   if(dataBucket != null) {
> > +   if(logMINOR) Logger.minor(this, 
> > "Returning data");
> > +   final Metadata newMetadata;
> > +   try {
> > +
> > +   newMetadata = 
> > Metadata.construct(dataBucket);
> > +   dataBucket.free();
> > +   } catch (IOException e) {
> > +   throw new 
> > FetchException(FetchException.BUCKET_ERROR);
> > +   }
> > +   continueWithNewMetadata(newMetadata, 
> > this.rcb, container, context);
> > +   return;
> > +   } else {
> > +   if(logMINOR) Logger.minor(this, 
> > "Fetching archive
>
> (thisKey="+thisKey+ ')');
>
> > +   // Metadata cannot contain pointers to 
> > files which don't exist.
> > +   // We enforce this in ArchiveHandler.
> > +   // Therefore, the archive needs to be 
> > fetched.
> > + 

[freenet-dev] [freenet-cvs] r27153 - trunk/freenet/src/freenet/client/async

2009-04-29 Thread bo-le
Am Mittwoch, 29. April 2009 03:20:48 schrieb Matthew Toseland:
> On Tuesday 21 April 2009 15:16:55 saces at freenetproject.org wrote:
> > Author: saces
> > Date: 2009-04-21 14:16:55 + (Tue, 21 Apr 2009)
> > New Revision: 27153
> >
> > Modified:
> >trunk/freenet/src/freenet/client/async/BaseManifestPutter.java
> > Log:
> > indent: add comments
> >
> > Modified: trunk/freenet/src/freenet/client/async/BaseManifestPutter.java
> > ===
> > --- trunk/freenet/src/freenet/client/async/BaseManifestPutter.java
>
> 2009-04-21 12:45:14 UTC (rev 27152)
>
> > +++ trunk/freenet/src/freenet/client/async/BaseManifestPutter.java
>
> 2009-04-21 14:16:55 UTC (rev 27153)
>
> > @@ -1,3 +1,6 @@
> > +/* This code is part of Freenet. It is distributed under the GNU General
> > + * Public License, version 2 (or at your option any later version). See
> > + * http://www.gnu.org/ for further details of the GPL. */
> >  package freenet.client.async;
> >
> >  import java.io.IOException;
> > @@ -30,6 +33,20 @@
> >  import freenet.support.io.BucketTools;
> >  import freenet.support.io.NativeThread;
> >
> > +/**
> > + * This class contains all the insert logic, but not any 'pack logic'.
> > + * The pack logic have to be implement in a subclass in makePutHandlers.
> > + * @see PlainManifestPutter and @see DefaultManifestPutter.
> > + *
> > + * Internal container redirect URIs:
> > + *  The internal container URIs should be always redirects to CHKs, not
>
> just include the metadata into manifest only.
>
> > + *  The (assumend) default behaviour is the reuse of containers between
>
> editions,
>
> > + *  also ArchiveManger want to have a URI given, not Metadata.
> > + *  This rule also makes site update code/logic much more easier.
>
> Okay, given that small files will always be inside a container, and given
> that we will implement DHKs, and internal URIs will then be DHKs i.e. they
> will not be dependant on a single block. If either of these conditions is
> false, then it makes sense to keep the top level inside the manifest.

Using the archive hash (sha256) as identifier for archive manager is an 
alternative,
this would allow matadata inclusion (container insert with 
reportMatadataOnly=true)

>
> > + *
> > + * container mode: the metadata are inside the root container (the final
>
> URI points to an archive)
>
> > + * freeform mode: the metadata are inserted separately.(the final URI
>
> points to a SimpleManifest)
>
> > + */
> >  public abstract class BaseManifestPutter extends BaseClientPutter
>
> implements PutCompletionCallback {
>
> > private static volatile boolean logMINOR;





[freenet-dev] [freenet-cvs] r27137 - trunk/freenet/src/freenet/support/io

2009-04-29 Thread Daniel Cheng
On Wed, Apr 29, 2009 at 9:21 AM, Matthew Toseland
 wrote:
> On Tuesday 21 April 2009 08:55:53 j16sdiz at freenetproject.org wrote:
>> Author: j16sdiz
>> Date: 2009-04-21 07:55:52 + (Tue, 21 Apr 2009)
>> New Revision: 27137
>>
>> Modified:
>> ? ?trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
>> Log:
>> Fix inputStream count
>
> What's the difference? Apart from your version breaks on an OOM and the
> previous version didn't?


If you close it twice, the counter get decreased twice.

>>
>> Modified: trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
>> ===
>> --- trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
> 2009-04-21 07:55:31 UTC (rev 27136)
>> +++ trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
> 2009-04-21 07:55:52 UTC (rev 27137)
>> @@ -75,17 +75,15 @@
>> ? ? ? public InputStream getInputStream() throws IOException {
>> ? ? ? ? ? ? ? if(freed) throw new IOException("Already freed");
>> ? ? ? ? ? ? ? final FileChannel channel = factory.channel;
>> +
>> + ? ? ? ? ? ? synchronized(PersistentBlobTempBucket.this) {
>> + ? ? ? ? ? ? ? ? ? ? inputStreams++;
>> + ? ? ? ? ? ? }
>> +
>> ? ? ? ? ? ? ? return new InputStream() {
>> -
>> ? ? ? ? ? ? ? ? ? ? ? private int offset;
>> ? ? ? ? ? ? ? ? ? ? ? private boolean closed;
>>
>> - ? ? ? ? ? ? ? ? ? ? {
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? synchronized(PersistentBlobTempBucket.this) {
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? inputStreams++;
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
>> - ? ? ? ? ? ? ? ? ? ? }
>> -
>> ? ? ? ? ? ? ? ? ? ? ? @Override
>> ? ? ? ? ? ? ? ? ? ? ? public int read() throws IOException {
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if (closed) throw new IOException("closed");
>> @@ -130,6 +128,7 @@
>>
>> ? ? ? ? ? ? ? ? ? ? ? @Override
>> ? ? ? ? ? ? ? ? ? ? ? public void close() {
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? if (closed) return;
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? closed = true;
>>
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? synchronized(PersistentBlobTempBucket.this) {
>>
>> ___
>> cvs mailing list
>> cvs at freenetproject.org
>> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
>>
>>
>
>
>
> ___
> Devl mailing list
> Devl at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>



[freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread Ian Clarke

On Apr 29, 2009, at 9:37 AM, bbackde at googlemail.com wrote:

> I have no problem with commits and updates from the command line.
> But when it comes to compare tasks (what was changed, what did I  
> change
> compared to the HEAD, or to any other revision), then I really  
> prefer Eclipse.

There are nice GUI tools for that, like gitk or gitx on the mac.  I  
agree that diffs are easier with a GUI tool (I never said command line  
was best for everything!)

Ian.

>
>
> If you like the command line, ok. But if I can't work with git using
> my prefered IDE,
> then I have a problem. I don't want to change anything just because  
> you decided
> to switch to some SCM that is mostly used by command line freaks ^^
>
> So I will fiddle with the Eclipse plugin, and if I fail I have to
> decide how to proceed...
>
> I fear that git could discourage some part-time devs from contributing
> to freenet.
> But I agree that some other devs might love git.
>
> On Wed, Apr 29, 2009 at 16:09, Ian Clarke  wrote:
>> On Wed, Apr 29, 2009 at 5:38 AM, xor  wrote:
>>> I consider learning command line usage for stuff for which a GUI  
>>> can be
>>> used as a waste of my personal lifetime and will not do so, I'd  
>>> rather
>>> sit in the sun or listen to music or hang out with friends or  
>>> whatever.
>>
>> Well, you are wrong.  If you made the effort to become proficient  
>> with
>> the command line you might find you have more time for listening to
>> music or hanging out with friends.  The command line remains the most
>> efficient way to do many things.  For example, I use a mac and I find
>> that stuff like moving files around is much more efficient with the
>> command line than with Finder, the Mac's file manager.
>>
>> Perhaps some day someone will invent a gui with the power,  
>> efficiency,
>> and flexibility of the command line, but it hasn't happened yet.
>>
>> Ian.
>>
>> --
>> Ian Clarke
>> CEO, Uprizer Labs
>> Email: ian at uprizer.com
>> Ph: +1 512 422 3588
>> Fax: +1 512 276 6674
>> ___
>> Devl mailing list
>> Devl at freenetproject.org
>> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>>
>
>
>
> -- 
> __
> GnuPG key:   (0x48DBFA8A)
> Keyserver:   pgpkeys.pca.dfn.de
> Fingerprint:
> 477D F057 1BD4 1AE7 8A54 8679 6690 E2EC 48DB FA8A
> __
> ___
> Devl mailing list
> Devl at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl



[freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread Ian Clarke
On Wed, Apr 29, 2009 at 5:38 AM, xor  wrote:
> I consider learning command line usage for stuff for which a GUI can be
> used as a waste of my personal lifetime and will not do so, I'd rather
> sit in the sun or listen to music or hang out with friends or whatever.

Well, you are wrong.  If you made the effort to become proficient with
the command line you might find you have more time for listening to
music or hanging out with friends.  The command line remains the most
efficient way to do many things.  For example, I use a mac and I find
that stuff like moving files around is much more efficient with the
command line than with Finder, the Mac's file manager.

Perhaps some day someone will invent a gui with the power, efficiency,
and flexibility of the command line, but it hasn't happened yet.

Ian.

-- 
Ian Clarke
CEO, Uprizer Labs
Email: ian at uprizer.com
Ph: +1 512 422 3588
Fax: +1 512 276 6674



[freenet-dev] ITA l10n update 090429

2009-04-29 Thread Daniel Cheng
On Wed, Apr 29, 2009 at 8:42 AM, Luke771  wrote:
> l10n override file attached
> translation updated to r27286
> please commit
>

Committed, and git now list luke771 as author.
see 
http://github.com/freenet/fred-staging/commit/773f1c918fa1109f1e880c1128c60c4d6a8fe8bf

For those who are curious about how did i do this, this is how:

  $ GIT_AUTHOR_NAME=Luke771 \
  > GIT_AUTHOR_EMAIL=luke771 at gmail.com \
  > GIT_AUTHOR_DATE="`date -r`"git commit

This is because git separate the author and committer name/email/date.
You may list these fields using  `git log --pretty=fuller`

(and yes, this is yet-another shameless plug on git's feature )



[freenet-dev] Plugins and forced updates

2009-04-29 Thread Daniel Cheng
On Wed, Apr 29, 2009 at 1:29 AM, Matthew Toseland
 wrote:
> PLEASE could nobody commit any forced updates to the git repositories without
> prior agreement? Rewriting history is bad.
>
> The plugins were not building, it was necessary to move the source files into
> src/plugins// and add build.xml, .classpath, .project and .gitignore
> files. Sdiz built a script to do this via rewriting history, which worked,
> but I have reverted it and (using sdiz's files) re-implemented the change
> with normal fast-forward style commits.

Hmm...
Older versions cannot be built, if you just add a new commit..

> All plugins now have their own build.xml, and can be built. You must checkout
> Freenet in a parallel directory called fred, and build it (we use the jar).
>
> So the git migration is sorted out for plugins, although we still do not have
> auto-build etc; I will deploy new builds of plugins when asked to.
>
> One exception: Freetalk does not currently build because of what seems to be
> an unrelated compile error.
>
> Thanks sdiz for all his help in migrating from SVN to git.
>
> ___
> Devl mailing list
> Devl at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>



[freenet-dev] ITA l10n update 090429

2009-04-29 Thread Luke771
l10n override file attached
translation updated to r27286
please commit
-- next part --
A non-text attachment was scrubbed...
Name: freenet.l10n.it.override.properties_090429_luke771
Type: application/octet-stream
Size: 4126 bytes
Desc: not available
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/9e187df0/attachment.obj>


[freenet-dev] [freenet-cvs] r27016 - trunk/freenet/src/freenet/clients/http/filter

2009-04-29 Thread Matthew Toseland
  throwHeaderError(l10n("Invalid start word"), 
> l10n("invalidHeader"));
> + }
> + 
> + 
> + 
> + int fileSize = readInt(dis); // read total file size

Can you check this? Compare the total file size to bucket.size()? (Which is a 
long btw). Just as a general sanity check? These are useful to avoid problems 
with stuff being apparently valid as several different MIME types, but also 
because wierd extensions might mean something to browsers or other apps. Is 
it always set? You could only let through that many bytes, but that requires 
copying the data, which we don't want unless it is necessary...

> + byte[] skipbytes=new byte[4];
> + dis.readFully(skipbytes);
> +int headerSize = readInt(dis); // read file header size or pixel 
offset
> + if(headerSize<0) {
> + throwHeaderError(l10n("Invalid 
> offset"), l10n("Image has invalid pixel 
offset of "+headerSize));
> + }
> + 
> +
> +
> + int size_bitmapinfoheader=readInt(dis);
> + if(size_bitmapinfoheader!=40) {
> + throwHeaderError(l10n("Invalid Bit Map 
> info header size"), l10n("Size 
of bitmap info header is not 40"));
> + }
> +
> +
> +int imageWidth = readInt(dis); // read width
> +int imageHeight = readInt(dis); // read height
> + if(imageWidth<0 || imageHeight<0) {
> + throwHeaderError(l10n("Invalid 
> Dimensions"), l10n("The image has 
invalid width or height"));
> + }
> +
> +
> +
> + int no_plane=readShort(dis);
> + if(no_plane!=1) { // No of planes should be 1
> + throwHeaderError(l10n("Invalid no of 
> plannes"), l10n("The image 
has "+no_plane+" planes"));
> + }
> + 
> +
> +int bitDepth = readShort(dis);
> + 
> + // Bit depth should be 1,2,4,8,16 or 32.
> + if(bitDepth!=1 && bitDepth!=2 && bitDepth!=4 && bitDepth!=8 && 
bitDepth!=16 && bitDepth!=24 && bitDepth!=32) {
> + throwHeaderError(l10n("Invalid bit 
> depth"), l10n("The bit depth field 
is set to"+bitDepth+". It is not of 1,2,4,8,16, and 32."));
> + }
> +
> + int compression_type=readInt(dis);
> + if( !(compression_type>=0 && compression_type<=3) ) {
> + throwHeaderError(l10n("Invalid 
> Compression type"), l10n("Compression 
type field is set to "+compression_type+" instead of 0-3"));
> + }
> + 
> + int imagedatasize=readInt(dis);
> + if(fileSize!=headerSize+imagedatasize) {
> + throwHeaderError(l10n("Invalid File 
> size"), l10n("File size is not 
matching to headersize+ imagedatasize"));
> + }
> +
> + int horizontal_resolution=readInt(dis);
> + int vertical_resolution=readInt(dis);
> +
> + if(horizontal_resolution<0 || vertical_resolution<0) {
> + throwHeaderError(l10n("Invalid resolution"), 
> l10n("This image file has 
resolution of "+horizontal_resolution+"x"+vertical_resolution ));
> + }
> + if(compression_type==0) {
> + // Verifying the file size w.r.t. image dimensions(width and 
> height), 
bitDepth with imagedatasize(including padding).
> + int 
> bytesperline=(int)Math.ceil((imageWidth*bitDepth)/8);
> + int paddingperline=0;
> + if(bytesperline%4!=0) {
> + paddingperline=4-bytesperline%4;
> + }
> + int calculatedsize= 
(int)Math.ceil((imageWidth*imageHeight*bitDepth)/8)+paddingperline*imageHeight;
> + if(calculatedsize!=imagedatasize) {
> + throwHeaderError(l10n("Invalid size of 
> image data"), l10n("The 
calculated image data size ("+calculatedsize+") is not matching with the 
actual size ("+imagedatasize+")" ));

You could maybe calculate an upper bound for other compression methods this 
way? The only real remaining issue is you don't check the fileSize afaics. 
Suggest you fix that and wire it in.
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/81e3e018/attachment.pgp>


[freenet-dev] [freenet-cvs] r27137 - trunk/freenet/src/freenet/support/io

2009-04-29 Thread Matthew Toseland
On Tuesday 21 April 2009 08:55:53 j16sdiz at freenetproject.org wrote:
> Author: j16sdiz
> Date: 2009-04-21 07:55:52 + (Tue, 21 Apr 2009)
> New Revision: 27137
> 
> Modified:
>trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
> Log:
> Fix inputStream count

What's the difference? Apart from your version breaks on an OOM and the 
previous version didn't?
> 
> Modified: trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
> ===
> --- trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
2009-04-21 07:55:31 UTC (rev 27136)
> +++ trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
2009-04-21 07:55:52 UTC (rev 27137)
> @@ -75,17 +75,15 @@
>   public InputStream getInputStream() throws IOException {
>   if(freed) throw new IOException("Already freed");
>   final FileChannel channel = factory.channel;
> + 
> + synchronized(PersistentBlobTempBucket.this) {
> + inputStreams++;
> + }
> + 
>   return new InputStream() {
> -
>   private int offset;
>   private boolean closed;
>   
> - {
> - synchronized(PersistentBlobTempBucket.this) {
> - inputStreams++;
> - }
> - }
> - 
>   @Override
>   public int read() throws IOException {
>   if (closed) throw new IOException("closed");
> @@ -130,6 +128,7 @@
>   
>   @Override
>   public void close() {
> + if (closed) return;
>   closed = true;
>   
>   synchronized(PersistentBlobTempBucket.this) {
> 
> ___
> cvs mailing list
> cvs at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
> 
> 


-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/3cbbbc64/attachment.pgp>


[freenet-dev] [freenet-cvs] r27134 - trunk/freenet/src/freenet/client/async

2009-04-29 Thread Matthew Toseland
On Tuesday 21 April 2009 08:51:58 j16sdiz at freenetproject.org wrote:
> Author: j16sdiz
> Date: 2009-04-21 07:51:58 + (Tue, 21 Apr 2009)
> New Revision: 27134
> 
> Added:
>trunk/freenet/src/freenet/client/async/CompressionOutput.java
> Modified:
>trunk/freenet/src/freenet/client/async/InsertCompressor.java
> Log:
> Fix java file structure
> 
> Why didn't the compiler complain?

Because non-public classes are allowed to be in another class's file?
> 
> Added: trunk/freenet/src/freenet/client/async/CompressionOutput.java
> ===
> --- trunk/freenet/src/freenet/client/async/CompressionOutput.java 
> 
(rev 0)
> +++ trunk/freenet/src/freenet/client/async/CompressionOutput.java 
> 2009-04-21 
07:51:58 UTC (rev 27134)
> @@ -0,0 +1,13 @@
> +package freenet.client.async;
> +
> +import freenet.support.api.Bucket;
> +import freenet.support.compress.Compressor.COMPRESSOR_TYPE;
> +
> +class CompressionOutput {
> + public CompressionOutput(Bucket bestCompressedData, COMPRESSOR_TYPE 
bestCodec2) {
> + this.data = bestCompressedData;
> + this.bestCodec = bestCodec2;
> + }
> + final Bucket data;
> + final COMPRESSOR_TYPE bestCodec;
> +}
> \ No newline at end of file
> 
> 
> Property changes on: 
trunk/freenet/src/freenet/client/async/CompressionOutput.java
> ___
> Added: svn:mime-type
>+ text/x-java
> Added: svn:keywords
>+ Id
> Added: svn:eol-style
>+ native
> 
> Modified: trunk/freenet/src/freenet/client/async/InsertCompressor.java
> ===
> --- trunk/freenet/src/freenet/client/async/InsertCompressor.java  
> 2009-04-21 
07:51:28 UTC (rev 27133)
> +++ trunk/freenet/src/freenet/client/async/InsertCompressor.java  
> 2009-04-21 
07:51:58 UTC (rev 27134)
> @@ -293,12 +293,3 @@
>   }
>  
>  }
> -
> -class CompressionOutput {
> - public CompressionOutput(Bucket bestCompressedData, COMPRESSOR_TYPE 
bestCodec2) {
> - this.data = bestCompressedData;
> - this.bestCodec = bestCodec2;
> - }
> - final Bucket data;
> - final COMPRESSOR_TYPE bestCodec;
> -}
> \ No newline at end of file
> 
> ___
> cvs mailing list
> cvs at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
> 
> 


-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/8a397c3e/attachment.pgp>


[freenet-dev] [freenet-cvs] r27121 - trunk/freenet/src/freenet/client/async

2009-04-29 Thread Matthew Toseland
Metadata newMeta = (Metadata) meta.clone();
>   newMeta.setSimpleRedirect();
>   final SingleFileFetcher f;
> - f = new SingleFileFetcher(this, persistent, true, newMeta, new 
ArchiveFetcherCallback(forData, element, callback), new FetchContext(ctx, 
FetchContext.SET_RETURN_ARCHIVES, true, null), container, context);
> + f = new SingleFileFetcher(this, persistent, true, newMeta, new 
ArrayList(), new ArchiveFetcherCallback(forData, element, callback), 
new FetchContext(ctx, FetchContext.SET_RETURN_ARCHIVES, true, null), 
container, context);

This, like the change to SingleFileFetcher's constructor, is unnecessary.

>   if(persistent) container.store(f);
>   if(logMINOR) Logger.minor(this, "fetchArchive(): "+f);
>   // Fetch the archive. The archive fetcher callback will unpack 
> it, and 
either call the element 
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/a9654f41/attachment.pgp>


[freenet-dev] [freenet-cvs] r27153 - trunk/freenet/src/freenet/client/async

2009-04-29 Thread Matthew Toseland
On Tuesday 21 April 2009 15:16:55 saces at freenetproject.org wrote:
> Author: saces
> Date: 2009-04-21 14:16:55 + (Tue, 21 Apr 2009)
> New Revision: 27153
> 
> Modified:
>trunk/freenet/src/freenet/client/async/BaseManifestPutter.java
> Log:
> indent: add comments
> 
> Modified: trunk/freenet/src/freenet/client/async/BaseManifestPutter.java
> ===
> --- trunk/freenet/src/freenet/client/async/BaseManifestPutter.java
2009-04-21 12:45:14 UTC (rev 27152)
> +++ trunk/freenet/src/freenet/client/async/BaseManifestPutter.java
2009-04-21 14:16:55 UTC (rev 27153)
> @@ -1,3 +1,6 @@
> +/* This code is part of Freenet. It is distributed under the GNU General
> + * Public License, version 2 (or at your option any later version). See
> + * http://www.gnu.org/ for further details of the GPL. */
>  package freenet.client.async;
>  
>  import java.io.IOException;
> @@ -30,6 +33,20 @@
>  import freenet.support.io.BucketTools;
>  import freenet.support.io.NativeThread;
>  
> +/**
> + * This class contains all the insert logic, but not any 'pack logic'.
> + * The pack logic have to be implement in a subclass in makePutHandlers.
> + * @see PlainManifestPutter and @see DefaultManifestPutter.
> + * 
> + * Internal container redirect URIs:
> + *  The internal container URIs should be always redirects to CHKs, not 
just include the metadata into manifest only.
> + *  The (assumend) default behaviour is the reuse of containers between 
editions,
> + *  also ArchiveManger want to have a URI given, not Metadata.
> + *  This rule also makes site update code/logic much more easier.

Okay, given that small files will always be inside a container, and given that 
we will implement DHKs, and internal URIs will then be DHKs i.e. they will 
not be dependant on a single block. If either of these conditions is false, 
then it makes sense to keep the top level inside the manifest.
> + * 
> + * container mode: the metadata are inside the root container (the final 
URI points to an archive)
> + * freeform mode: the metadata are inserted separately.(the final URI 
points to a SimpleManifest)
> + */
>  public abstract class BaseManifestPutter extends BaseClientPutter 
implements PutCompletionCallback {
>  
>   private static volatile boolean logMINOR;
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/ac5ae0d0/attachment.pgp>


[freenet-dev] [freenet-cvs] r27015 - trunk/freenet/src/freenet/clients/http/filter

2009-04-29 Thread Matthew Toseland
; (!Arrays.equals(StartWord, 
bmpHeaderos2Pointer))) {//Checking the first word
> - throwHeaderError(l10n("Invalid start word"), 
> l10n("invalidHeader"));
> - }
> - 
> - 
> - 
> - int fileSize = readInt(dis); // read total file size
> - byte[] skipbytes=new byte[4];
> - dis.readFully(skipbytes);
> -int headerSize = readInt(dis); // read file header size or pixel 
offset
> -
> -
> - int size_bitmapinfoheader=readInt(dis);
> - if(size_bitmapinfoheader!=40) {
> - throwHeaderError(l10n("Invalid Bit Map 
> info header size"), l10n("Size 
of bitmap info header is not 40"));
> - }
> -
> -
> -int imageWidth = readInt(dis); // read width
> -int imageHeight = readInt(dis); // read height
> - if(imageWidth<0 || imageHeight<0) {
> - throwHeaderError(l10n("Invalid 
> Dimensions"), l10n("The image has 
invalid width or height"));
> - }
> -
> -
> -
> - int no_plane=readShort(dis);
> - if(no_plane<0) {
> - throwHeaderError(l10n("Invalid no of 
> plannes"), l10n("The image 
has "+no_plane+" planes"));
> - }
> - 
> -
> -int bitDepth = readShort(dis);
> - if(bitDepth<0) {
> - throwHeaderError(l10n("Invalid bit 
> depth"), l10n("The bit depth field 
is set to"+bitDepth));
> - }
> -
> - int compression_type=readInt(dis);
> - if( !(compression_type>=0 && compression_type<=3) ) {
> - throwHeaderError(l10n("Invalid 
> Compression type"), l10n("Compression 
type field is set to "+compression_type+" instead of 0-3"));
> - }
> - 
> - int imagedatasize=readInt(dis);
> - if(fileSize!=headerSize+imagedatasize) {
> - throwHeaderError(l10n("Invalid File 
> size"), l10n("File size is not 
matching to headersize+ imagedatasize"));
> - }
> - 
> - System.out.println("filesize="+fileSize+" 
> headerByteCount="+headerSize+" 
width="+imageWidth+" height="+imageHeight+" bitDepth="+bitDepth+" 
compressionType="+compression_type+" bytesOfPixelData="+imagedatasize);
> -
> - dis.close();
> - } finally {
> - Closer.close(dis);
> - }
> - return data;
> - }
> -
> - private static String l10n(String key) {
> - return L10n.getString("BMPFilter."+key);
> - }
> -
> - private void throwHeaderError(String shortReason, String reason) throws 
DataFilterException {
> -     // Throw an exception
> - String message = l10n("notBMP");
> - if(reason != null) message += ' ' + reason;
> - if(shortReason != null)
> - message += " - (" + shortReason + ')';
> - throw new DataFilterException(shortReason, shortReason,
> - ""+message+"", new 
> HTMLNode("p").addChild("#", message));
> - }
> -
> - public Bucket writeFilter(Bucket data, BucketFactory bf, String 
> charset, 
HashMap<String, String> otherParams,
> - FilterCallback cb) throws DataFilterException, IOException {
> - return null;
> - }
> -
> -}
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/47e586a6/attachment.pgp>


[freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread Daniel Cheng
Guides: Using the EGit Eclipse Plugin with GitHub
http://github.com/guides/using-the-egit-eclipse-plugin-with-github

Guides: Using Git and Github for the Windows for newbies feed
http://github.com/guides/using-git-and-github-for-the-windows-for-newbies



Re: [freenet-dev] [freenet-cvs] r27153 - trunk/freenet/src/freenet/client/async

2009-04-29 Thread bo-le
Am Mittwoch, 29. April 2009 03:20:48 schrieb Matthew Toseland:
 On Tuesday 21 April 2009 15:16:55 sa...@freenetproject.org wrote:
  Author: saces
  Date: 2009-04-21 14:16:55 + (Tue, 21 Apr 2009)
  New Revision: 27153
 
  Modified:
 trunk/freenet/src/freenet/client/async/BaseManifestPutter.java
  Log:
  indent: add comments
 
  Modified: trunk/freenet/src/freenet/client/async/BaseManifestPutter.java
  ===
  --- trunk/freenet/src/freenet/client/async/BaseManifestPutter.java

 2009-04-21 12:45:14 UTC (rev 27152)

  +++ trunk/freenet/src/freenet/client/async/BaseManifestPutter.java

 2009-04-21 14:16:55 UTC (rev 27153)

  @@ -1,3 +1,6 @@
  +/* This code is part of Freenet. It is distributed under the GNU General
  + * Public License, version 2 (or at your option any later version). See
  + * http://www.gnu.org/ for further details of the GPL. */
   package freenet.client.async;
 
   import java.io.IOException;
  @@ -30,6 +33,20 @@
   import freenet.support.io.BucketTools;
   import freenet.support.io.NativeThread;
 
  +/**
  + * This class contains all the insert logic, but not any 'pack logic'.
  + * The pack logic have to be implement in a subclass in makePutHandlers.
  + * @see PlainManifestPutter and @see DefaultManifestPutter.
  + *
  + * Internal container redirect URIs:
  + *  The internal container URIs should be always redirects to CHKs, not

 just include the metadata into manifest only.

  + *  The (assumend) default behaviour is the reuse of containers between

 editions,

  + *  also ArchiveManger want to have a URI given, not Metadata.
  + *  This rule also makes site update code/logic much more easier.

 Okay, given that small files will always be inside a container, and given
 that we will implement DHKs, and internal URIs will then be DHKs i.e. they
 will not be dependant on a single block. If either of these conditions is
 false, then it makes sense to keep the top level inside the manifest.

Using the archive hash (sha256) as identifier for archive manager is an 
alternative,
this would allow matadata inclusion (container insert with 
reportMatadataOnly=true)


  + *
  + * container mode: the metadata are inside the root container (the final

 URI points to an archive)

  + * freeform mode: the metadata are inserted separately.(the final URI

 points to a SimpleManifest)

  + */
   public abstract class BaseManifestPutter extends BaseClientPutter

 implements PutCompletionCallback {

  private static volatile boolean logMINOR;


___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl


Re: [freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread xor
On Mon, 2009-04-27 at 18:15 -0400, Juiceman wrote: 
 On Mon, Apr 27, 2009 at 6:11 PM, xor x...@gmx.li wrote:
 
  Hi,
 
  I've been trying to set up my IDE to work with git and found the
  following one:
 
  http://www.jgit.org/
 
  It pulls, it diffs, everything, but push won't work:
  Can't connect to any URI: git://github.com/freenet/fred-staging.git
  (Transport error occured during push operation: Protocol error: expected
  LF)
 
  Notice that I did not specify the git:// URI when fetching the
  repository, I used the git@ one and enabled git+ssh.
 
  Does anyone know of an alternative git plugin for eclipse which is more
  stable?
 
  Greetings, xor
 
  ___
  Devl mailing list
  Devl@freenetproject.org
  http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
 
 
 Make sure you use g...@github.com:freenet/fred-staging.git  (Note the colon)
 

Quote of myself:

 Notice that I did not specify the git:// URI when fetching the
 repository, I used the git@ one and enabled git+ssh.



signature.asc
Description: This is a digitally signed message part
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Re: [freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread xor
On Tue, 2009-04-28 at 12:47 -0500, Ian Clarke wrote:
 I know some people are religiously opposed to using the command-line
 git client, but I think those people are mistaken.  I used to think
 that I couldn't survive without Subclipse, but when I migrated to git
 I thought I'd bite the bullet and use the command line.
 
 I quickly grew accustomed to it, and especially with stuff like git
 bash completion (http://budurl.com/8gyy), and some bash prompt magic
 (http://budurl.com/e6ma), I've found I'm very productive at the
 command line.
 
 I now have little desire to switch back to a gui source control tool.
 
 Ian.
 

I consider learning command line usage for stuff for which a GUI can be
used as a waste of my personal lifetime and will not do so, I'd rather
sit in the sun or listen to music or hang out with friends or whatever.

We're in 2009 and graphical IDEs ought to be able to do the revision
control, if that does not work then the wrong revision control system or
IDE is being used. It is really not like revision control is something
new, it has to be possible with GUI, it's been there for ages!


signature.asc
Description: This is a digitally signed message part
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Re: [freenet-dev] Plugins and forced updates

2009-04-29 Thread xor
On Tue, 2009-04-28 at 18:29 +0100, Matthew Toseland wrote:
 
 One exception: Freetalk does not currently build because of what seems to be 
 an unrelated compile error.

Yes, I have missed a file in my last commit to the SVN, I will commit it
as soon as git pushing works for me. I'm sorry.


signature.asc
Description: This is a digitally signed message part
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Re: [freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread Arne Babenhauserheide
Am Mittwoch 29 April 2009 12:38:15 schrieb xor:
 We're in 2009 and graphical IDEs ought to be able to do the revision
 control, if that does not work then the wrong revision control system or
 IDE is being used. It is really not like revision control is something
 new, it has to be possible with GUI, it's been there for ages!

I'm currently walking the opposite direction: I find myself using TortoiseHG 
more and more instead of Mercurial at the command line, and I find that I am 
far more productive that way. 

Partial commits are far more efficient, when you can just select the hunks 
graphically, and a quick look at the history graph makes the log become much 
clearer in an instant. 

A GUI has the advantage, that it uses more of the perception and interaction 
capabilities of its user. Most of us are visually oriented, and our visual 
processing capability is far higher than our text processing. 

Best wishes, 
Arne

--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- 
   - singing a part of the history of free software -
  http://infinite-hands.draketo.de


signature.asc
Description: This is a digitally signed message part.
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

[freenet-dev] SVN repository archive

2009-04-29 Thread Matthew Toseland
Please fetch and archive the following files, anyone who can. This is the SVN 
repository dump at the time of the migration (you can use it by creating an 
svn repo and then doing svn import, if you so desire). Everyone will have a 
copy of the git repository, but it may not have full history; it is a good 
idea to archive the SVN repo as well.

http://127.0.0.1:/c...@tlozax5phpykpr26jw0igptn70qgjkc~t59qwnjhqga,meHKwt1sWbCxc-jtVgF~wrI8TO5bzQvKXJ6hxbhBCXs,AAIC--8/freenet.svn-repository.dump
http://127.0.0.1:/c...@hn3n2eacee-mzjltde6xvxtk2te1kturirt~5bnxb98,irLRe2jXsjBWuoQ03bliOofvygo80iLB8V4Owbe7nrU,AAIC--8/freenet.svn-repository.dump.sha1
http://127.0.0.1:/c...@qputucx~hheqa7uegljdsxkqecqnklltle5jadkxwqg,GnWPmKQhnTLIok70UyA0TJdoXQ8QHwFqxy2qj6RQCd0,AAIC--8/freenet.svn-repository.dump.sha256
http://127.0.0.1:/c...@7uofxsptlnz7rfhuab38nkuqh3zd6~kf7wkwxrxf6dm,pTjksYXpuFNRixZ1Zw1UN66HZ0vcyRAGw5A0a~qdtL8,AAIC--8/freenet.svn-repository.dump.sig

I am also curious how long it takes to fetch it, so let me know.

The first file is 281MB, the others are hundreds of bytes or less. The last is 
a detached signature with my key.


signature.asc
Description: This is a digitally signed message part.
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Re: [freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread Ian Clarke
On Wed, Apr 29, 2009 at 5:38 AM, xor x...@gmx.li wrote:
 I consider learning command line usage for stuff for which a GUI can be
 used as a waste of my personal lifetime and will not do so, I'd rather
 sit in the sun or listen to music or hang out with friends or whatever.

Well, you are wrong.  If you made the effort to become proficient with
the command line you might find you have more time for listening to
music or hanging out with friends.  The command line remains the most
efficient way to do many things.  For example, I use a mac and I find
that stuff like moving files around is much more efficient with the
command line than with Finder, the Mac's file manager.

Perhaps some day someone will invent a gui with the power, efficiency,
and flexibility of the command line, but it hasn't happened yet.

Ian.

-- 
Ian Clarke
CEO, Uprizer Labs
Email: i...@uprizer.com
Ph: +1 512 422 3588
Fax: +1 512 276 6674
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl


Re: [freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread bbackde
I have no problem with commits and updates from the command line.
But when it comes to compare tasks (what was changed, what did I change
compared to the HEAD, or to any other revision), then I really prefer Eclipse.

If you like the command line, ok. But if I can't work with git using
my prefered IDE,
then I have a problem. I don't want to change anything just because you decided
to switch to some SCM that is mostly used by command line freaks ^^

So I will fiddle with the Eclipse plugin, and if I fail I have to
decide how to proceed...

I fear that git could discourage some part-time devs from contributing
to freenet.
But I agree that some other devs might love git.

On Wed, Apr 29, 2009 at 16:09, Ian Clarke i...@locut.us wrote:
 On Wed, Apr 29, 2009 at 5:38 AM, xor x...@gmx.li wrote:
 I consider learning command line usage for stuff for which a GUI can be
 used as a waste of my personal lifetime and will not do so, I'd rather
 sit in the sun or listen to music or hang out with friends or whatever.

 Well, you are wrong.  If you made the effort to become proficient with
 the command line you might find you have more time for listening to
 music or hanging out with friends.  The command line remains the most
 efficient way to do many things.  For example, I use a mac and I find
 that stuff like moving files around is much more efficient with the
 command line than with Finder, the Mac's file manager.

 Perhaps some day someone will invent a gui with the power, efficiency,
 and flexibility of the command line, but it hasn't happened yet.

 Ian.

 --
 Ian Clarke
 CEO, Uprizer Labs
 Email: i...@uprizer.com
 Ph: +1 512 422 3588
 Fax: +1 512 276 6674
 ___
 Devl mailing list
 Devl@freenetproject.org
 http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl




-- 
__
GnuPG key:   (0x48DBFA8A)
Keyserver:   pgpkeys.pca.dfn.de
Fingerprint:
477D F057 1BD4 1AE7 8A54 8679 6690 E2EC 48DB FA8A
__
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl


Re: [freenet-dev] [freenet-cvs] r27137 - trunk/freenet/src/freenet/support/io

2009-04-29 Thread Matthew Toseland
On Wednesday 29 April 2009 02:58:48 Daniel Cheng wrote:
 On Wed, Apr 29, 2009 at 9:21 AM, Matthew Toseland
 t...@amphibian.dyndns.org wrote:
  On Tuesday 21 April 2009 08:55:53 j16s...@freenetproject.org wrote:
  Author: j16sdiz
  Date: 2009-04-21 07:55:52 + (Tue, 21 Apr 2009)
  New Revision: 27137
 
  Modified:
     trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
  Log:
  Fix inputStream count
 
  What's the difference? Apart from your version breaks on an OOM and the
  previous version didn't?
 
 
 If you close it twice, the counter get decreased twice.

Doh! But why the inputStreams inc move?
 
 
  Modified: 
trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
  ===
  --- trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
  2009-04-21 07:55:31 UTC (rev 27136)
  +++ trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
  2009-04-21 07:55:52 UTC (rev 27137)
  @@ -75,17 +75,15 @@
        public InputStream getInputStream() throws IOException {
                if(freed) throw new IOException(Already freed);
                final FileChannel channel = factory.channel;
  +
  +             synchronized(PersistentBlobTempBucket.this) {
  +                     inputStreams++;
  +             }
  +
                return new InputStream() {
  -
                        private int offset;
                        private boolean closed;
 
  -                     {
  -                             synchronized(PersistentBlobTempBucket.this) 
{
  -                                     inputStreams++;
  -                             }
  -                     }
  -
                        @Override
                        public int read() throws IOException {
                                if (closed) throw new 
IOException(closed);
  @@ -130,6 +128,7 @@
 
                        @Override
                        public void close() {
  +                             if (closed) return;
                                closed = true;
 
                                synchronized(PersistentBlobTempBucket.this) 
{
 
  ___
  cvs mailing list
  c...@freenetproject.org
  http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
 
 
 
 
 
  ___
  Devl mailing list
  Devl@freenetproject.org
  http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
 
 ___
 Devl mailing list
 Devl@freenetproject.org
 http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
 
 




signature.asc
Description: This is a digitally signed message part.
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Re: [freenet-dev] [freenet-cvs] r27137 - trunk/freenet/src/freenet/support/io

2009-04-29 Thread Daniel Cheng
On Wed, Apr 29, 2009 at 11:14 PM, Matthew Toseland
t...@amphibian.dyndns.org wrote:
 On Wednesday 29 April 2009 02:58:48 Daniel Cheng wrote:
 On Wed, Apr 29, 2009 at 9:21 AM, Matthew Toseland
 t...@amphibian.dyndns.org wrote:
  On Tuesday 21 April 2009 08:55:53 j16s...@freenetproject.org wrote:
  Author: j16sdiz
  Date: 2009-04-21 07:55:52 + (Tue, 21 Apr 2009)
  New Revision: 27137
 
  Modified:
     trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
  Log:
  Fix inputStream count
 
  What's the difference? Apart from your version breaks on an OOM and the
  previous version didn't?


 If you close it twice, the counter get decreased twice.

 Doh! But why the inputStreams inc move?

hmm.. it does nothing different.
it should not have been committed.

 
  Modified:
 trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
  ===
  --- trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
  2009-04-21 07:55:31 UTC (rev 27136)
  +++ trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
  2009-04-21 07:55:52 UTC (rev 27137)
  @@ -75,17 +75,15 @@
        public InputStream getInputStream() throws IOException {
                if(freed) throw new IOException(Already freed);
                final FileChannel channel = factory.channel;
  +
  +             synchronized(PersistentBlobTempBucket.this) {
  +                     inputStreams++;
  +             }
  +
                return new InputStream() {
  -
                        private int offset;
                        private boolean closed;
 
  -                     {
  -                             synchronized(PersistentBlobTempBucket.this)
 {
  -                                     inputStreams++;
  -                             }
  -                     }
  -
                        @Override
                        public int read() throws IOException {
                                if (closed) throw new
 IOException(closed);
  @@ -130,6 +128,7 @@
 
                        @Override
                        public void close() {
  +                             if (closed) return;
                                closed = true;
 
                                synchronized(PersistentBlobTempBucket.this)
 {
 
  ___
  cvs mailing list
  c...@freenetproject.org
  http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
 
 
 
 
 
  ___
  Devl mailing list
  Devl@freenetproject.org
  http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
 
 ___
 Devl mailing list
 Devl@freenetproject.org
 http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl





 ___
 Devl mailing list
 Devl@freenetproject.org
 http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl


Re: [freenet-dev] [freenet-cvs] r27197 - trunk/freenet/src/freenet/crypt

2009-04-29 Thread Matthew Toseland
On Wednesday 22 April 2009 08:28:30 j16s...@freenetproject.org wrote:
 Author: j16sdiz
 Date: 2009-04-22 07:28:30 + (Wed, 22 Apr 2009)
 New Revision: 27197
 
 Removed:
trunk/freenet/src/freenet/crypt/DSAGroupGenerator.java
 Log:
 Unused class: DSAGroupGenerator

Please reinstate. This is how we prove that our group wasn't engineered to be 
weak.
 
 Deleted: trunk/freenet/src/freenet/crypt/DSAGroupGenerator.java
 ===
 --- trunk/freenet/src/freenet/crypt/DSAGroupGenerator.java2009-04-22 
07:28:09 UTC (rev 27196)
 +++ trunk/freenet/src/freenet/crypt/DSAGroupGenerator.java2009-04-22 
07:28:30 UTC (rev 27197)
 @@ -1,202 +0,0 @@
 -/* This code is part of Freenet. It is distributed under the GNU General
 - * Public License, version 2 (or at your option any later version). See
 - * http://www.gnu.org/ for further details of the GPL. */
 -package freenet.crypt;
 -
 -import java.math.BigInteger;
 -import java.security.MessageDigest;
 -import java.security.NoSuchAlgorithmException;
 -
 -import net.i2p.util.NativeBigInteger;
 -
 -import freenet.support.HexUtil;
 -
 -/**
 - * DSA Group Generator.
 - * Adapted from FIPS 186-2.
 - * Can generate valid groups of any keysize and any hash length.
 - */
 -public class DSAGroupGenerator {
 -
 -static BigInteger smallPrimes[] = new BigInteger[] { 
BigInteger.valueOf(3),
 -BigInteger.valueOf(5), BigInteger.valueOf(7),
 -BigInteger.valueOf(11), BigInteger.valueOf(13),
 -BigInteger.valueOf(17), BigInteger.valueOf(19),
 -BigInteger.valueOf(23), BigInteger.valueOf(29)};
 -
 - public static void main(String[] args) throws NoSuchAlgorithmException {
 - Yarrow r = new Yarrow();
 - int keyLength = Integer.parseInt(args[0]);
 - int hashLength = Integer.parseInt(args[1]);
 - System.out.println(Key length: +keyLength);
 - System.out.println(Hash length: +hashLength);
 - if(hashLength  keyLength)
 - throw new IllegalArgumentException(hashLength must not 
 be greater than 
keyLength);
 - MessageDigest md;
 - if(hashLength == 256) {
 - md = SHA256.getMessageDigest();
 - } else if(hashLength == 160) {
 - md = MessageDigest.getInstance(SHA-160);
 - } else {
 - throw new IllegalArgumentException(Invalid hash length 
 +hashLength);
 - }
 - if(keyLength % 64 != 0)
 - throw new IllegalArgumentException(Key length must be 
 divisible by 
64);
 - if(keyLength % hashLength != 0)
 - throw new IllegalArgumentException(Key length must be 
 divisible by hash 
length (short cut taken here));
 - while(!generate(r, keyLength, hashLength, md));
 - }
 -
 - private static boolean generate(RandomSource r, int keyLength, int 
hashLength, MessageDigest md) {
 - 
 - int n = keyLength / hashLength;
 - 
 - // 1: SEED = arbitrary sequence of at least hashLength bits
 - // g = length of SEED in bits
 - int g = hashLength * 2;
 - byte[] seed = new byte[g/8];
 - r.nextBytes(seed);
 - 
 - // 2: U = SHA-256(SEED) XOR SHA-256(SEED+1 mod 2^g)
 - byte[] seedPlus1 = increment(seed);
 - byte[] seedHash = md.digest(seed);
 - byte[] seedPlus1Hash = md.digest(seedPlus1);
 - byte[] U = new byte[hashLength/8];
 - for(int i=0;iU.length;i++)
 - U[i] = (byte) (seedHash[i] ^ seedPlus1Hash[i]);
 - 
 - // 3: Set LSB and MSB on U to 1, q = U
 - byte[] qBuf = new byte[hashLength/8];
 - System.arraycopy(U, 0, qBuf, 0, hashLength/8);
 - qBuf[0] = (byte) (qBuf[0] | 128);
 - qBuf[qBuf.length-1] = (byte) (qBuf[qBuf.length-1] | 1);
 - BigInteger q = new BigInteger(1, qBuf);
 - 
 - // 4: Check that q is prime, and 2q+1 is prime
 - // 5: If not, restart from step 1
 - 
 - System.out.println(Maybe got prime: +q.toString(16)+  
(+q.bitLength()+ ')');
 - 
 - if(!isPrime(q))
 - return false;
 - 
 - System.out.println(Got prime q);
 - 
 - BigInteger sophieGermainCheck = q.add(q).add(BigInteger.ONE);
 - if(!isPrime(sophieGermainCheck))
 - return false;
 -
 - System.out.println(Got SG-prime q);
 - 
 - // 6: Let counter = 0 and offset = 2
 - 
 - int counter = 0;
 - int offset = 2;
 - 
 - byte[] curSeed = seedPlus1;
 - 
 - while(true) {
 - 
 - 

Re: [freenet-dev] SVN repository archive

2009-04-29 Thread bbackde
Started all 4 together, got the big one in 1 hour 5 minutes.
.sig and .sha256 took 1 minute, and .sha1 took 25 minutes.

On Wed, Apr 29, 2009 at 15:10, Matthew Toseland
t...@amphibian.dyndns.org wrote:
 Please fetch and archive the following files, anyone who can. This is the SVN
 repository dump at the time of the migration (you can use it by creating an
 svn repo and then doing svn import, if you so desire). Everyone will have a
 copy of the git repository, but it may not have full history; it is a good
 idea to archive the SVN repo as well.

 http://127.0.0.1:/c...@tlozax5phpykpr26jw0igptn70qgjkc~t59qwnjhqga,meHKwt1sWbCxc-jtVgF~wrI8TO5bzQvKXJ6hxbhBCXs,AAIC--8/freenet.svn-repository.dump
 http://127.0.0.1:/c...@hn3n2eacee-mzjltde6xvxtk2te1kturirt~5bnxb98,irLRe2jXsjBWuoQ03bliOofvygo80iLB8V4Owbe7nrU,AAIC--8/freenet.svn-repository.dump.sha1
 http://127.0.0.1:/c...@qputucx~hheqa7uegljdsxkqecqnklltle5jadkxwqg,GnWPmKQhnTLIok70UyA0TJdoXQ8QHwFqxy2qj6RQCd0,AAIC--8/freenet.svn-repository.dump.sha256
 http://127.0.0.1:/c...@7uofxsptlnz7rfhuab38nkuqh3zd6~kf7wkwxrxf6dm,pTjksYXpuFNRixZ1Zw1UN66HZ0vcyRAGw5A0a~qdtL8,AAIC--8/freenet.svn-repository.dump.sig

 I am also curious how long it takes to fetch it, so let me know.

 The first file is 281MB, the others are hundreds of bytes or less. The last is
 a detached signature with my key.

 ___
 Devl mailing list
 Devl@freenetproject.org
 http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl




-- 
__
GnuPG key:   (0x48DBFA8A)
Keyserver:   pgpkeys.pca.dfn.de
Fingerprint:
477D F057 1BD4 1AE7 8A54 8679 6690 E2EC 48DB FA8A
__
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl


Re: [freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread xor
On Wed, 2009-04-29 at 23:09 +0800, Daniel Cheng wrote:
 On Wed, Apr 29, 2009 at 6:35 PM, xor x...@gmx.li wrote:
  On Tue, 2009-04-28 at 09:08 +0800, Daniel Cheng wrote:
  Okay, after reading the irc log, i guess i know what's happending here.
 
  You have to generate a ssh-key using   `ssh-keygen` and upload your
  *.pub file to your github account.
 
  I did do that when creating my account, thats not the problem.
 
 
 The IRC log say you have entered the github password.
 You shouldn't have to do that.
 That's why I think you have missed the ssh key.

That was before I figured out that I have to enter the ssh key and I
*did* enter it.

 When it ask for username, enter git, no password.
 your ssh-key should place in ~/.ssh/ as the default location.
 ___
 Devl mailing list
 Devl@freenetproject.org
 http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl


signature.asc
Description: This is a digitally signed message part
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Re: [freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread Juiceman
On Wed, Apr 29, 2009 at 6:34 AM, xor x...@gmx.li wrote:
 On Tue, 2009-04-28 at 08:32 +0800, Daniel Cheng wrote:
 On Tue, Apr 28, 2009 at 6:11 AM, xor x...@gmx.li wrote:
 
  Hi,
 
  I've been trying to set up my IDE to work with git and found the
  following one:
 
  http://www.jgit.org/
 
  It pulls, it diffs, everything, but push won't work:
  Can't connect to any URI: git://github.com/freenet/fred-staging.git
  (Transport error occured during push operation: Protocol error: expected
  LF)
 
  Notice that I did not specify the git:// URI when fetching the
  repository, I used the git@ one and enabled git+ssh.

 try to fix this in command line:

 $ cd fred
 $ git remote show

 this should show your current git remote detail, that is the git:// uri.
 If it is wrong, you can fix it with:

 $ git remote rm original
 $ git remote add original  ...@github.com:freenet/fred-staging.git

 then go to eclipse and try again

 As I've said, I *did* specify the correct URI when creating the
 repository. get remote show origin -n says the URI is:
 git+ssh://g...@github.com/freenet/fred-staging.git

The correct URL is
g...@github.com:freenet/fred-staging.git   not
g...@github.com/freenet/fred-staging.git  (see the : ?)

I repeat this because this is the first problem I had.

 which is the one I specified when creating the repository and which
 seems correct to me because it uses the git@ part.



-- 
I may disagree with what you have to say, but I shall defend, to the
death, your right to say it. - Voltaire
Those who would give up Liberty, to purchase temporary Safety, deserve
neither Liberty nor Safety. - Ben Franklin
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Re: [freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread freenetw...@web.de
Well, I felt kind of sorry to see the project move away from SVN.
I've got good results with SVN; I use it for my home projects, at work,
have contact to other SVN-users, etc.
And it has that wonderful TortoiseSVN Windoze-Explorer-Extension.

What I found out, now that the shift to git has happened, is that
there's a Tortoise-* clone for git, too!
I wonder how it will perform from a SVN-user's point of view.

So maybe this could help you: http://code.google.com/p/tortoisegit/

BTW - where can I find the official git repository again?... How to
fetch development from others? or is there a head where all patches go
into like it was with SVN head?


bbac...@googlemail.com wrote:
 I have no problem with commits and updates from the command line.
 But when it comes to compare tasks (what was changed, what did I change
 compared to the HEAD, or to any other revision), then I really prefer Eclipse.

 If you like the command line, ok. But if I can't work with git using
 my prefered IDE,
 then I have a problem. I don't want to change anything just because you 
 decided
 to switch to some SCM that is mostly used by command line freaks ^^

 So I will fiddle with the Eclipse plugin, and if I fail I have to
 decide how to proceed...

 I fear that git could discourage some part-time devs from contributing
 to freenet.
 But I agree that some other devs might love git.

 On Wed, Apr 29, 2009 at 16:09, Ian Clarke i...@locut.us wrote:
   
 On Wed, Apr 29, 2009 at 5:38 AM, xor x...@gmx.li wrote:
 
 I consider learning command line usage for stuff for which a GUI can be
 used as a waste of my personal lifetime and will not do so, I'd rather
 sit in the sun or listen to music or hang out with friends or whatever.
   
 Well, you are wrong.  If you made the effort to become proficient with
 the command line you might find you have more time for listening to
 music or hanging out with friends.  The command line remains the most
 efficient way to do many things.  For example, I use a mac and I find
 that stuff like moving files around is much more efficient with the
 command line than with Finder, the Mac's file manager.

 Perhaps some day someone will invent a gui with the power, efficiency,
 and flexibility of the command line, but it hasn't happened yet.

 Ian.

 --
 Ian Clarke
 CEO, Uprizer Labs
 Email: i...@uprizer.com
 Ph: +1 512 422 3588
 Fax: +1 512 276 6674
 ___
 Devl mailing list
 Devl@freenetproject.org
 http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

 



   
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl


Re: [freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread bbackde
 Be warned that if you use the puttygen program to create your keypair
 you probably need to reformat the .pub file before uploading.

Can you please tell me more about   reformat the .pub file before uploading.

;)

On Tue, Apr 28, 2009 at 13:44, Ed Tomlinson e...@aei.ca wrote:
 On Tuesday 28 April 2009 01:24:16 bbac...@googlemail.com wrote:
 On Tue, Apr 28, 2009 at 03:08, Daniel Cheng j16sdiz+free...@gmail.com 
 wrote:
  Okay, after reading the irc log, i guess i know what's happending here.
 
  You have to generate a ssh-key using   `ssh-keygen` and upload your
  *.pub file to your github account.

 It seems as I will run into some trouble because I use Windows and all
 those nifty tools and howtos are for Linux
 It will take some time until I can continue to contribute code :(
 Even the egit eclipse plugin often hangs during checkout on my box.
 ___
 Devl mailing list
 Devl@freenetproject.org
 http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

 If you want a good command line ssh client for windows look at putty.
 Be warned that if you use the puttygen program to create your keypair
 you probably need to reformat the .pub file before uploading.

 Ed
 ___
 Devl mailing list
 Devl@freenetproject.org
 http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl




-- 
__
GnuPG key:   (0x48DBFA8A)
Keyserver:   pgpkeys.pca.dfn.de
Fingerprint:
477D F057 1BD4 1AE7 8A54 8679 6690 E2EC 48DB FA8A
__
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl


Re: [freenet-dev] [freenet-cvs] r27121 - trunk/freenet/src/freenet/client/async

2009-04-29 Thread bo-le
Am Mittwoch, 29. April 2009 17:13:11 schrieb Matthew Toseland:
 On Wednesday 29 April 2009 10:39:02 bo-le wrote:
  Am Mittwoch, 29. April 2009 03:21:00 schrieb Matthew Toseland:
   On Monday 20 April 2009 22:21:12 sa...@freenetproject.org wrote:
Author: saces
Date: 2009-04-20 21:21:11 + (Mon, 20 Apr 2009)
New Revision: 27121
   
Modified:
   trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
Log:
teach the SFI how to fetch the new metadata format
  
   (ARCHIVE_METADATA_REDIRECT)
  
needs review
  
   As requested ... this commit has problems...
  
Modified:
trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
===
---
trunk/freenet/src/freenet/client/async/SingleFileFetcher.java   2009-04
   -20
  
   21:16:19 UTC (rev 27120)
  
+++
trunk/freenet/src/freenet/client/async/SingleFileFetcher.java   2009-04
   -20
  
   21:21:11 UTC (rev 27121)
  
@@ -114,7 +114,7 @@
/** Copy constructor, modifies a few given fields, don't call
schedule(). * Used for things like slave fetchers for

 MultiLevelMetadata,

therefore
  
   does not remember returnBucket,
  
 * metaStrings etc. */
-   public SingleFileFetcher(SingleFileFetcher fetcher, boolean

 persistent,

   boolean deleteFetchContext, Metadata newMeta, GetCompletionCallback
   callback, FetchContext ctx2, ObjectContainer container, ClientContext
   context) throws FetchException {
  
+   public SingleFileFetcher(SingleFileFetcher fetcher, boolean

 persistent,

   boolean deleteFetchContext, Metadata newMeta, ArrayListString
   metaStrings2, GetCompletionCallback callback, FetchContext ctx2,
   ObjectContainer container, ClientContext context) throws FetchException
   {
  
// Don't add a block, we have already fetched the data, 
we are
just
  
   handling the metadata in a different fetcher.
  
super(persistent ? fetcher.key.cloneKey() : fetcher.key,
  
   fetcher.maxRetries, ctx2, fetcher.parent, callback, false, true,
   fetcher.token, container, context, deleteFetchContext);
  
if(logMINOR) Logger.minor(this, Creating 
SingleFileFetcher
  
   for +fetcher.key+ meta=+fetcher.metaStrings.toString(), new
   Exception(debug));
  
@@ -128,7 +128,7 @@
this.archiveMetadata = null;
this.clientMetadata = (fetcher.clientMetadata != null ?
  
   fetcher.clientMetadata.clone() : new ClientMetadata());
  
this.metadata = newMeta;
-   this.metaStrings = new ArrayListString();
+   this.metaStrings = metaStrings2;
  
   This should be copied unless you can guarantee that the caller will
   always copy it unless nonpersistent.
  
this.addedMetaStrings = 0;
this.recursionLevel = fetcher.recursionLevel + 1;
if(recursionLevel  ctx.maxRecursionLevel)
@@ -471,6 +471,83 @@
}
metadataBucket.free();
continue;
+   } else if(metadata.isArchiveMetadataRedirect()) 
{
+   if(logMINOR) Logger.minor(this, Is 
archive-metadata);
+   // Fetch it from the archive
+   if(ah == null)
+   throw new 
FetchException(FetchException.UNKNOWN_METADATA,
Archive
  
   redirect not in an archive manifest);
  
+   String filename = 
metadata.getArchiveInternalName();
+   if(logMINOR) Logger.minor(this, 
Fetching +filename);
+   Bucket dataBucket = ah.get(filename, 
actx,
context.archiveManager); +  if(dataBucket 
!= null) {
+   if(logMINOR) Logger.minor(this, 
Returning data);
+   final Metadata newMetadata;
+   try {
+
+   newMetadata = 
Metadata.construct(dataBucket);
+   dataBucket.free();
+   } catch (IOException e) {
+   throw new 
FetchException(FetchException.BUCKET_ERROR);
+   }
+   
continueWithNewMetadata(newMetadata, this.rcb, container,

 context);

+   return;
+   } else {
+   if(logMINOR) Logger.minor(this, 
Fetching archive
  
   

[freenet-dev] staging and official

2009-04-29 Thread Ian Clarke
Are we sure having separate projects for staging and official in
github is the right way to organize this?  I don't see any other
projects on github organized in this way.  Shouldn't they be separate
branches or something, not entire separate projects?

Ian.

-- 
Ian Clarke
CEO, Uprizer Labs
Email: i...@uprizer.com
Ph: +1 512 422 3588
Fax: +1 512 276 6674
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl


Re: [freenet-dev] staging and official

2009-04-29 Thread xor
On Wednesday 29 April 2009 20:52:03 Ian Clarke wrote:
 Are we sure having separate projects for staging and official in
 github is the right way to organize this?  I don't see any other
 projects on github organized in this way.  Shouldn't they be separate
 branches or something, not entire separate projects?

 Ian.

Mmh yes it is annoying to keep separate projects I guess: For example the 
build.xml must be corrected for each project:

- Fred-staging/Fred-official need different build files.
- WoT / Freetalk rely on Fred so the project name on which they are dependent 
will not fit depending on whether you have checked out staging or official of 
Fred.


signature.asc
Description: This is a digitally signed message part.
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Re: [freenet-dev] [freenet-cvs] r27121 - trunk/freenet/src/freenet/client/async

2009-04-29 Thread xor
On Wednesday 29 April 2009 20:32:34 bo-le wrote:


 currently im not able to contribute until im able to serve git.
 i need an (intuitiv) usable git plugin for eclipse or a hg-git bridge¹, i
 will use  continue with whatever what comes first. (i hope its the
 latter.)

I just managed to get Eclipse git working, please try it, it seems useable:
http://www.jgit.org/

For those using the Eclipse update manager they have something there:
If you found yourself this far you may try to install using the update site 
available here. Point the update manager to http://www.jgit.org/update-site  
and install.

If you need any further help getting eclipse git to work please ask me.


 ¹) http://github.com/schacon/hg-git
 ___
 Devl mailing list
 Devl@freenetproject.org
 http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl



signature.asc
Description: This is a digitally signed message part.
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Re: [freenet-dev] Looking for a working Eclipse git plugin

2009-04-29 Thread xor
On Tuesday 28 April 2009 00:11:41 xor wrote:
 Hi,

 I've been trying to set up my IDE to work with git and found the
 following one:

 http://www.jgit.org/

 It pulls, it diffs, everything, but push won't work:
 Can't connect to any URI: git://github.com/freenet/fred-staging.git
 (Transport error occured during push operation: Protocol error: expected
 LF)

 Notice that I did not specify the git:// URI when fetching the
 repository, I used the git@ one and enabled git+ssh.

 Does anyone know of an alternative git plugin for eclipse which is more
 stable?

 Greetings, xor

Eclipse git / JGit (whatever the official name is) seems to work now. Please 
ensure the following if you want to use it:

- Tutorial is available here:
 http://github.com/guides/using-the-egit-eclipse-plugin-with-github

- Use the latest testing version they provide when installing via update 
manager. They seem to have fixed the Protocol error bug today or yesterday or 
so.

- When entering the git@ URI in the import dialog, it will complain Host 
not supported on file protocol, you have to manually chose the git or 
git+ssh protocol in the Connection section of that dialog. All the other 
information is parsed automatically though, Username: git and blank password 
is correct.

xor



signature.asc
Description: This is a digitally signed message part.
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Re: [freenet-dev] staging and official

2009-04-29 Thread Matthew Toseland
On Wednesday 29 April 2009 19:52:03 Ian Clarke wrote:
 Are we sure having separate projects for staging and official in
 github is the right way to organize this?  I don't see any other
 projects on github organized in this way.  Shouldn't they be separate
 branches or something, not entire separate projects?

Security. Anyone with write access (i.e. just about anyone who asks for 
access, whether we trust them or not) can clobber the whole tree or rewrite 
history with a forced (non-fast-forward) update.
 
 Ian.


signature.asc
Description: This is a digitally signed message part.
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Re: [freenet-dev] [freenet-cvs] r27121 - trunk/freenet/src/freenet/client/async

2009-04-29 Thread Matthew Toseland
On Wednesday 29 April 2009 19:32:34 bo-le wrote:
 Am Mittwoch, 29. April 2009 17:13:11 schrieb Matthew Toseland:
  On Wednesday 29 April 2009 10:39:02 bo-le wrote:
   Am Mittwoch, 29. April 2009 03:21:00 schrieb Matthew Toseland:
On Monday 20 April 2009 22:21:12 sa...@freenetproject.org wrote:
 Author: saces
 Date: 2009-04-20 21:21:11 + (Mon, 20 Apr 2009)
 New Revision: 27121

 Modified:
trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
 Log:
 teach the SFI how to fetch the new metadata format
   
(ARCHIVE_METADATA_REDIRECT)
   
 needs review
   
As requested ... this commit has problems...
   
 Modified:
 trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
 ===
 ---
 trunk/freenet/src/freenet/client/async/SingleFileFetcher.java 
2009-04
-20
   
21:16:19 UTC (rev 27120)
   
 +++
 trunk/freenet/src/freenet/client/async/SingleFileFetcher.java 
2009-04
-20
   
21:21:11 UTC (rev 27121)
   
 @@ -114,7 +114,7 @@
   /** Copy constructor, modifies a few given fields, don't call
 schedule(). * Used for things like slave fetchers for
 
  MultiLevelMetadata,
 
 therefore
   
does not remember returnBucket,
   
* metaStrings etc. */
 - public SingleFileFetcher(SingleFileFetcher fetcher, boolean
 
  persistent,
 
boolean deleteFetchContext, Metadata newMeta, GetCompletionCallback
callback, FetchContext ctx2, ObjectContainer container, ClientContext
context) throws FetchException {
   
 + public SingleFileFetcher(SingleFileFetcher fetcher, boolean
 
  persistent,
 
boolean deleteFetchContext, Metadata newMeta, ArrayListString
metaStrings2, GetCompletionCallback callback, FetchContext ctx2,
ObjectContainer container, ClientContext context) throws 
FetchException
{
   
   // Don't add a block, we have already fetched the data, 
 we are
 just
   
handling the metadata in a different fetcher.
   
   super(persistent ? fetcher.key.cloneKey() : fetcher.key,
   
fetcher.maxRetries, ctx2, fetcher.parent, callback, false, true,
fetcher.token, container, context, deleteFetchContext);
   
   if(logMINOR) Logger.minor(this, Creating 
 SingleFileFetcher
   
for +fetcher.key+ meta=+fetcher.metaStrings.toString(), new
Exception(debug));
   
 @@ -128,7 +128,7 @@
   this.archiveMetadata = null;
   this.clientMetadata = (fetcher.clientMetadata != null ?
   
fetcher.clientMetadata.clone() : new ClientMetadata());
   
   this.metadata = newMeta;
 - this.metaStrings = new ArrayListString();
 + this.metaStrings = metaStrings2;
   
This should be copied unless you can guarantee that the caller will
always copy it unless nonpersistent.
   
   this.addedMetaStrings = 0;
   this.recursionLevel = fetcher.recursionLevel + 1;
   if(recursionLevel  ctx.maxRecursionLevel)
 @@ -471,6 +471,83 @@
   }
   metadataBucket.free();
   continue;
 + } else if(metadata.isArchiveMetadataRedirect()) 
 {
 + if(logMINOR) Logger.minor(this, Is 
 archive-metadata);
 + // Fetch it from the archive
 + if(ah == null)
 + throw new 
 FetchException(FetchException.UNKNOWN_METADATA,
 Archive
   
redirect not in an archive manifest);
   
 + String filename = 
 metadata.getArchiveInternalName();
 + if(logMINOR) Logger.minor(this, 
 Fetching +filename);
 + Bucket dataBucket = ah.get(filename, 
 actx,
 context.archiveManager); +if(dataBucket 
 != null) {
 + if(logMINOR) Logger.minor(this, 
 Returning data);
 + final Metadata newMetadata;
 + try {
 +
 + newMetadata = 
 Metadata.construct(dataBucket);
 + dataBucket.free();
 + } catch (IOException e) {
 + throw new 
 FetchException(FetchException.BUCKET_ERROR);
 + }
 + 
 continueWithNewMetadata(newMetadata, this.rcb, container,
 
  context);
 
 + return;
 + } else {
 

Re: [freenet-dev] [freenet-cvs] r27121 - trunk/freenet/src/freenet/client/async

2009-04-29 Thread Matthew Toseland
On Wednesday 29 April 2009 19:32:34 bo-le wrote:
 Am Mittwoch, 29. April 2009 17:13:11 schrieb Matthew Toseland:
  On Wednesday 29 April 2009 10:39:02 bo-le wrote:
   Am Mittwoch, 29. April 2009 03:21:00 schrieb Matthew Toseland:
On Monday 20 April 2009 22:21:12 sa...@freenetproject.org wrote:
 Author: saces
 Date: 2009-04-20 21:21:11 + (Mon, 20 Apr 2009)
 New Revision: 27121

 Modified:
trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
 Log:
 teach the SFI how to fetch the new metadata format
   
(ARCHIVE_METADATA_REDIRECT)
   
 needs review
   
As requested ... this commit has problems...
   
 Modified:
 trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
 ===
 ---
 trunk/freenet/src/freenet/client/async/SingleFileFetcher.java 
2009-04
-20
   
21:16:19 UTC (rev 27120)
   
 +++
 trunk/freenet/src/freenet/client/async/SingleFileFetcher.java 
2009-04
-20
   
21:21:11 UTC (rev 27121)
   
 @@ -114,7 +114,7 @@
   /** Copy constructor, modifies a few given fields, don't call
 schedule(). * Used for things like slave fetchers for
 
  MultiLevelMetadata,
 
 therefore
   
does not remember returnBucket,
   
* metaStrings etc. */
 - public SingleFileFetcher(SingleFileFetcher fetcher, boolean
 
  persistent,
 
boolean deleteFetchContext, Metadata newMeta, GetCompletionCallback
callback, FetchContext ctx2, ObjectContainer container, ClientContext
context) throws FetchException {
   
 + public SingleFileFetcher(SingleFileFetcher fetcher, boolean
 
  persistent,
 
boolean deleteFetchContext, Metadata newMeta, ArrayListString
metaStrings2, GetCompletionCallback callback, FetchContext ctx2,
ObjectContainer container, ClientContext context) throws 
FetchException
{
   
   // Don't add a block, we have already fetched the data, 
 we are
 just
   
handling the metadata in a different fetcher.
   
   super(persistent ? fetcher.key.cloneKey() : fetcher.key,
   
fetcher.maxRetries, ctx2, fetcher.parent, callback, false, true,
fetcher.token, container, context, deleteFetchContext);
   
   if(logMINOR) Logger.minor(this, Creating 
 SingleFileFetcher
   
for +fetcher.key+ meta=+fetcher.metaStrings.toString(), new
Exception(debug));
   
 @@ -128,7 +128,7 @@
   this.archiveMetadata = null;
   this.clientMetadata = (fetcher.clientMetadata != null ?
   
fetcher.clientMetadata.clone() : new ClientMetadata());
   
   this.metadata = newMeta;
 - this.metaStrings = new ArrayListString();
 + this.metaStrings = metaStrings2;
   
This should be copied unless you can guarantee that the caller will
always copy it unless nonpersistent.
   
   this.addedMetaStrings = 0;
   this.recursionLevel = fetcher.recursionLevel + 1;
   if(recursionLevel  ctx.maxRecursionLevel)
 @@ -471,6 +471,83 @@
   }
   metadataBucket.free();
   continue;
 + } else if(metadata.isArchiveMetadataRedirect()) 
 {
 + if(logMINOR) Logger.minor(this, Is 
 archive-metadata);
 + // Fetch it from the archive
 + if(ah == null)
 + throw new 
 FetchException(FetchException.UNKNOWN_METADATA,
 Archive
   
redirect not in an archive manifest);
   
 + String filename = 
 metadata.getArchiveInternalName();
 + if(logMINOR) Logger.minor(this, 
 Fetching +filename);
 + Bucket dataBucket = ah.get(filename, 
 actx,
 context.archiveManager); +if(dataBucket 
 != null) {
 + if(logMINOR) Logger.minor(this, 
 Returning data);
 + final Metadata newMetadata;
 + try {
 +
 + newMetadata = 
 Metadata.construct(dataBucket);
 + dataBucket.free();
 + } catch (IOException e) {
 + throw new 
 FetchException(FetchException.BUCKET_ERROR);
 + }
 + 
 continueWithNewMetadata(newMetadata, this.rcb, container,
 
  context);
 
 + return;
 + } else {
 

Re: [freenet-dev] staging and official

2009-04-29 Thread xor
On Wednesday 29 April 2009 21:36:53 Matthew Toseland wrote:
 On Wednesday 29 April 2009 20:15:43 xor wrote:
  On Wednesday 29 April 2009 20:52:03 Ian Clarke wrote:
   Are we sure having separate projects for staging and official in
   github is the right way to organize this?  I don't see any other
   projects on github organized in this way.  Shouldn't they be separate
   branches or something, not entire separate projects?
  
   Ian.
 
  Mmh yes it is annoying to keep separate projects I guess: For example the
  build.xml must be corrected for each project:
 
  - Fred-staging/Fred-official need different build files.

 They do? Why?

The ant builder (New builder) has a configured build file of:
${workspace_loc:/fred-staging/build.xml}
OR
${workspace_loc:/fred-official/build.xml}


  - WoT / Freetalk rely on Fred so the project name on which they are

 dependent

  will not fit depending on whether you have checked out staging or
  official

 of

  Fred.

 Why is this a problem? Just rename the directory! (Or on a sensible
 operating system use a directory symlink).

I did so, yes. Not really a problem you just have to be smart enough to do so. 
And the last time I renamed the directory it screwed egit up. The safest way 
is to rename before checking out. Or to reconfigure the project dependancies of 
Freetalk / WoT.


signature.asc
Description: This is a digitally signed message part.
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Re: [freenet-dev] [freenet-cvs] r27121 - trunk/freenet/src/freenet/client/async

2009-04-29 Thread Matthew Toseland
On Wednesday 29 April 2009 20:45:52 Matthew Toseland wrote:
 On Wednesday 29 April 2009 19:32:34 bo-le wrote:
  Am Mittwoch, 29. April 2009 17:13:11 schrieb Matthew Toseland:
   On Wednesday 29 April 2009 10:39:02 bo-le wrote:
Am Mittwoch, 29. April 2009 03:21:00 schrieb Matthew Toseland:
 On Monday 20 April 2009 22:21:12 sa...@freenetproject.org wrote:
  Author: saces
  Date: 2009-04-20 21:21:11 + (Mon, 20 Apr 2009)
  New Revision: 27121
 
  Modified:
 trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
  Log:
  teach the SFI how to fetch the new metadata format

 (ARCHIVE_METADATA_REDIRECT)

  needs review

 As requested ... this commit has problems...

  Modified:
  trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
  
===
  ---
  trunk/freenet/src/freenet/client/async/SingleFileFetcher.java   
 2009-04
 -20

 21:16:19 UTC (rev 27120)

  +++
  trunk/freenet/src/freenet/client/async/SingleFileFetcher.java   
 2009-04
 -20

 21:21:11 UTC (rev 27121)

  @@ -114,7 +114,7 @@
  /** Copy constructor, modifies a few given fields, don't call
  schedule(). * Used for things like slave fetchers for
  
   MultiLevelMetadata,
  
  therefore

 does not remember returnBucket,

   * metaStrings etc. */
  -   public SingleFileFetcher(SingleFileFetcher fetcher, boolean
  
   persistent,
  
 boolean deleteFetchContext, Metadata newMeta, GetCompletionCallback
 callback, FetchContext ctx2, ObjectContainer container, 
ClientContext
 context) throws FetchException {

  +   public SingleFileFetcher(SingleFileFetcher fetcher, boolean
  
   persistent,
  
 boolean deleteFetchContext, Metadata newMeta, ArrayListString
 metaStrings2, GetCompletionCallback callback, FetchContext ctx2,
 ObjectContainer container, ClientContext context) throws 
 FetchException
 {

  // Don't add a block, we have already fetched the data, 
  we are
  just

 handling the metadata in a different fetcher.

  super(persistent ? fetcher.key.cloneKey() : fetcher.key,

 fetcher.maxRetries, ctx2, fetcher.parent, callback, false, true,
 fetcher.token, container, context, deleteFetchContext);

  if(logMINOR) Logger.minor(this, Creating 
  SingleFileFetcher

 for +fetcher.key+ meta=+fetcher.metaStrings.toString(), new
 Exception(debug));

  @@ -128,7 +128,7 @@
  this.archiveMetadata = null;
  this.clientMetadata = (fetcher.clientMetadata != null ?

 fetcher.clientMetadata.clone() : new ClientMetadata());

  this.metadata = newMeta;
  -   this.metaStrings = new ArrayListString();
  +   this.metaStrings = metaStrings2;

 This should be copied unless you can guarantee that the caller will
 always copy it unless nonpersistent.

  this.addedMetaStrings = 0;
  this.recursionLevel = fetcher.recursionLevel + 1;
  if(recursionLevel  ctx.maxRecursionLevel)
  @@ -471,6 +471,83 @@
  }
  metadataBucket.free();
  continue;
  +   } else if(metadata.isArchiveMetadataRedirect()) 
  {
  +   if(logMINOR) Logger.minor(this, Is 
  archive-metadata);
  +   // Fetch it from the archive
  +   if(ah == null)
  +   throw new 
  FetchException(FetchException.UNKNOWN_METADATA,
  Archive

 redirect not in an archive manifest);

  +   String filename = 
  metadata.getArchiveInternalName();
  +   if(logMINOR) Logger.minor(this, 
  Fetching +filename);
  +   Bucket dataBucket = ah.get(filename, 
  actx,
  context.archiveManager); +  if(dataBucket 
  != null) {
  +   if(logMINOR) Logger.minor(this, 
  Returning data);
  +   final Metadata newMetadata;
  +   try {
  +
  +   newMetadata = 
  Metadata.construct(dataBucket);
  +   dataBucket.free();
  +   } catch (IOException e) {
  +   throw new 
  FetchException(FetchException.BUCKET_ERROR);
  +   }
  +   
  

Re: [freenet-dev] staging and official

2009-04-29 Thread Matthew Toseland
On Wednesday 29 April 2009 20:51:45 xor wrote:
 On Wednesday 29 April 2009 21:36:53 Matthew Toseland wrote:
  On Wednesday 29 April 2009 20:15:43 xor wrote:
   On Wednesday 29 April 2009 20:52:03 Ian Clarke wrote:
Are we sure having separate projects for staging and official in
github is the right way to organize this?  I don't see any other
projects on github organized in this way.  Shouldn't they be separate
branches or something, not entire separate projects?
   
Ian.
  
   Mmh yes it is annoying to keep separate projects I guess: For example 
the
   build.xml must be corrected for each project:
  
   - Fred-staging/Fred-official need different build files.
 
  They do? Why?
 
 The ant builder (New builder) has a configured build file of:
 ${workspace_loc:/fred-staging/build.xml}
 OR
 ${workspace_loc:/fred-official/build.xml}

Ugh. Well the project can be called anything...
 
 
   - WoT / Freetalk rely on Fred so the project name on which they are
 
  dependent
 
   will not fit depending on whether you have checked out staging or
   official
 
  of
 
   Fred.
 
  Why is this a problem? Just rename the directory! (Or on a sensible
  operating system use a directory symlink).
 
 I did so, yes. Not really a problem you just have to be smart enough to do 
so. 
 And the last time I renamed the directory it screwed egit up. The safest way 
 is to rename before checking out. Or to reconfigure the project dependancies 
of 
 Freetalk / WoT.

Aaaargh. Well, egit sucks, we have established this. git itself doesn't care 
what the directory is called.


signature.asc
Description: This is a digitally signed message part.
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Re: [freenet-dev] [freenet-cvs] r27137 - trunk/freenet/src/freenet/support/io

2009-04-29 Thread Matthew Toseland
On Wednesday 29 April 2009 16:39:38 Daniel Cheng wrote:
 On Wed, Apr 29, 2009 at 11:14 PM, Matthew Toseland
 t...@amphibian.dyndns.org wrote:
  On Wednesday 29 April 2009 02:58:48 Daniel Cheng wrote:
  On Wed, Apr 29, 2009 at 9:21 AM, Matthew Toseland
  t...@amphibian.dyndns.org wrote:
   On Tuesday 21 April 2009 08:55:53 j16s...@freenetproject.org wrote:
   Author: j16sdiz
   Date: 2009-04-21 07:55:52 + (Tue, 21 Apr 2009)
   New Revision: 27137
  
   Modified:
      trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
   Log:
   Fix inputStream count
  
   What's the difference? Apart from your version breaks on an OOM and the
   previous version didn't?
 
 
  If you close it twice, the counter get decreased twice.
 
  Doh! But why the inputStreams inc move?
 
 hmm.. it does nothing different.
 it should not have been committed.

Fixed in 126c11e
 
  
   Modified:
  trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
   ===
   --- trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
   2009-04-21 07:55:31 UTC (rev 27136)
   +++ trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
   2009-04-21 07:55:52 UTC (rev 27137)
   @@ -75,17 +75,15 @@
         public InputStream getInputStream() throws IOException {
                 if(freed) throw new IOException(Already freed);
                 final FileChannel channel = factory.channel;
   +
   +             synchronized(PersistentBlobTempBucket.this) {
   +                     inputStreams++;
   +             }
   +
                 return new InputStream() {
   -
                         private int offset;
                         private boolean closed;
  
   -                     {
   -                             
synchronized(PersistentBlobTempBucket.this)
  {
   -                                     inputStreams++;
   -                             }
   -                     }
   -
                         @Override
                         public int read() throws IOException {
                                 if (closed) throw new
  IOException(closed);
   @@ -130,6 +128,7 @@
  
                         @Override
                         public void close() {
   +                             if (closed) return;
                                 closed = true;
  
                                 
synchronized(PersistentBlobTempBucket.this)
  {
  
   ___
   cvs mailing list
   c...@freenetproject.org
   http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
  
  
  
  
  
   ___
   Devl mailing list
   Devl@freenetproject.org
   http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
  
  ___
  Devl mailing list
  Devl@freenetproject.org
  http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
 
 
 
 
 
  ___
  Devl mailing list
  Devl@freenetproject.org
  http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
 
 ___
 Devl mailing list
 Devl@freenetproject.org
 http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
 
 




signature.asc
Description: This is a digitally signed message part.
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Re: [freenet-dev] staging and official

2009-04-29 Thread Ian Clarke
On Wed, Apr 29, 2009 at 2:38 PM, Matthew Toseland
t...@amphibian.dyndns.org wrote:
 On Wednesday 29 April 2009 19:52:03 Ian Clarke wrote:
 Are we sure having separate projects for staging and official in
 github is the right way to organize this?  I don't see any other
 projects on github organized in this way.  Shouldn't they be separate
 branches or something, not entire separate projects?

 Security. Anyone with write access (i.e. just about anyone who asks for
 access, whether we trust them or not) can clobber the whole tree or rewrite
 history with a forced (non-fast-forward) update.

Are you sure there is no way to limit access on a per-branch basis?
Have you asked on #github or #git on freenode?

This seems inelegant.

Ian.

-- 
Ian Clarke
CEO, Uprizer Labs
Email: i...@uprizer.com
Ph: +1 512 422 3588
Fax: +1 512 276 6674
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl


Re: [freenet-dev] [freenet-cvs] r26261 - trunk/contrib/fec/src/csrc

2009-04-29 Thread Matthew Toseland
On Tuesday 31 March 2009 02:27:09 j16s...@freenetproject.org wrote:
 Author: j16sdiz
 Date: 2009-03-31 01:27:08 + (Tue, 31 Mar 2009)
 New Revision: 26261
 
 Modified:
trunk/contrib/fec/src/csrc/Makefile
 Log:
 Remove the reference to assembly in Makefile

What about embedded systems? Don't we want to keep this around if only 
commented out?
 
 Modified: trunk/contrib/fec/src/csrc/Makefile
 ===
 --- trunk/contrib/fec/src/csrc/Makefile   2009-03-30 23:51:44 UTC (rev 
 26260)
 +++ trunk/contrib/fec/src/csrc/Makefile   2009-03-31 01:27:08 UTC (rev 
 26261)
 @@ -1,12 +1,6 @@
  #
  # makefile for vdm.
  #
 -# fec.S.980624a is an optimized version for use on 486 and old pentium
 -# machines. It is only for GF_BITS=8 and generally does not work
 -# fast on systems with multiple instruction pipelines (PentiumPro,
 -# Pentium2)
 -# same for fec.S16.980624a , for use with GF_BITS=16
 -#
  # gcc does something strange, so check the various opt. levels for
  # best performance (or write addmul1 in assembly code).
  #
 @@ -18,9 +12,7 @@
  # COPT= -O9 -funroll-loops
  COPT= -O1
  CFLAGS=$(COPT) -Wall -fPIC# -DTEST -pedantic
 -SRCS= fec.c Makefile test.c fec.s.980621e \
 - fec.S.980624a \
 - fec.S16.980624a
 +SRCS= fec.c Makefile test.c
  DOCS= README fec.3
  ALLSRCS= $(SRCS) $(DOCS) fec.h


signature.asc
Description: This is a digitally signed message part.
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Re: [freenet-dev] CMKs don't work, but there are other options was Re: Easy top block duplication: Content Multiplication Keys

2009-04-29 Thread bbackde
Could a client keep the top block available by requesting it lets say
once per day?
When the MaxSize option is used this could be a cheap request.

On Thu, Apr 23, 2009 at 04:03, Matthew Toseland
t...@amphibian.dyndns.org wrote:
 Argh, no, this doesn't work, because the pubkey is known, and there is no way
 for the node to verify that the content is in fact valid. An attacker can not
 only cause collisions, he can preemptively block known content by inserting
 bogus data to where it would be posted.

 So what does that leave?

 On Thursday 23 April 2009 01:48:46 Matthew Toseland wrote:
 1) Duplicate the top block with SSKs:
 SSK,3@pubkey,cryptokey,extra/filename would insert e.g.
 SSK@pubkey,cryptokey,extra/filename-N for a series of N's.

 Make cryptokey the hash of the content, avoids different-content attacks.

 2) CHKs with extra routing keys:
 CHK@routing key 1,routing key 2,routing key 3,crypto key,extra

 Replace crypto key with the hash of the content, and derive the crypto key for
 each block:
 cryptokey_N = H ( H(data) + N )

 3) Reinserting the top block when a download has finished, and also at some
 point after inserting the data. IMHO this may help, but it does not address
 the core problem. We need redundancy over *different areas of the keyspace*.

 4) An FCP command to reinsert a file, given a known top-block key. If we
 cannot reconstruct as-is, we fail, but if we can, we reinsert that block
 (exactly as is, like a binary blob), and the rest of the CHK-based blocks
 under it.

 Maybe a combination of 1) and 4) ?

 On first insert:
 User inserts the data as DSK,3@/filename.
 The node creates a random pubkey, and hashes the content of the top block to
 get the cryptokey. It inserts each block, and returns
 DSK,3@pubkey,cryptokey,extra/filename

 The filename could be ignored if we want.

 On reinsert:
 The original URI must be specified, and have been downloaded. If it is kept on
 the download queue then we can simply click a button to reinsert.

 For SSKs:
 User inserts the data as SSK,3@privkey,cryptokey,extra/filename

 We insert to SSK@pubkey,cryptokey,extra/filename-N for N in 0, 1, 2.

 Since the URI is not content-derived, there is the possibility of the inserter
 will insert different content to each slot. AFAICS this cannot be avoided.

 The major disadvantages are:
 - When reinserting we MUST know the original URI.
 - There is no way to heal the alternate top-blocks.

 IMHO the latter is more serious than the former, but full convergence would be
 ideal. Option 2 has neither of these problems, but does have very long URIs.
 Mostly keys are copied and pasted, so maybe that isn't a big problem?

 If people are happy with option 2 (very long CHKs), I can implement it
 reasonably quickly...

 Neither of these schemes is acceptable IMHO. The former allows for an
 attacker
 to insert different content to different keys, and get some info about
 targets that way, and it is non-convergent, not allowing for reinserts. The
 latter doubles the length of the already way too long CHKs.

 I propose a new key type which is convergent, has URIs shorter than existing
 CHKs, and any number of duplicate blocks: the Content Multiplication Key
 (for
 want of a better name, alternatives are welcome).

 DETAILS:

 Insert the splitfile normally, except for the top block. The top block must
 fit inside a 1KB SSK payload.

 Hash the content of the top block:

 hash of content: H(data)

 Create a private key:

 privkey = MAKE_PRIVKEY ( H ( H(data) + 0 ) )

 Create the base crypto key:

 ckey_base = H ( H ( data + 1 ) )

 Create a series of crypto keys:

 ckey_N = H ( ckey_base + N )

 Insert to a series of SSKs:

 SSK@privkey,ckey_N,extra

 Announce the key:

 UMK,N@H(data),extra/filename
 (Where N is the number of copies inserted)

 The filename is ignored. This will make the Frost folk happy.




 ___
 Devl mailing list
 Devl@freenetproject.org
 http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl




-- 
__
GnuPG key:   (0x48DBFA8A)
Keyserver:   pgpkeys.pca.dfn.de
Fingerprint:
477D F057 1BD4 1AE7 8A54 8679 6690 E2EC 48DB FA8A
__
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl


Re: [freenet-dev] [freenet-cvs] r26946 - branches/nextgens-stuffs/freenet/src/freenet/io/comm

2009-04-29 Thread Matthew Toseland
In case you might want to reuse this code...

On Friday 17 April 2009 18:12:49 nextg...@freenetproject.org wrote:
 Author: nextgens
 Date: 2009-04-17 17:12:49 + (Fri, 17 Apr 2009)
 New Revision: 26946
 
 Modified:
branches/nextgens-stuffs/freenet/src/freenet/io/comm/MessageCore.java
 Log:
 Reduce locking on MessageCore.
 
 Needs to be tested ^-^
 
 Modified: 
branches/nextgens-stuffs/freenet/src/freenet/io/comm/MessageCore.java
 ===
 --- branches/nextgens-stuffs/freenet/src/freenet/io/comm/MessageCore.java 
2009-04-17 16:58:16 UTC (rev 26945)
 +++ branches/nextgens-stuffs/freenet/src/freenet/io/comm/MessageCore.java 
2009-04-17 17:12:49 UTC (rev 26946)
...
 @@ -115,14 +121,21 @@
   // Avoids exhaustive and unsuccessful search in waitFor() 
 removal of a 
timed out filter.
   if(logMINOR)
   Logger.minor(this, Removing timed out filters);
 - synchronized (_filters) {
 +
 + try {
 + messageFiltersWriteLock.lock();
   for(LinkedListMessageFilter mfl : _filters.values()) {
   for (ListIteratorMessageFilter i = 
 mfl.listIterator(); i.hasNext();) 
{
   MessageFilter f = i.next();
   if (f.timedOut(tStart)) {
   if(logMINOR)
   Logger.minor(this, 
 Removing +f);
 - i.remove();
 + try {
 + 
 messageFiltersWriteLock.lock();

You seem to be taking the same lock twice here. Presumably you meant to take 
the ReadLock?
...
 @@ -245,7 +279,14 @@
   }
   if(!matched) {
   while (_unclaimed.size()  
 MAX_UNMATCHED_FIFO_SIZE) {
 - Message removed = 
 _unclaimed.removeFirst();
 + Message removed = null;
 + try {
 + 
 messageFiltersWriteLock.lock();
 + 
 _unclaimed.removeFirst();
 + } finally {
 + 
 messageFiltersWriteLock.unlock();
 + }
 + if(removed == null) continue;

removed is never set.
...
 @@ -500,11 +582,14 @@
   if(!filter.matched()) {
   // We must remove it from _filters before we return, or 
 when it is 
re-added,
   // it will be in the list twice, and potentially many 
 more times than 
twice!
 - synchronized(_filters) {
 + try {
   // Fortunately, it will be close to the 
 beginning of the filters list, 
having
   // just timed out. That is assuming it hasn't 
 already been removed; in 
that
   // case, this will be slower.
 + messageFiltersWriteLock.lock();
   _filters.remove(filter);

This can't work, why is it not a compile error? You're removing a 
MessageFilter from a TreeSet of LinkedListMessageFilter !


signature.asc
Description: This is a digitally signed message part.
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Re: [freenet-dev] [freenet-cvs] r27218 - in trunk/contrib/fec/src: com/onionnetworks/fec csrc

2009-04-29 Thread Matthew Toseland
On Thursday 23 April 2009 02:40:26 j16s...@freenetproject.org wrote:
 Author: j16sdiz
 Date: 2009-04-23 01:40:25 + (Thu, 23 Apr 2009)
 New Revision: 27218
 
 Modified:
trunk/contrib/fec/src/com/onionnetworks/fec/Native16Code.java
trunk/contrib/fec/src/com/onionnetworks/fec/Native8Code.java
trunk/contrib/fec/src/csrc/com_onionnetworks_fec_Native16Code.h
trunk/contrib/fec/src/csrc/com_onionnetworks_fec_Native8Code.h
trunk/contrib/fec/src/csrc/fec16-jinterf.c
trunk/contrib/fec/src/csrc/fec8-jinterf.c
 Log:
 Use GetLongField() / SetLongField()
 
...
 Modified: trunk/contrib/fec/src/csrc/fec8-jinterf.c
 ===
 --- trunk/contrib/fec/src/csrc/fec8-jinterf.c 2009-04-23 01:40:07 UTC (rev 
27217)
 +++ trunk/contrib/fec/src/csrc/fec8-jinterf.c 2009-04-23 01:40:25 UTC (rev 
27218)
...
  
 -/*
 - * The data[] MUST be preshuffled before this call is made or it WILL NOT
 - * WORK!  It is very difficult to make Java aware that the pointers have
 - * been shuffled in the encode() call, so we must pre-shuffle the data
 - * so that encode doesn't move any pointers around.
 - */

Why delete this comment? And the one in fec16-jinterf too?


signature.asc
Description: This is a digitally signed message part.
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Re: [freenet-dev] [freenet-cvs] r26942 - branches/nextgens-stuffs/freenet/src/freenet/io/comm

2009-04-29 Thread Matthew Toseland
On Friday 17 April 2009 17:42:03 nextg...@freenetproject.org wrote:
 Author: nextgens
 Date: 2009-04-17 16:42:03 + (Fri, 17 Apr 2009)
 New Revision: 26942
 
 Modified:
branches/nextgens-stuffs/freenet/src/freenet/io/comm/MessageCore.java
 Log:
 More optimization: sort the MessageFilters by Peer to speedup matching
 
 Modified: 
branches/nextgens-stuffs/freenet/src/freenet/io/comm/MessageCore.java
 ===
 --- branches/nextgens-stuffs/freenet/src/freenet/io/comm/MessageCore.java 
2009-04-17 16:32:59 UTC (rev 26941)
 +++ branches/nextgens-stuffs/freenet/src/freenet/io/comm/MessageCore.java 
2009-04-17 16:42:03 UTC (rev 26942)
...

Neither of the below makes sense, if you're thinking of reusing this code. You 
add the filter to the list for *every* Peer, afaics.

 @@ -352,20 +373,22 @@
   if (ret == null) {
   if(logMINOR) Logger.minor(this, Not in 
 _unclaimed);
   // Insert filter into filter list in order of 
 timeout
 - ListIteratorMessageFilter i = 
 _filters.listIterator();
 - while (true) {
 - if (!i.hasNext()) {
 - i.add(filter);
 - if(logMINOR) Logger.minor(this, 
 Added at end);
 - break;
 + for(LinkedListMessageFilter list : 
 _filters.values()) {
 + ListIteratorMessageFilter i = 
 list.listIterator();
 + while (true) {
 + if (!i.hasNext()) {
 + i.add(filter);
 + if(logMINOR) 
 Logger.minor(this, Added at end);
 + break;
 + }
 + MessageFilter mf = i.next();
 + if (mf.getTimeout()  
 filter.getTimeout()) {
 + i.previous();
 + i.add(filter);
 + if(logMINOR) 
 Logger.minor(this, Added in middle - mf 
timeout=+mf.getTimeout()+ - my timeout=+filter.getTimeout());
 + break;
 + }
   }
 - MessageFilter mf = i.next();
 - if (mf.getTimeout()  
 filter.getTimeout()) {
 - i.previous();
 - i.add(filter);
 - if(logMINOR) Logger.minor(this, 
 Added in middle - mf 
timeout=+mf.getTimeout()+ - my timeout=+filter.getTimeout());
 - break;
 - }
   }
   }
   }
 @@ -424,20 +447,22 @@
   if (ret == null) {
   if(logMINOR) Logger.minor(this, Not in 
 _unclaimed);
   // Insert filter into filter list in order of 
 timeout
 - ListIteratorMessageFilter i = 
 _filters.listIterator();
 - while (true) {
 - if (!i.hasNext()) {
 - i.add(filter);
 - if(logMINOR) Logger.minor(this, 
 Added at end);
 - break;
 + for(LinkedListMessageFilter list : 
 _filters.values()) {
 + ListIteratorMessageFilter i = 
 list.listIterator();
 + while (true) {
 + if (!i.hasNext()) {
 + i.add(filter);
 + if(logMINOR) 
 Logger.minor(this, Added at end);
 + break;
 + }
 + MessageFilter mf = i.next();
 + if (mf.getTimeout()  
 filter.getTimeout()) {
 + i.previous();
 + i.add(filter);
 + if(logMINOR) 
 Logger.minor(this, Added in middle - mf 
timeout=+mf.getTimeout()+ - my 

Re: [freenet-dev] [freenet-cvs] r26261 - trunk/contrib/fec/src/csrc

2009-04-29 Thread Daniel Cheng
On Thu, Apr 30, 2009 at 5:07 AM, Matthew Toseland
t...@amphibian.dyndns.org wrote:
 On Tuesday 31 March 2009 02:27:09 j16s...@freenetproject.org wrote:
 Author: j16sdiz
 Date: 2009-03-31 01:27:08 + (Tue, 31 Mar 2009)
 New Revision: 26261

 Modified:
    trunk/contrib/fec/src/csrc/Makefile
 Log:
 Remove the reference to assembly in Makefile

 What about embedded systems? Don't we want to keep this around if only
 commented out?

The zip file does _NOT_ have those assemble files.
This patch remove the reference to the (non-existing) files in makefile.
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl


Re: [freenet-dev] [freenet-cvs] r27218 - in trunk/contrib/fec/src: com/onionnetworks/fec csrc

2009-04-29 Thread Daniel Cheng
On Thu, Apr 30, 2009 at 8:02 AM, Matthew Toseland
t...@amphibian.dyndns.org wrote:
 On Thursday 23 April 2009 02:40:26 j16s...@freenetproject.org wrote:
 Author: j16sdiz
 Date: 2009-04-23 01:40:25 + (Thu, 23 Apr 2009)
 New Revision: 27218

 Modified:
    trunk/contrib/fec/src/com/onionnetworks/fec/Native16Code.java
    trunk/contrib/fec/src/com/onionnetworks/fec/Native8Code.java
    trunk/contrib/fec/src/csrc/com_onionnetworks_fec_Native16Code.h
    trunk/contrib/fec/src/csrc/com_onionnetworks_fec_Native8Code.h
    trunk/contrib/fec/src/csrc/fec16-jinterf.c
    trunk/contrib/fec/src/csrc/fec8-jinterf.c
 Log:
 Use GetLongField() / SetLongField()

 ...
 Modified: trunk/contrib/fec/src/csrc/fec8-jinterf.c
 ===
 --- trunk/contrib/fec/src/csrc/fec8-jinterf.c 2009-04-23 01:40:07 UTC (rev
 27217)
 +++ trunk/contrib/fec/src/csrc/fec8-jinterf.c 2009-04-23 01:40:25 UTC (rev
 27218)
 ...

 -/*
 - * The data[] MUST be preshuffled before this call is made or it WILL NOT
 - * WORK!  It is very difficult to make Java aware that the pointers have
 - * been shuffled in the encode() call, so we must pre-shuffle the data
 - * so that encode doesn't move any pointers around.
 - */

 Why delete this comment? And the one in fec16-jinterf too?

No specific reason.
I was syncing fec8-jinterf.c and fec16-jinterf.c so they look identical
in layout and comments.
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl


Re: [freenet-dev] staging and official

2009-04-29 Thread Daniel Cheng
On Thu, Apr 30, 2009 at 4:47 AM, Ian Clarke i...@locut.us wrote:
 On Wed, Apr 29, 2009 at 2:38 PM, Matthew Toseland
 t...@amphibian.dyndns.org wrote:
 On Wednesday 29 April 2009 19:52:03 Ian Clarke wrote:
 Are we sure having separate projects for staging and official in
 github is the right way to organize this?  I don't see any other
 projects on github organized in this way.  Shouldn't they be separate
 branches or something, not entire separate projects?

 Security. Anyone with write access (i.e. just about anyone who asks for
 access, whether we trust them or not) can clobber the whole tree or rewrite
 history with a forced (non-fast-forward) update.

 Are you sure there is no way to limit access on a per-branch basis?
 Have you asked on #github or #git on freenode?

There are no way to do this in github.
All other git user user their own private branch, and seldom give out
write access like we do.

 This seems inelegant.

This is different workflow.
Most git project use the pull model -- the maintainer pull from
other developer.

see @http://github.com/blog/270-the-fork-queue for example on how
others do this.

 Ian.

___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl


Re: [freenet-dev] [freenet-cvs] r27197 - trunk/freenet/src/freenet/crypt

2009-04-29 Thread Daniel Cheng
2009/4/30 Matthew Toseland t...@amphibian.dyndns.org:
 On Wednesday 22 April 2009 08:28:30 j16s...@freenetproject.org wrote:
 Author: j16sdiz
 Date: 2009-04-22 07:28:30 + (Wed, 22 Apr 2009)
 New Revision: 27197

 Removed:
    trunk/freenet/src/freenet/crypt/DSAGroupGenerator.java
 Log:
 Unused class: DSAGroupGenerator

 Please reinstate. This is how we prove that our group wasn't engineered to be
 weak.

We can move this to   test (not src/), right?
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl


Re: [freenet-dev] [freenet-cvs] r27197 - trunk/freenet/src/freenet/crypt

2009-04-29 Thread Matthew Toseland
On Thursday 30 April 2009 01:13:13 Daniel Cheng wrote:
 2009/4/30 Matthew Toseland t...@amphibian.dyndns.org:
  On Wednesday 22 April 2009 08:28:30 j16s...@freenetproject.org wrote:
  Author: j16sdiz
  Date: 2009-04-22 07:28:30 + (Wed, 22 Apr 2009)
  New Revision: 27197
 
  Removed:
     trunk/freenet/src/freenet/crypt/DSAGroupGenerator.java
  Log:
  Unused class: DSAGroupGenerator
 
  Please reinstate. This is how we prove that our group wasn't engineered to 
be
  weak.
 
 We can move this to   test (not src/), right?

Possibly. It's not really a test, but there's no reason to ship it with the 
node binary.


signature.asc
Description: This is a digitally signed message part.
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Re: [freenet-dev] [freenet-cvs] r27218 - in trunk/contrib/fec/src: com/onionnetworks/fec csrc

2009-04-29 Thread Matthew Toseland
On Thursday 30 April 2009 01:03:58 Daniel Cheng wrote:
 On Thu, Apr 30, 2009 at 8:02 AM, Matthew Toseland
 t...@amphibian.dyndns.org wrote:
  On Thursday 23 April 2009 02:40:26 j16s...@freenetproject.org wrote:
  Author: j16sdiz
  Date: 2009-04-23 01:40:25 + (Thu, 23 Apr 2009)
  New Revision: 27218
 
  Modified:
     trunk/contrib/fec/src/com/onionnetworks/fec/Native16Code.java
     trunk/contrib/fec/src/com/onionnetworks/fec/Native8Code.java
     trunk/contrib/fec/src/csrc/com_onionnetworks_fec_Native16Code.h
     trunk/contrib/fec/src/csrc/com_onionnetworks_fec_Native8Code.h
     trunk/contrib/fec/src/csrc/fec16-jinterf.c
     trunk/contrib/fec/src/csrc/fec8-jinterf.c
  Log:
  Use GetLongField() / SetLongField()
 
  ...
  Modified: trunk/contrib/fec/src/csrc/fec8-jinterf.c
  ===
  --- trunk/contrib/fec/src/csrc/fec8-jinterf.c 2009-04-23 01:40:07 UTC 
(rev
  27217)
  +++ trunk/contrib/fec/src/csrc/fec8-jinterf.c 2009-04-23 01:40:25 UTC 
(rev
  27218)
  ...
 
  -/*
  - * The data[] MUST be preshuffled before this call is made or it WILL 
NOT
  - * WORK!  It is very difficult to make Java aware that the pointers have
  - * been shuffled in the encode() call, so we must pre-shuffle the data
  - * so that encode doesn't move any pointers around.
  - */
 
  Why delete this comment? And the one in fec16-jinterf too?
 
 No specific reason.
 I was syncing fec8-jinterf.c and fec16-jinterf.c so they look identical
 in layout and comments.

Both of them had that comment. Would you mind reinstating it?


signature.asc
Description: This is a digitally signed message part.
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Re: [freenet-dev] CMKs don't work, but there are other options was Re: Easy top block duplication: Content Multiplication Keys

2009-04-29 Thread Matthew Toseland
On Wednesday 29 April 2009 23:12:09 bbac...@googlemail.com wrote:
 Could a client keep the top block available by requesting it lets say
 once per day?
 When the MaxSize option is used this could be a cheap request.

No. It might help if it was from a different location on the network each 
time, but this would require something resembling tunnels, which we don't 
have yet. Right now it would just ensure that your node cached it, and if you 
told it to ignore the local datastore, that your nearest neighbour to the key 
cached it.

Further, this does not solve the fundamental problem, which is that data will 
fall out of caches quickly, and is only stored on 3 nodes, and there's a good 
chance of all 3 of them being offline, or having left, at the time of the 
fetch. Although we do try to deal with this to some degree by ignoring low 
uptime nodes when calculating whether we are a sink ( = whether to store an 
insert in the store). Another issue is tolerance of weakness in specific 
areas of the keyspace. We have redundancy for lower down blocks, it makes 
sense to have redundancy for the top block.

Is the length of a DHK a problem?
 
 On Thu, Apr 23, 2009 at 04:03, Matthew Toseland
 t...@amphibian.dyndns.org wrote:
  Argh, no, this doesn't work, because the pubkey is known, and there is no 
way
  for the node to verify that the content is in fact valid. An attacker can 
not
  only cause collisions, he can preemptively block known content by 
inserting
  bogus data to where it would be posted.
 
  So what does that leave?
 
  On Thursday 23 April 2009 01:48:46 Matthew Toseland wrote:
  1) Duplicate the top block with SSKs:
  SSK,3@pubkey,cryptokey,extra/filename would insert e.g.
  SSK@pubkey,cryptokey,extra/filename-N for a series of N's.
 
  Make cryptokey the hash of the content, avoids different-content attacks.
 
  2) CHKs with extra routing keys:
  CHK@routing key 1,routing key 2,routing key 3,crypto key,extra
 
  Replace crypto key with the hash of the content, and derive the crypto key 
for
  each block:
  cryptokey_N = H ( H(data) + N )
 
  3) Reinserting the top block when a download has finished, and also at 
some
  point after inserting the data. IMHO this may help, but it does not 
address
  the core problem. We need redundancy over *different areas of the 
keyspace*.
 
  4) An FCP command to reinsert a file, given a known top-block key. If we
  cannot reconstruct as-is, we fail, but if we can, we reinsert that block
  (exactly as is, like a binary blob), and the rest of the CHK-based blocks
  under it.
 
  Maybe a combination of 1) and 4) ?
 
  On first insert:
  User inserts the data as DSK,3@/filename.
  The node creates a random pubkey, and hashes the content of the top block 
to
  get the cryptokey. It inserts each block, and returns
  DSK,3@pubkey,cryptokey,extra/filename
 
  The filename could be ignored if we want.
 
  On reinsert:
  The original URI must be specified, and have been downloaded. If it is 
kept on
  the download queue then we can simply click a button to reinsert.
 
  For SSKs:
  User inserts the data as SSK,3@privkey,cryptokey,extra/filename
 
  We insert to SSK@pubkey,cryptokey,extra/filename-N for N in 0, 
1, 2.
 
  Since the URI is not content-derived, there is the possibility of the 
inserter
  will insert different content to each slot. AFAICS this cannot be avoided.
 
  The major disadvantages are:
  - When reinserting we MUST know the original URI.
  - There is no way to heal the alternate top-blocks.
 
  IMHO the latter is more serious than the former, but full convergence 
would be
  ideal. Option 2 has neither of these problems, but does have very long 
URIs.
  Mostly keys are copied and pasted, so maybe that isn't a big problem?
 
  If people are happy with option 2 (very long CHKs), I can implement it
  reasonably quickly...
 
  Neither of these schemes is acceptable IMHO. The former allows for an
  attacker
  to insert different content to different keys, and get some info about
  targets that way, and it is non-convergent, not allowing for reinserts. 
The
  latter doubles the length of the already way too long CHKs.
 
  I propose a new key type which is convergent, has URIs shorter than 
existing
  CHKs, and any number of duplicate blocks: the Content Multiplication Key
  (for
  want of a better name, alternatives are welcome).
 
  DETAILS:
 
  Insert the splitfile normally, except for the top block. The top block 
must
  fit inside a 1KB SSK payload.
 
  Hash the content of the top block:
 
  hash of content: H(data)
 
  Create a private key:
 
  privkey = MAKE_PRIVKEY ( H ( H(data) + 0 ) )
 
  Create the base crypto key:
 
  ckey_base = H ( H ( data + 1 ) )
 
  Create a series of crypto keys:
 
  ckey_N = H ( ckey_base + N )
 
  Insert to a series of SSKs:
 
  SSK@privkey,ckey_N,extra
 
  Announce the key:
 
  UMK,N@H(data),extra/filename
  (Where N is the number of copies inserted)
 
  The filename is ignored. This will make the Frost folk happy.
 
 
 

Re: [freenet-dev] [freenet-cvs] r27197 - trunk/freenet/src/freenet/crypt

2009-04-29 Thread Daniel Cheng
On Thu, Apr 30, 2009 at 8:36 AM, Matthew Toseland
t...@amphibian.dyndns.org wrote:
 On Thursday 30 April 2009 01:13:13 Daniel Cheng wrote:
 2009/4/30 Matthew Toseland t...@amphibian.dyndns.org:
  On Wednesday 22 April 2009 08:28:30 j16s...@freenetproject.org wrote:
  Author: j16sdiz
  Date: 2009-04-22 07:28:30 + (Wed, 22 Apr 2009)
  New Revision: 27197
 
  Removed:
     trunk/freenet/src/freenet/crypt/DSAGroupGenerator.java
  Log:
  Unused class: DSAGroupGenerator
 
  Please reinstate. This is how we prove that our group wasn't engineered to
 be
  weak.

 We can move this to   test (not src/), right?

 Possibly. It's not really a test, but there's no reason to ship it with the
 node binary.


fixed in dc8157903c6ed17caa4881642adf73fd74fc3616
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl


Re: [freenet-dev] [freenet-cvs] r27218 - in trunk/contrib/fec/src: com/onionnetworks/fec csrc

2009-04-29 Thread Daniel Cheng
On Thu, Apr 30, 2009 at 8:37 AM, Matthew Toseland
t...@amphibian.dyndns.org wrote:
 On Thursday 30 April 2009 01:03:58 Daniel Cheng wrote:
 On Thu, Apr 30, 2009 at 8:02 AM, Matthew Toseland
 t...@amphibian.dyndns.org wrote:
  On Thursday 23 April 2009 02:40:26 j16s...@freenetproject.org wrote:
  Author: j16sdiz
  Date: 2009-04-23 01:40:25 + (Thu, 23 Apr 2009)
  New Revision: 27218
 
  Modified:
     trunk/contrib/fec/src/com/onionnetworks/fec/Native16Code.java
     trunk/contrib/fec/src/com/onionnetworks/fec/Native8Code.java
     trunk/contrib/fec/src/csrc/com_onionnetworks_fec_Native16Code.h
     trunk/contrib/fec/src/csrc/com_onionnetworks_fec_Native8Code.h
     trunk/contrib/fec/src/csrc/fec16-jinterf.c
     trunk/contrib/fec/src/csrc/fec8-jinterf.c
  Log:
  Use GetLongField() / SetLongField()
 
  ...
  Modified: trunk/contrib/fec/src/csrc/fec8-jinterf.c
  ===
  --- trunk/contrib/fec/src/csrc/fec8-jinterf.c 2009-04-23 01:40:07 UTC
 (rev
  27217)
  +++ trunk/contrib/fec/src/csrc/fec8-jinterf.c 2009-04-23 01:40:25 UTC
 (rev
  27218)
  ...
 
  -/*
  - * The data[] MUST be preshuffled before this call is made or it WILL
 NOT
  - * WORK!  It is very difficult to make Java aware that the pointers have
  - * been shuffled in the encode() call, so we must pre-shuffle the data
  - * so that encode doesn't move any pointers around.
  - */
 
  Why delete this comment? And the one in fec16-jinterf too?

 No specific reason.
 I was syncing fec8-jinterf.c and fec16-jinterf.c so they look identical
 in layout and comments.

 Both of them had that comment. Would you mind reinstating it?


I don't have write access to contrib :)
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl


Re: [freenet-dev] CMKs don't work, but there are other options was Re: Easy top block duplication: Content Multiplication Keys

2009-04-29 Thread Daniel Cheng
On Thu, Apr 30, 2009 at 8:45 AM, Matthew Toseland
t...@amphibian.dyndns.org wrote:
 On Wednesday 29 April 2009 23:12:09 bbac...@googlemail.com wrote:
 Could a client keep the top block available by requesting it lets say
 once per day?
 When the MaxSize option is used this could be a cheap request.

 No. It might help if it was from a different location on the network each
 time, but this would require something resembling tunnels, which we don't
 have yet. Right now it would just ensure that your node cached it, and if you
 told it to ignore the local datastore, that your nearest neighbour to the key
 cached it.

 Further, this does not solve the fundamental problem, which is that data will
 fall out of caches quickly, and is only stored on 3 nodes, and there's a good
 chance of all 3 of them being offline, or having left, at the time of the
 fetch. Although we do try to deal with this to some degree by ignoring low
 uptime nodes when calculating whether we are a sink ( = whether to store an
 insert in the store). Another issue is tolerance of weakness in specific
 areas of the keyspace. We have redundancy for lower down blocks, it makes
 sense to have redundancy for the top block.

 Is the length of a DHK a problem?

Short Answer: No.

Long Answer:
A CHK@ is 100 character long, which is wider then screen width (80).
Adding the http://...:/; prefix, it would become 122 character...
this is much longer then most people can read and memorize, it is
wider then many browser location bar --
so, adding extra length to it won't have any perceptible different.
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl


[freenet-dev] Commit 099709 Fix ant builder:

2009-04-29 Thread Daniel Cheng
commit 099709083ffc922ab2398bee1d920276ee454c36
Date:   Wed Apr 29 20:54:29 2009 +0200

 Fix ant builder:
 - The project is called fred-staging nowadays
 - The build.xml looks for skip_testS not skip-test. Eclipse still runs
 the tests for me though, does anyone have an idea why?


[...]

 -stringAttribute key=org.eclipse.ui.externaltools.ATTR_LOCATION 
 value=${workspace_loc:/Freenet 0.7/build.xml}/
 +stringAttribute key=org.eclipse.jdt.launching.PROJECT_ATTR value=/

[...]

If you check the check the .project file, you can see the project
name is still Freenet 0.7.
When sb get a tarball of the project, import it to eclipse using
Import Project From Existing Directory(?),
he will get a project named Freenet 0.7.

If you really want to change this, change the .project file too.
(and all .classpath files in all plugins, it is referenced there)
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl


Re: [freenet-dev] Commit 099709 Fix ant builder:

2009-04-29 Thread Daniel Cheng
On Thu, Apr 30, 2009 at 9:09 AM, Daniel Cheng j16sdiz+free...@gmail.com wrote:
 commit 099709083ffc922ab2398bee1d920276ee454c36
 Date:   Wed Apr 29 20:54:29 2009 +0200

     Fix ant builder:
     - The project is called fred-staging nowadays
     - The build.xml looks for skip_testS not skip-test. Eclipse still 
 runs
     the tests for me though, does anyone have an idea why?


 [...]

 -stringAttribute key=org.eclipse.ui.externaltools.ATTR_LOCATION 
 value=${workspace_loc:/Freenet 0.7/build.xml}/
 +stringAttribute key=org.eclipse.jdt.launching.PROJECT_ATTR value=/

 [...]

 If you check the check the .project file, you can see the project
 name is still Freenet 0.7.
 When sb get a tarball of the project, import it to eclipse using
 Import Project From Existing Directory(?),
 he will get a project named Freenet 0.7.

 If you really want to change this, change the .project file too.
 (and all .classpath files in all plugins, it is referenced there)


I meant this hunk, sorry for confusion:

| -stringAttribute key=org.eclipse.ui.externaltools.ATTR_LOCATION
value=${workspace_loc:/Freenet 0.7/build.xml}/
| +stringAttribute key=org.eclipse.jdt.launching.PROJECT_ATTR value=/
| +stringAttribute key=org.eclipse.ui.externaltools.ATTR_LOCATION
value=${workspace_loc:/fred-staging/build.xml}/


Another comment:

I would keep the -staging suffix from the build file when possible.
You can rename the directory so it don't have this suffix.

If you ever want to have both -official / -staging in the same
workspace, do this:
   1)  checkout from -staging, just as you have done

   2)  rename the directory, remove the suffix.

   3)  add a new remote, you need the command line
  git remote add   official   the official pul url

   4) in eclipse, right click the project - team - pull from ... -
choose the official repo
   -- add all branch spec, add all tags spec

   5) now you get the official repo as a branch in  right click the
project - team - branch ...
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl


Re: [freenet-dev] Commit 099709 Fix ant builder:

2009-04-29 Thread Daniel Cheng
On Thu, Apr 30, 2009 at 9:09 AM, Daniel Cheng j16sdiz+free...@gmail.com wrote:
 commit 099709083ffc922ab2398bee1d920276ee454c36
 Date:   Wed Apr 29 20:54:29 2009 +0200

     Fix ant builder:
     - The project is called fred-staging nowadays
     - The build.xml looks for skip_testS not skip-test. Eclipse still 
 runs
     the tests for me though, does anyone have an idea why?


 [...]

 -stringAttribute key=org.eclipse.ui.externaltools.ATTR_LOCATION 
 value=${workspace_loc:/Freenet 0.7/build.xml}/
 +stringAttribute key=org.eclipse.jdt.launching.PROJECT_ATTR value=/

 [...]

 If you check the check the .project file, you can see the project
 name is still Freenet 0.7.
 When sb get a tarball of the project, import it to eclipse using
 Import Project From Existing Directory(?),
 he will get a project named Freenet 0.7.

 If you really want to change this, change the .project file too.
 (and all .classpath files in all plugins, it is referenced there)


Okay, committed at:

fred/ 2f4ee2119a43fc99ebd339770a52733a5f21803e
plugin-Freetalk/ 1138314214350ce951c40b9d1fb4bdc330fcacb5
plugin-HelloFCP/ 979d24c5b166890ddb8fe6b4d02fc49cfe4a4cd0
plugin-HelloWorld/ ecfe9ac24fd6de20ced7c26ca28663ca9e66e639
plugin-JSTUN/ 2813ece05e6d61968c6378d3793b1c50970e2cf2
plugin-KeyExplorer/ b97d20b8e7c6f1a7b942528c4506e3b4fa8dc142
plugin-MDNSDiscovery/ 95d356ca56f4d2277712eb8776c91b1d003514de
plugin-SNMP/ c2d2711f30ad20fb014ba46a6c641902e0578ec9
plugin-TestGallery/ 8df6cf422296fcc630a7cda4f39dcd1e9da0149b
plugin-ThawIndexBrowser/ 8fb07411b06f64871592edadc98dc024be7d6427
plugin-UPnP/ 1eb3f4512082ae2538f85b431b268d32850f0d89
plugin-WoT/ 916067ea8959f785203a9e039a691cbe1193f22a
plugin-XMLLibrarian/ 96f9280aea8600e0a9f9c6b7fdaf3f2c5976a6f7
plugin-XMLSpider/ 86caa6c8be3da80103ad0284f68c675535d31f3f
___
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl