summaryrefslogtreecommitdiff
path: root/modules/extra/m_ssl.cpp
diff options
context:
space:
mode:
authorNaram Qashat <cyberbotx@cyberbotx.com>2010-07-25 21:58:20 -0400
committerNaram Qashat <cyberbotx@cyberbotx.com>2010-07-25 21:58:20 -0400
commitae38212c1ce829c783edf971081c90137abb49a0 (patch)
tree5c652d9cdc38103dec6fa112d57fca882b4e3e44 /modules/extra/m_ssl.cpp
parent15d7f0f6fe8bb903275f603f734c13f65f3aa906 (diff)
Epic commit to replace most of the strings in Anope with a single Anope::string class, plus some other little fixes here and there. If you follow 1.9.x development and are testing things, THIS is one of those things that NEEDS testing.
Diffstat (limited to 'modules/extra/m_ssl.cpp')
-rw-r--r--modules/extra/m_ssl.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/modules/extra/m_ssl.cpp b/modules/extra/m_ssl.cpp
index 599e76e8f..386dd0d5f 100644
--- a/modules/extra/m_ssl.cpp
+++ b/modules/extra/m_ssl.cpp
@@ -24,12 +24,12 @@ class SSLSocket : public ClientSocket
return SSL_read(sslsock, buf, sz);
}
- const int SendInternal(const std::string &buf) const
+ const int SendInternal(const Anope::string &buf) const
{
- return SSL_write(sslsock, buf.c_str(), buf.size());
+ return SSL_write(sslsock, buf.c_str(), buf.length());
}
public:
- SSLSocket(const std::string &nTargetHost, int nPort, const std::string &nBindHost = "", bool nIPv6 = false) : ClientSocket(nTargetHost, nPort, nBindHost, nIPv6)
+ SSLSocket(const Anope::string &nTargetHost, int nPort, const Anope::string &nBindHost = "", bool nIPv6 = false) : ClientSocket(nTargetHost, nPort, nBindHost, nIPv6)
{
this->SetBlocking();
@@ -39,7 +39,7 @@ class SSLSocket : public ClientSocket
throw CoreException("Unable to initialize SSL socket");
SSL_set_connect_state(sslsock);
- SSL_set_fd(sslsock, sock);
+ SSL_set_fd(sslsock, Sock);
SSL_connect(sslsock);
UplinkSock = this;
@@ -55,7 +55,7 @@ class SSLSocket : public ClientSocket
UplinkSock = NULL;
}
- bool Read(const std::string &buf)
+ bool Read(const Anope::string &buf)
{
process(buf);
return true;
@@ -65,7 +65,7 @@ class SSLSocket : public ClientSocket
class SSLModule : public Module
{
public:
- SSLModule(const std::string &modname, const std::string &creator) : Module(modname, creator)
+ SSLModule(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator)
{
SSL_load_error_strings();
SSLeay_add_ssl_algorithms();
@@ -128,10 +128,10 @@ class SSLModule : public Module
{
try
{
- new SSLSocket(u->host, u->port, Config.LocalHost ? Config.LocalHost : "", u->ipv6);
+ new SSLSocket(u->host, u->port, Config.LocalHost, u->ipv6);
Alog() << "Connected to Server " << Number << " (" << u->host << ":" << u->port << ")";
}
- catch (SocketException& ex)
+ catch (const SocketException &ex)
{
Alog() << "Unable to connect with SSL to server" << Number << " (" << u->host << ":" << u->port << "), " << ex.GetReason();
}