summaryrefslogtreecommitdiff
path: root/indra/llmessage/llmail.cpp
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2011-07-19 23:48:11 -0600
committerXiaohong Bao <bao@lindenlab.com>2011-07-19 23:48:11 -0600
commit83e48f4a5100ab1adadc27a3e7a0b23b68b8b568 (patch)
tree68a2b81442389d1f9e54bce3dca5bc0e47b7a3e6 /indra/llmessage/llmail.cpp
parent4dc0850da7469906e5ad052da71830b05005295b (diff)
parent76eca5d0bce3e303f6d77b0d16f114320830ac6a (diff)
Merge
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);
}
}