On Fri, 21 Apr 2000, Brandon wrote: <> > My solutionis to have a different message subtype for every kind of > key. So there is Request.Data.ContentHash and Request.Data.Signed, > etc.. They will inherit from a common subclass. So the routing will be the > exact same. However, there won't be key crossover because there is a > different message for requesting different types of keys. > > The reason I prefer this to putting the key type in the message or the key > itself is that there is more to handling different key types that just > making sure they're never equal. They are handled differently by the > node. ContentHash keys have the content hash of their data verified, for > instance. I'm not sure exactly how the other key types would be handled, > but it would certainly be somewhat different for each key type.
This was not my point. Even if you have a different kind of Request, you also have to know if the key you found in the DataStore that has the same value is actually a key of the same type. For a CHK you could check if this is so by simply checking the hash of the data in the DataStore, but this does not always have to be the case, so you also need to have it stored with the key in the datastore so the Request.Data.KeytypeX knows that it is KeytypeX indexed data it has found. And if we ever have a URL for Freenet keys, we will need it the type to be in there as well. So regardless of whether you have a new message type or not, you still have to store the type together with the key everywhere the key is stored, which makes it logical to bake it into the value. As for the Request.Data.ContentHash thing, that was my point b), and I still think you are wrong, but for different reasons. The InsertRequest and DataRequest messages are now seperate from the ones that send the actual data, ie DataReply and DataInsert. DataReply and DataInsert will need to be different messages for different types of keys (for the differences in behaviour you descibed), but the Request messages will not. > > > > _______________________________________________ > Freenet-dev mailing list > Freenet-dev at lists.sourceforge.net > http://lists.sourceforge.net/mailman/listinfo/freenet-dev -- Oskar Sandberg md98-osa at nada.kth.se #!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj $/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1 lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=pack('H*',/((..)*)$/) _______________________________________________ Freenet-dev mailing list Freenet-dev at lists.sourceforge.net http://lists.sourceforge.net/mailman/listinfo/freenet-dev
