aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: aMule does not publish new files on kad (with workaround)  (Read 3704 times)

Gnucco

  • Approved Newbie
  • *
  • Karma: 8
  • Offline Offline
  • Posts: 25
aMule does not publish new files on kad (with workaround)
« on: November 14, 2007, 09:11:27 AM »

Even with the workaround I sent you, the KADEMLIA_PUBLISH_REQ packet contains wrong data, and is dropped by other clients.
My patch solved the issues with tag name serialization, there's still an oustanding problem.

the TAG_SOURCES value is wrong.

an amule client trying to share a new file will send the TAG_SOURCES value set to ZERO.
Any client receiving this message will discard it.
So the new file is really *not published* on the kad net.

I made this dirty workaround:


In method void CSearch::PreparePacketForTags( CMemFile *bio, CKnownFile *file)

I changed the line
         taglist.push_back(new CTagVarInt(TAG_SOURCES, (uint32)file->m_nCompleteSourcesCount));
to
         taglist.push_back(new CTagVarInt(TAG_SOURCES, max(1, (uint32)file->m_nCompleteSourcesCount)) );

and I could successfully publish new files on kad.

PS: I forgot, you must define also a max inline method
inline uint32 max( uint32 a, uint32 b )
{
   return ( a>b ? a:b );
}
Logged

darkbasic

  • Approved Newbie
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 47
Re: aMule does not publish new files on kad (with workaround)
« Reply #1 on: November 14, 2007, 04:54:44 PM »

Just patched, I hope it will work

P.S.
Thank you!
Logged
Sorry for my bad English...
Debian Sid amd64 | Fedora 8
AMD Athlon64 3800+ X2@2600Mhz vcore 1.392| My PC

darkbasic

  • Approved Newbie
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 47
Re: aMule does not publish new files on kad (with workaround)
« Reply #2 on: November 14, 2007, 05:39:24 PM »

It doesn't work... :(
Logged
Sorry for my bad English...
Debian Sid amd64 | Fedora 8
AMD Athlon64 3800+ X2@2600Mhz vcore 1.392| My PC

Gnucco

  • Approved Newbie
  • *
  • Karma: 8
  • Offline Offline
  • Posts: 25
Re: aMule does not publish new files on kad (with workaround)
« Reply #3 on: November 14, 2007, 06:20:37 PM »

You need also the other patch that fixes tag names serialization.
I posted some time ago, but I don't remember if it has already been committed to cvs.

You need them both to let your amule client publish new stuff on kademlia net.

What kind of test did you perform?
Logged

darkbasic

  • Approved Newbie
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 47
Re: aMule does not publish new files on kad (with workaround)
« Reply #4 on: November 14, 2007, 08:12:20 PM »

I posted some time ago, but I don't remember if it has already been committed to cvs.
It has already been committed.

What kind of test did you perform?
I opened aMule and I awaited about an hour without seeing anyone in my queue (except for clients  which found me through source excange).
Logged
Sorry for my bad English...
Debian Sid amd64 | Fedora 8
AMD Athlon64 3800+ X2@2600Mhz vcore 1.392| My PC

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
Re: aMule does not publish new files on kad (with workaround)
« Reply #5 on: November 16, 2007, 04:06:20 AM »

Gnucco,

I have just committed the last patch. The other one I think I have committed a few days ago.

Cheers!
Logged