summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-29 21:38:42 +0000
committerpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-29 21:38:42 +0000
commit56838d603daae6b196a4f58fe07f36c63164ba5a (patch)
treec649948aae91939f98d9d8a379e4479a5f6f3ad5
parent6e5ddb41ff1db4722813759336bef7d56b92316b (diff)
I lose for being slow. also tidyup a bit, still needs to fix that sizeof..
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8001 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp27
1 files changed, 11 insertions, 16 deletions
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp
index f7beaede5..8e8b03b85 100644
--- a/src/modules/extra/m_ssl_openssl.cpp
+++ b/src/modules/extra/m_ssl_openssl.cpp
@@ -74,7 +74,7 @@ public:
issl_io_status wstat;
unsigned int inbufoffset;
- char* inbuf; // Buffer OpenSSL reads into.
+ char* inbuf; // Buffer OpenSSL reads into.
std::string outbuf; // Buffer for outgoing data that OpenSSL will not take.
int fd;
bool outbound;
@@ -103,9 +103,6 @@ static int OnVerify(int preverify_ok, X509_STORE_CTX *ctx)
class ModuleSSLOpenSSL : public Module
{
-
- ConfigReader* Conf;
-
std::vector<int> listenports;
int inbufsize;
@@ -131,7 +128,7 @@ class ModuleSSLOpenSSL : public Module
InspIRCd* PublicInstance;
ModuleSSLOpenSSL(InspIRCd* Me)
- : Module(Me), PublicInstance(Me)
+ : Module(Me), PublicInstance(Me)
{
ServerInstance->Modules->PublishInterface("InspSocketHook", this);
@@ -160,7 +157,7 @@ class ModuleSSLOpenSSL : public Module
if (param != "ssl")
return;
- Conf = new ConfigReader(ServerInstance);
+ ConfigReader Conf(ServerInstance);
for (unsigned int i = 0; i < listenports.size(); i++)
{
@@ -171,14 +168,14 @@ class ModuleSSLOpenSSL : public Module
clientactive = 0;
sslports.clear();
- for (int i = 0; i < Conf->Enumerate("bind"); i++)
+ for (int i = 0; i < Conf.Enumerate("bind"); i++)
{
// For each <bind> tag
- std::string x = Conf->ReadValue("bind", "type", i);
- if (((x.empty()) || (x == "clients")) && (Conf->ReadValue("bind", "ssl", i) == "openssl"))
+ std::string x = Conf.ReadValue("bind", "type", i);
+ if (((x.empty()) || (x == "clients")) && (Conf.ReadValue("bind", "ssl", i) == "openssl"))
{
// Get the port we're meant to be listening on with SSL
- std::string port = Conf->ReadValue("bind", "port", i);
+ std::string port = Conf.ReadValue("bind", "port", i);
irc::portparser portrange(port, false);
long portno = -1;
while ((portno = portrange.GetToken()))
@@ -215,10 +212,10 @@ class ModuleSSLOpenSSL : public Module
// +1 so we the path ends with a /
confdir = confdir.substr(0, confdir.find_last_of('/') + 1);
- cafile = Conf->ReadValue("openssl", "cafile", 0);
- certfile = Conf->ReadValue("openssl", "certfile", 0);
- keyfile = Conf->ReadValue("openssl", "keyfile", 0);
- dhfile = Conf->ReadValue("openssl", "dhfile", 0);
+ cafile = Conf.ReadValue("openssl", "cafile", 0);
+ certfile = Conf.ReadValue("openssl", "certfile", 0);
+ keyfile = Conf.ReadValue("openssl", "keyfile", 0);
+ dhfile = Conf.ReadValue("openssl", "dhfile", 0);
// Set all the default values needed.
if (cafile.empty())
@@ -287,8 +284,6 @@ class ModuleSSLOpenSSL : public Module
}
fclose(dhpfile);
-
- DELETE(Conf);
}
virtual void On005Numeric(std::string &output)