aMule Forum

English => en_Bugs => Topic started by: Gnucco on November 14, 2007, 09:11:27 AM

Title: aMule does not publish new files on kad (with workaround)
Post by: Gnucco 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 );
}
Title: Re: aMule does not publish new files on kad (with workaround)
Post by: darkbasic on November 14, 2007, 04:54:44 PM
Just patched, I hope it will work

P.S.
Thank you!
Title: Re: aMule does not publish new files on kad (with workaround)
Post by: darkbasic on November 14, 2007, 05:39:24 PM
It doesn't work... :(
Title: Re: aMule does not publish new files on kad (with workaround)
Post by: Gnucco 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?
Title: Re: aMule does not publish new files on kad (with workaround)
Post by: darkbasic 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).
Title: Re: aMule does not publish new files on kad (with workaround)
Post by: phoenix 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!