Edward J. Sheldrake
2006-10-14 13:38:29 UTC
While trying to add support for ADCGet and TTHF to dclib/valknut 0.3.7,
I have discovered a serious bug which causes files to not be found when
searched for by their TTH.
I have confirmed the bug occurrs when you rename a file that has
already been hashed and is in your share, but there may be other cases
which trigger the bug.
When a file is searched for by TTH, but not found as it should be, I
have discovered that the following happens:
CSearchIndex::SearchHash is called
CSearchIndex::FindHash is then called, and finds a value
CSearchIndex::HashBaseIndexFromHashIndex converts this value into
another (often the same)
CSearchIndex::BaseIndexFromHashBaseIndex then fails
But I'm thinking the problem lies in the code for adding the values to
the various indexes (*.bin files in ~/.dc/).
So far, I have only managed to add extra debugging statements to dclib,
I haven't been able to make any progress in fixing this problem.
A patch for the extra debugging output is available here:
http://www.dcs.warwick.ac.uk/~csucda/extra-debug-dclib.diff
We need to fix this bug because DC++ >= 0.696 will require support for
ADCGet and TTHF, so we need to fix this bug for valknut to have any
future.
--
Edward Sheldrake (ejs1920 on the valknut forums)
Send instant messages to your online friends http://uk.messenger.yahoo.com
I have discovered a serious bug which causes files to not be found when
searched for by their TTH.
I have confirmed the bug occurrs when you rename a file that has
already been hashed and is in your share, but there may be other cases
which trigger the bug.
When a file is searched for by TTH, but not found as it should be, I
have discovered that the following happens:
CSearchIndex::SearchHash is called
CSearchIndex::FindHash is then called, and finds a value
CSearchIndex::HashBaseIndexFromHashIndex converts this value into
another (often the same)
CSearchIndex::BaseIndexFromHashBaseIndex then fails
But I'm thinking the problem lies in the code for adding the values to
the various indexes (*.bin files in ~/.dc/).
So far, I have only managed to add extra debugging statements to dclib,
I haven't been able to make any progress in fixing this problem.
A patch for the extra debugging output is available here:
http://www.dcs.warwick.ac.uk/~csucda/extra-debug-dclib.diff
We need to fix this bug because DC++ >= 0.696 will require support for
ADCGet and TTHF, so we need to fix this bug for valknut to have any
future.
--
Edward Sheldrake (ejs1920 on the valknut forums)
Send instant messages to your online friends http://uk.messenger.yahoo.com