summaryrefslogtreecommitdiff
path: root/indra/llmessage/llmail.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmessage/llmail.cpp')
-rw-r--r--indra/llmessage/llmail.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/indra/llmessage/llmail.cpp b/indra/llmessage/llmail.cpp
index 08b31e9c7a..8a898ab1b0 100644
--- a/indra/llmessage/llmail.cpp
+++ b/indra/llmessage/llmail.cpp
@@ -50,6 +50,7 @@
#include "llstring.h"
#include "lluuid.h"
#include "net.h"
+#include "llaprpool.h"
//
// constants
@@ -57,7 +58,7 @@
const size_t LL_MAX_KNOWN_GOOD_MAIL_SIZE = 4096;
static bool gMailEnabled = true;
-static apr_pool_t* gMailPool;
+static LLAPRPool gMailPool;
static apr_sockaddr_t* gSockAddr;
static apr_socket_t* gMailSocket;
@@ -82,7 +83,7 @@ bool connect_smtp()
gSockAddr->sa.sin.sin_family,
SOCK_STREAM,
APR_PROTO_TCP,
- gMailPool);
+ gMailPool());
if(ll_apr_warn_status(status)) return false;
status = apr_socket_connect(gMailSocket, gSockAddr);
if(ll_apr_warn_status(status))
@@ -139,19 +140,19 @@ BOOL LLMail::send(
}
// static
-void LLMail::init(const std::string& hostname, apr_pool_t* pool)
+void LLMail::init(const std::string& hostname)
{
gMailSocket = NULL;
- if(hostname.empty() || !pool)
+ if (hostname.empty())
{
- gMailPool = NULL;
gSockAddr = NULL;
+ gMailPool.destroy();
}
else
{
- gMailPool = pool;
+ gMailPool.create();
- // collect all the information into a socaddr sturcture. the
+ // Collect all the information into a sockaddr structure. the
// documentation is a bit unclear, but I either have to
// specify APR_UNSPEC or not specify any flags. I am not sure
// which option is better.
@@ -161,7 +162,7 @@ void LLMail::init(const std::string& hostname, apr_pool_t* pool)
APR_UNSPEC,
25,
APR_IPV4_ADDR_OK,
- gMailPool);
+ gMailPool());
ll_apr_warn_status(status);
}
}