On Sun, 21 May 2000, Adam Langley wrote: > > On Sun, May 21, 2000 at 12:54:08PM +0200, Oskar Sandberg wrote: > > >From what you write, it sounds almost like you are sending DataRequests to > > >more > > then one node, which is of course devastatingly wrong. > > Ohh, crap. Here I go again - just when I think I have everything sorted... > > I do send DataRequests to multiple nodes. When I get a DataRequest for a key > I don't have I find the closest reference in the DataStore and forward the > DataRequest to that node. If I get a DataReply I stream it to the requesting > node. If the node responds with RequestFailed or TimedOut I select the next > closest key in the DataStore, lower HTL by 1 (if == 0 then kill etc) and > forward again.
So you are doing it wrong. You should not start the send again if you get a TimedOut, if you did that then the message would never end. When you get a TimedOut the request has ended: pass the TimedOut back and forget the whole thing. When you get a RequestFailed, you take the HTL of the RequestFailed, lower that by one, and put that HTL on a DataRequest you send to the next closest match. When it comes to the InsertRequest, only the last node you sent an InsertRequest to (the one that replied with an InsertReply) should ever be sent the actual data. Since RequestFailed either means that the node had the query already, or that it was not connected to any nodes but you, there is no point in sending data to nodes that replied with that (in fact, you shouldn't because it could also be for "I'm overloaded, don't send me anything" in the future). > AGL > > -- > When will people realise that we don't care for their damm stupid laws? We > can handle ourselves, thank you very much. > ---------------------------------------- Content-Type: application/pgp-signature; name="unnamed" Content-Transfer-Encoding: 7bit Content-Description: ---------------------------------------- -- Oskar Sandberg md98-osa at nada.kth.se _______________________________________________ Freenet-dev mailing list Freenet-dev at lists.sourceforge.net http://lists.sourceforge.net/mailman/listinfo/freenet-dev
