if (Config::Enabled) {
// the new check will call the callback and delete self, eventually
- AccessCheck *check = new AccessCheck(
- ServiceFilter(method, vp, req, rep), cb, cbdata);
- check->check();
- return true;
+ return AsyncStart(new AccessCheck(
+ ServiceFilter(method, vp, req, rep), cb, cbdata));
}
debugs(83, 3, HERE << "adaptation off, skipping");
cbdataReferenceDone(callback_data);
}
+void
+Adaptation::AccessCheck::start() {
+ AsyncJob::start();
+ check();
+}
+
/// Walk the access rules list to find rules with applicable service groups
void
Adaptation::AccessCheck::check()
bool isCandidate(AccessRule &r);
public:
- void check();
void checkCandidates();
static void AccessCheckCallbackWrapper(int, void*);
void noteAnswer(int answer);
+protected:
// AsyncJob API
+ virtual void start();
virtual bool doneAll() const { return false; } /// not done until mustStop
+ void check();
+
private:
CBDATA_CLASS2(AccessCheck);
};