From 7e843c22e16c81054bad18073d24fe1a07026431 Mon Sep 17 00:00:00 2001 From: danieldg Date: Thu, 8 Oct 2009 23:29:21 +0000 Subject: Update Event and Request APIs git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11808 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_sslinfo.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/modules/m_sslinfo.cpp') diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp index 1b5a39ba4..a1178f917 100644 --- a/src/modules/m_sslinfo.cpp +++ b/src/modules/m_sslinfo.cpp @@ -12,7 +12,7 @@ */ #include "inspircd.h" -#include "transport.h" +#include "ssl.h" /* $ModDesc: Provides SSL metadata, including /WHOIS information and /SSLINFO command */ @@ -125,15 +125,17 @@ class ModuleSSLInfo : public Module Implementation eventlist[] = { I_OnWhois, I_OnPreCommand }; ServerInstance->Modules->Attach(eventlist, this, 2); + ServerInstance->Modules->PublishInterface("SSLCertInfo", this); } ~ModuleSSLInfo() { + ServerInstance->Modules->UnpublishInterface("SSLCertInfo", this); } Version GetVersion() { - return Version("SSL Certificate Utilities", VF_VENDOR); + return Version("SSL Certificate Utilities", VF_VENDOR | VF_SERVICEPROVIDER); } void OnWhois(User* source, User* dest) @@ -224,19 +226,18 @@ class ModuleSSLInfo : public Module return MOD_RES_PASSTHRU; } - const char* OnRequest(Request* request) + void OnRequest(Request& request) { - if (strcmp("GET_CERT", request->GetId()) == 0) + if (strcmp("GET_CERT", request.id) == 0) { - BufferedSocketCertificateRequest* req = static_cast(request); - req->cert = cmd.CertExt.get(req->item); + SSLCertificateRequest& req = static_cast(request); + req.cert = cmd.CertExt.get(req.item); } - else if (strcmp("SET_CERT", request->GetId()) == 0) + else if (strcmp("SET_CERT", request.id) == 0) { - BufferedSocketFingerprintSubmission* req = static_cast(request); - cmd.CertExt.set(req->item, req->cert); + SSLCertSubmission& req = static_cast(request); + cmd.CertExt.set(req.item, req.cert); } - return NULL; } }; -- cgit v1.2.3