summaryrefslogtreecommitdiff
path: root/src/modules/m_sslinfo.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-11-06 22:37:52 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-11-06 22:37:52 +0000
commiteaace5ed7cef3a02f905689a1b44a092ca99a6e1 (patch)
treeeb1340e768f23e3ab121ad185e8e61bedb23a32a /src/modules/m_sslinfo.cpp
parenta26502ff51141c3cd74c078876d3322b49a3833c (diff)
Remove Extensible parent from EventHandler
This also fixes SSL certificate support when m_sslinfo is not loaded git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12048 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_sslinfo.cpp')
-rw-r--r--src/modules/m_sslinfo.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp
index 0ab749703..7457ce296 100644
--- a/src/modules/m_sslinfo.cpp
+++ b/src/modules/m_sslinfo.cpp
@@ -25,8 +25,10 @@ class SSLCertExt : public ExtensionItem {
}
void set(Extensible* item, ssl_cert* value)
{
+ value->refcount_inc();
ssl_cert* old = static_cast<ssl_cert*>(set_raw(item, value));
- delete old;
+ if (old && old->refcount_dec())
+ delete old;
}
std::string serialize(SerializeFormat format, const Extensible* container, void* item) const
@@ -61,7 +63,9 @@ class SSLCertExt : public ExtensionItem {
void free(void* item)
{
- delete static_cast<ssl_cert*>(item);
+ ssl_cert* old = static_cast<ssl_cert*>(item);
+ if (old && old->refcount_dec())
+ delete old;
}
};
@@ -228,10 +232,10 @@ class ModuleSSLInfo : public Module
void OnRequest(Request& request)
{
- if (strcmp("GET_CERT", request.id) == 0)
+ if (strcmp("GET_USER_CERT", request.id) == 0)
{
- SSLCertificateRequest& req = static_cast<SSLCertificateRequest&>(request);
- req.cert = cmd.CertExt.get(req.item);
+ UserCertificateRequest& req = static_cast<UserCertificateRequest&>(request);
+ req.cert = cmd.CertExt.get(req.user);
}
else if (strcmp("SET_CERT", request.id) == 0)
{