* Matthew Toseland <toad at amphibian.dyndns.org> [2007-10-23 01:45:00]:
> On Monday 22 October 2007 22:01, you wrote:
> > Author: nextgens
> > Date: 2007-10-22 21:01:20 +0000 (Mon, 22 Oct 2007)
> > New Revision: 15483
> >
> > Modified:
> > trunk/freenet/src/freenet/node/RequestHandler.java
> > Log:
> > Simplify the logic, test for node.passOpennetRefsThroughDarknet() earlier
> on.
> >
> > Don't send anything if we don't want to help path-folding.
>
> Not sending anything is actively sabotaging path folding by causing opennet
> nodes to waste threads waiting for a message which will never come. The
> intended behaviour is to always send *something* to indicate the completion
> of the request. Normally on a pure darknet node that would simply be an
> FNPOpennetCompletedAck.
I hope that the code is bullet-proof against that... My node has been
acting that way since the beginning :p Well, those messages will
eventually expire anyway, won't they ?
May you add a few comments in the code about that please? It's far from
beeing obvious logic-wise as far as I'm concerned.
>
> If you want to eliminate this spurious message in the pure darknet case,
> without breaking pass-opennet-refs-over-darknet which IMHO is an important
> piece of functionality, you will have to define a way for nodes to declare at
> connection time that they are not interested in opennet in any way
> whatsoever. Then we can safely not send an ack to such nodes if they
> are !wantsOpennetRefs().
Ok, it got one slot on my TODO.
> >
> > Modified: trunk/freenet/src/freenet/node/RequestHandler.java
> > ===================================================================
> > --- trunk/freenet/src/freenet/node/RequestHandler.java 2007-10-22
> > 20:40:07
> UTC (rev 15482)
> > +++ trunk/freenet/src/freenet/node/RequestHandler.java 2007-10-22
> > 21:01:20
> UTC (rev 15483)
> > @@ -148,7 +148,8 @@
> > node.addTransferringRequestHandler(uid);
> > if(bt.send(node.executor)) {
> > status = RequestSender.SUCCESS; // for byte
> > logging
> > - finishOpennetNoRelayChecked();
> > + if(node.passOpennetRefsThroughDarknet())
> > + finishOpennetNoRelayChecked();
>
> We've fetched it from our datastore. We therefore cannot relay a downstream
> noderef. We can either send our own noderef, if we want a connection, or we
> can send an FNPOpennetCompletedAck to indicate that we don't want to.
>
> > }
> > }
> > return;
> > @@ -187,7 +188,8 @@
> > finalTransferFailed = true;
> > } else {
> > // Successful CHK transfer, maybe path
> > fold
> > - finishOpennetChecked();
> > + if(node.passOpennetRefsThroughDarknet())
> > + finishOpennetChecked();
>
> Again, we might have opennet enabled and pass-opennet-refs-through-darknet
> disabled, and even if not, we need to send an FNPOpennetCompletedAck.
> > }
> > status = rs.getStatus();
> > return;
> > @@ -262,7 +264,7 @@
> > }
> >
> > private void finishOpennetChecked() {
> > - if(!(node.passOpennetRefsThroughDarknet() ||
> > source.isOpennet())) {
> > + if(!source.isOpennet()) {
>
> This is plain wrong. If we want to pass refs through darknet peers, then we
> should pass a ref to the requester if possible. If we don't want anything to
> do with opennet, we should send an acknowledgement.
>
Ok, now I get it but that should be commented in the code ;)
> > Message msg = DMT.createFNPOpennetCompletedAck(uid);
> > try {
> > source.sendAsync(msg, null, 0, this);
> > @@ -290,7 +292,7 @@
> > }
> >
> > private void finishOpennetNoRelayChecked() {
> > - if(!(node.passOpennetRefsThroughDarknet() ||
> > source.isOpennet())) {
> > + if(!source.isOpennet()) {
>
> Here too.
>
> > Message msg = DMT.createFNPOpennetCompletedAck(uid);
> > try {
> > source.sendAsync(msg, null, 0, this);
>
> Normally I would let you correct it yourself, but there were a number of
> issues which needed dealing with.
>
You're welcome.
> We should fix the traffic analysis vulnerability in passing opennet refs soon
> (i.e. pad the noderef to exactly 2kB and split it up into two
> packets/messages rather than sending potentially oversize, variable length
> packets). But not before 1066.
^-^ that should have been done since ages imho.
NextGen$
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL:
<https://emu.freenetproject.org/pipermail/devl/attachments/20071023/847651e2/attachment.pgp>