Hello Peng,
Quoting pwang708 <[email protected]> from ml.gnutella.dev-forum:
:Mojito does not assign a lifetime to a securityToken explicitly.
:Instead, mojito node changes its keys periodically. So a securityToken
:is valid as long as the key used to computer the MAC is not expired
:yet. The period is 6 hours (+ 20 minutes grace period) in the current
:setting.
It is unfortunate that there is no lifetime attached to the generated
security tokens. I guess it's too late to change that now, since the
message architecture is all set. Unless you wish to change the version
number, but then we also need to be backward compatible. Tough.
:About making republish efficient:
:
:Note that anyway you will need to send findNode to find the current
:replica roots (nodes responsible to store data for a given key),
:because during the republish period there is a big chance that the
:replica set changes. So nodes republishing get new securityTokens when
:they receive findNodResponses. Of course, you can cache the old
:replica roots to speed up findNode requests, hence speed up republish.
Since you get a node's token only from the one who replies, and given a
node will give you back k contacts for each find (hopefully: the node
knows its neighbourhood), you will miss k-1 security token updates.
When you try to store with the old token you could have, you will get
an error status 0x2. And you will not know that it failed because of
your security token. If you get 0x3 back instead (what I propose), then
at least you can send a FIND_NODE to the node with its own KUID, get
the new token, and retry the STORE.
I'll probably implement that in gtk-gnutella, unless you give me a good
reason not to.
What? You will not understand 0x3? hehe... should not make a difference
anyway, you will act as if I had returned 0x2 because a wrong error code
is also an error... :-)
Cheers,
Raphael
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.