summaryrefslogtreecommitdiff
path: root/src/modules/extra/m_regex_posix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/extra/m_regex_posix.cpp')
-rw-r--r--src/modules/extra/m_regex_posix.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/modules/extra/m_regex_posix.cpp b/src/modules/extra/m_regex_posix.cpp
index 7afaad076..62b44e0e4 100644
--- a/src/modules/extra/m_regex_posix.cpp
+++ b/src/modules/extra/m_regex_posix.cpp
@@ -78,8 +78,8 @@ private:
public:
ModuleRegexPOSIX() {
ServerInstance->Modules->PublishInterface("RegularExpression", this);
- Implementation eventlist[] = { I_OnRequest, I_OnRehash };
- ServerInstance->Modules->Attach(eventlist, this, 2);
+ Implementation eventlist[] = { I_OnRehash };
+ ServerInstance->Modules->Attach(eventlist, this, 1);
OnRehash(NULL);
}
@@ -99,20 +99,18 @@ public:
extended = Conf.ReadFlag("posix", "extended", 0);
}
- virtual const char* OnRequest(Request* request)
+ void OnRequest(Request& request)
{
- if (strcmp("REGEX-NAME", request->GetId()) == 0)
+ if (strcmp("REGEX-NAME", request.id) == 0)
{
- return "posix";
+ static_cast<RegexNameRequest&>(request).result = "posix";
}
- else if (strcmp("REGEX", request->GetId()) == 0)
+ else if (strcmp("REGEX", request.id) == 0)
{
- RegexFactoryRequest* rfr = (RegexFactoryRequest*)request;
- std::string rx = rfr->GetRegex();
- rfr->result = new POSIXRegex(rx, extended);
- return "OK";
+ RegexFactoryRequest& rfr = (RegexFactoryRequest&)request;
+ std::string rx = rfr.GetRegex();
+ rfr.result = new POSIXRegex(rx, extended);
}
- return NULL;
}
};