Official eMule-Board: Mistake Arround Ed2klink With Hashset - Official eMule-Board

Jump to content


Page 1 of 1
  • Closed Topic This topic is locked

Mistake Arround Ed2klink With Hashset

#1 User is offline   SiRoB 

  • Retired Morph Dev
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1691
  • Joined: 28-June 03

Posted 22 February 2006 - 04:41 PM

Hi,
we fill hashlist with those hashset,
hashsetneeded is set to true in CreatePartFile(),
we request to a user the hashset,
we considere his answer corrupted due to malformed hashlist,
we purge hashset,
then next hashset request will success.
eMule 0.47c MorphXT v9.5 ::binary::source::
0

#2 User is offline   SlugFiller 

  • The one and only master slug
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 6988
  • Joined: 15-September 02

Posted 11 March 2006 - 08:06 PM

I can't understand what you're trying to say...
Why haven't you clicked yet?

SlugFiller rule #1: Unsolicited PMs is the second most efficient method to piss me off.
SlugFiller rule #2: The first most efficient method is unsolicited eMails.
SlugFiller rule #3: If it started in a thread, it should end in the same thread.
SlugFiller rule #4: There is absolutely no reason to perform the same discussion twice in parallel, especially if one side is done via PM.
SlugFiller rule #5: Does it say "Group: Moderators" under my name? No? Then stop telling me about who you want to ban! I really don't care! Go bother a moderator.
SlugFiller rule #6: I can understand English, Hebrew, and a bit of Japanese(standard) and Chinese(mandarin), but if you speak to me in anything but English, do expect to be utterly ignored, at best.
0

#3 User is offline   SiRoB 

  • Retired Morph Dev
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1691
  • Joined: 28-June 03

Posted 11 March 2006 - 10:53 PM

Ok i will reduce your brain power consumption...

Quote

// SLUGFILLER: SafeHash - setting at the hotspot
if (hashlist.GetCount() == 0) { //MORPH - Changed by SiRoB, Fix ed2klink with hashset
  if (GetED2KPartCount() > 1) {
  hashsetneeded = true;
  } else {
  hashsetneeded = false;
  uchar* cur_hash = new uchar[16];
  md4cpy(cur_hash, m_abyFileHash);
  hashlist.Add(cur_hash);
  }
}


[EDIT]

SlugFiller, on Mar 14 2006, 01:03 AM, said:

I still had to use some brain power on that one. The proper post should have been:

Quote

In CreatePartFile, the hashset is assumed to be empty when checking whether it is needed or not, even though it can be set prior to the function call if an ed2k link contains a hashset.

That would have taken away far less thinking time.

Your fix is close, by the way, but not quite right. What you should have done, under the assumption that the file is not really initialized but is half-loaded, is to just use the code from LoadPartFile:
  // SLUGFILLER: SafeHash - ignore loaded hash for 1-chunk files
  if (GetED2KPartCount() <= 1) {
  	for (int i = 0; i < hashlist.GetSize(); i++)
    delete[] hashlist[i];
  	hashlist.RemoveAll();
  	uchar* cur_hash = new uchar[16];
  	md4cpy(cur_hash, m_abyFileHash);
  	hashlist.Add(cur_hash);
  }

But wait, this code doesn't set hashsetneeded. That part is several lines below, so let's just add it(with a trimmed down "else"):
	if (GetHashCount() != GetED2KPartCount()) {
  ASSERT( hashlist.GetSize() == 0 );
  hashsetneeded = true;
	}
	else
  hashsetneeded = false;

While we're at it, we can also empty the hashlist in place of that ASSERT, but LoadHashsetFromFile would already do that prior to the ASSERT anyway.
View Post


Ok seem a war start.
As i was censored by someone below this quoted post, i posting there. :ph34r:

My fix is alright even if it irritate some guy arround.

SlugFiller is trying to fix a trouble that can't occur. :-k

P.S.: As i said in my censored post , it's my last support to someone that stay as close on their numerous mistake and always thank's people with great talent.
[/EDIT]

This post has been edited by SiRoB: 14 March 2006 - 05:27 PM

eMule 0.47c MorphXT v9.5 ::binary::source::
0

#4 User is offline   SlugFiller 

  • The one and only master slug
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 6988
  • Joined: 15-September 02

Posted 13 March 2006 - 11:03 PM

I still had to use some brain power on that one. The proper post should have been:

Quote

In CreatePartFile, the hashset is assumed to be empty when checking whether it is needed or not, even though it can be set prior to the function call if an ed2k link contains a hashset.

That would have taken away far less thinking time.

Your fix is close, by the way, but not quite right. What you should have done, under the assumption that the file is not really initialized but is half-loaded, is to just use the code from LoadPartFile:
  // SLUGFILLER: SafeHash - ignore loaded hash for 1-chunk files
  if (GetED2KPartCount() <= 1) {
  	for (int i = 0; i < hashlist.GetSize(); i++)
    delete[] hashlist[i];
  	hashlist.RemoveAll();
  	uchar* cur_hash = new uchar[16];
  	md4cpy(cur_hash, m_abyFileHash);
  	hashlist.Add(cur_hash);
  }

But wait, this code doesn't set hashsetneeded. That part is several lines below, so let's just add it(with a trimmed down "else"):
	if (GetHashCount() != GetED2KPartCount()) {
  ASSERT( hashlist.GetSize() == 0 );
  hashsetneeded = true;
	}
	else
  hashsetneeded = false;

While we're at it, we can also empty the hashlist in place of that ASSERT, but LoadHashsetFromFile would already do that prior to the ASSERT anyway.
Why haven't you clicked yet?

SlugFiller rule #1: Unsolicited PMs is the second most efficient method to piss me off.
SlugFiller rule #2: The first most efficient method is unsolicited eMails.
SlugFiller rule #3: If it started in a thread, it should end in the same thread.
SlugFiller rule #4: There is absolutely no reason to perform the same discussion twice in parallel, especially if one side is done via PM.
SlugFiller rule #5: Does it say "Group: Moderators" under my name? No? Then stop telling me about who you want to ban! I really don't care! Go bother a moderator.
SlugFiller rule #6: I can understand English, Hebrew, and a bit of Japanese(standard) and Chinese(mandarin), but if you speak to me in anything but English, do expect to be utterly ignored, at best.
0

#5 User is offline   SiRoB 

  • Retired Morph Dev
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1691
  • Joined: 28-June 03

Posted 14 March 2006 - 05:35 PM

Nice to see that you aren't still changing in your answer. :-k

Thank's for you great talent to turn arround your mistake like a snake and try to smoke other to feel better. :flowers:
eMule 0.47c MorphXT v9.5 ::binary::source::
0

#6 User is offline   Stulle 

  • [Enter Mod] Dev
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5738
  • Joined: 07-April 04

Posted 14 March 2006 - 06:24 PM

SiRoB, on Mar 14 2006, 05:35 PM, said:

Nice to see that you aren't still changing in your answer.  :-k

Thank's for you great talent to turn arround your mistake like a snake and try to smoke other to feel better.  :flowers:
View Post

:clap: I love you! Not in a gay way but in a platonic way! :D
I am an emule-web.de member and fan! Hate me or people will get suspicious about you! Ever wondered if it's all worth the trouble?

Posted Image

No, there will not be a new version of my mods. No, I do not want your PM. No, I am certain, use the board and quit sending PMs. No, I am not kidding, there will not be a new version of my mods just because of YOU asking for it!
0

#7 User is offline   SlugFiller 

  • The one and only master slug
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 6988
  • Joined: 15-September 02

Posted 28 March 2006 - 03:59 PM

To properly iterate:
1. SiRoB's fix fails to ignore and throw away 1-chunk hashsets. Sure, they should not be there in the first place, but assuming input is valid is always asking for it in wild-use software. Sure, there aren't many scenarios where this would be a problem, but that's no excuse to be careless.
2. I am forced to close this thread because someone obviously wants to turn this into a flamewar, so I'll stop this before it is filled with more profanity. I will not tolerate pointless use of expletives here, and since I don't have editing rights, infriging posts shall be deleted with extreme prejudice.
3. If SiRoB doesn't like my code, he can feel free to stop using it in his mod. I certainly don't intend to use any of his.
Why haven't you clicked yet?

SlugFiller rule #1: Unsolicited PMs is the second most efficient method to piss me off.
SlugFiller rule #2: The first most efficient method is unsolicited eMails.
SlugFiller rule #3: If it started in a thread, it should end in the same thread.
SlugFiller rule #4: There is absolutely no reason to perform the same discussion twice in parallel, especially if one side is done via PM.
SlugFiller rule #5: Does it say "Group: Moderators" under my name? No? Then stop telling me about who you want to ban! I really don't care! Go bother a moderator.
SlugFiller rule #6: I can understand English, Hebrew, and a bit of Japanese(standard) and Chinese(mandarin), but if you speak to me in anything but English, do expect to be utterly ignored, at best.
0

  • Member Options

Page 1 of 1
  • Closed Topic This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users