aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Kad graph breaks on disconnect  (Read 2689 times)

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Kad graph breaks on disconnect
« on: May 15, 2008, 01:09:41 AM »

I just switched from 8442 to 8502, and I noticed that at disconnection of Kad, Kad graph goes bananas (> 65000 nodes), see picture.
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

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: Kad graph breaks on disconnect
« Reply #1 on: May 15, 2008, 09:50:59 PM »

It takes no active disconnect to break. My nodes are at 65060.    ;)
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

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: Kad graph breaks on disconnect
« Reply #2 on: May 26, 2008, 01:02:57 AM »

Well, the contact counter is set with theStats::AddKadNode() / theStats::RemoveKadNode(), which are called in CContact::CContact() / CContact::~CContact().
However a debug log entry reveals that for some CContact a destruct is called, but no construct.  ??? So the count becomes negative, thus 65xxx (since it's unsigned short).
I'm suspecting something rotten concerning the assigning, pushing and popping of full CContact objects (not pointers) in the UDPFirewallTester.
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

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: Kad graph breaks on disconnect
« Reply #3 on: May 26, 2008, 10:45:03 PM »

Got it.  :)
Malapraxis got close in 8555, but this version still jumps to 65xxx on disconnect.
I added a copy construct (there was none before!) and also removed copy() and the overloaded = operator. No need to overload it when all it does is copy each single member. That's what the compiler generates anyway, and it's not robust when adding new members.
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