Prevent memory leaks when Adaptation::AccessCheck callback ends the job.
The AccessCheckCallbackWrapper is used in nonBlockingCheck() and is called
from the ACL code, using legacy function-based API. If the job ends during
the callback processing, there are no AsyncCall wrappers to destroy the job
object. We now convert legacy to async call to enable proper wrapping and job
destruction.
These kind of job leaks are invisible to valgrind, but that is another bug.
* we should be kicking off an authentication before continuing
* with this request. see bug 2400 for details.
*/
- ac->noteAnswer(answer==ACCESS_ALLOWED);
+
+ // convert to async call to get async call protections and features
+ typedef UnaryMemFunT<AccessCheck, int> MyDialer;
+ AsyncCall::Pointer call =
+ asyncCall(93,7, "Adaptation::AccessCheck::noteAnswer",
+ MyDialer(ac, &Adaptation::AccessCheck::noteAnswer,
+ answer==ACCESS_ALLOWED));
+ ScheduleCallHere(call);
+
}
/// process the results of the ACL check