aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Manually request rehash  (Read 5182 times)

asamule

  • Approved Newbie
  • *
  • Karma: 2
  • Offline Offline
  • Posts: 45
Manually request rehash
« on: August 17, 2008, 08:50:31 AM »

I would like to request an option to trigger a manual rehash (both to find corrupted, and completed parts).

As a side note: if the rehash finds that all parts of the file are done, it does not trigger the 'file completed' code. So you get a file 100% done, and 'no needed parts' from everyone. It's harmless, but you have to restart amule to get it to finish the file.

Anyway, I would find a manual rehash very useful. If you want, I could list some examples, but probably you can think of some on your own.

Thanks.

PS. If it could use AICH for rehashes (all kinds), that would rock. Even if the AICH is done later, i.e. check if a part is not all zeros, and if so mark it for AICH recovery.

PPS. I was the person who coded the 'mark piece as complete during rehashing' code. I sent it in as a patch and it was accepted, so that bug I mentioned is really my fault.

I suppose I should send in a patch for this too, my excuse is that you are probably more familiar with the code.
« Last Edit: August 17, 2008, 09:14:50 AM by asamule »
Logged

asamule

  • Approved Newbie
  • *
  • Karma: 2
  • Offline Offline
  • Posts: 45
Re: Manually request rehash
« Reply #1 on: August 17, 2008, 09:16:41 AM »

I've been thinking about something: is the 'rehash at file completion', and 'rehash because it might be corrupted' code the same? Perhaps they could be merged? That would a: solve the bug, and b: make an obvious function to call for the manual rehash feature, and c: automatically do AICH checking. I think that's a win all around.
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: Manually request rehash
« Reply #2 on: August 17, 2008, 07:30:15 PM »

If you want, I could list some examples, but probably you can think of some on your own.
Please go ahead. I can only think of a corrupted file system. Or an evil bug, overwriting already downloaded and hashed parts.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: Manually request rehash
« Reply #3 on: August 18, 2008, 11:06:48 PM »

I suppose I should send in a patch for this too, my excuse is that you are probably more familiar with the code.

As most of us seems to be pretty short on free time, that would be the best.
Logged
concordia cum veritate

asamule

  • Approved Newbie
  • *
  • Karma: 2
  • Offline Offline
  • Posts: 45
Re: Manually request rehash
« Reply #4 on: August 22, 2008, 10:12:51 PM »

If you want, I could list some examples, but probably you can think of some on your own.
Please go ahead. I can only think of a corrupted file system. Or an evil bug, overwriting already downloaded and hashed parts.
For tough/rare files I like to hard link the aMule part file with a .torrent part file, and download both at the same time. This way I can get aMule no notice when the torrent has downloaded some stuff for it.

It also works well if you are transferring files from one tool to another. Start the download, then copy the existing stuff right into the aMule part file and ask for a rehash. The other request of importing data would do that as well.
Logged

lfroen

  • Guest
Re: Manually request rehash
« Reply #5 on: August 23, 2008, 11:28:49 AM »

For tough/rare files I like to hard link the aMule part file with a .torrent part file, and download both at the same time.
Yea, right. That's called GIGO system: garbage in, garbage out. Unless mule and torrent are "talking" to each other, there's no way to prevent thrashing target file.
Logged

asamule

  • Approved Newbie
  • *
  • Karma: 2
  • Offline Offline
  • Posts: 45
Re: Manually request rehash
« Reply #6 on: August 24, 2008, 09:19:28 PM »

For tough/rare files I like to hard link the aMule part file with a .torrent part file, and download both at the same time.
Yea, right. That's called GIGO system: garbage in, garbage out. Unless mule and torrent are "talking" to each other, there's no way to prevent thrashing target file.
Uh, no it's not. I do it every day and it works just fine. Make sure your torrent downloads in sparse mode though, not pre-allocation, or standard mode.

Each program puts the data in exactly the right place in the file - why should that cause any problems?
Logged

lfroen

  • Guest
Re: Manually request rehash
« Reply #7 on: August 25, 2008, 11:14:39 AM »

Each program puts the data in exactly the right place in the file - why should that cause any problems?
Two programs writing to same file in same time is never good idea.
Logged