#150 Ugly recursion in gkclient

open
nobody
OpenH323 (35)
5
2007-11-04
2007-11-04
arimont
No

Fix:

class H323Gatekeeper : public H225_RAS
{
...
BOOL unregRecursive;
...
}

H323Gatekeeper::H323Gatekeeper(H323EndPoint & ep, H323Transport * trans)
: H225_RAS(ep, trans),
requestMutex(1, 1),
authenticators(ep.CreateAuthenticators())
{
...

unregRecursive = FALSE;

...
}

BOOL H323Gatekeeper::UnregistrationRequest(int reason)
{
...

BOOL requestResult = MakeRequest(request);

if (!unregRecursive)
{
for (i = 0; i < alternates.GetSize(); i++)
{
unregRecursive = TRUE;
AlternateInfo & altgk = alternates[i];
if (altgk.registrationState == AlternateInfo::IsRegistered)
{
Connect(altgk.rasAddress,altgk.gatekeeperIdentifier);
UnregistrationRequest(reason);
}
unregRecursive = FALSE;
}
}

if (requestResult)
return TRUE;

...
}

Discussion

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks