summaryrefslogtreecommitdiff
path: root/indra/llmessage/llmail.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-10-14 11:52:40 -0500
committerDave Parks <davep@lindenlab.com>2011-10-14 11:52:40 -0500
commit4331c112aba074562e9a8826fe6d271a94f790f0 (patch)
treeaa6e1d387821c1ea5906a7aa9b3dd474ece431b7 /indra/llmessage/llmail.cpp
parentef490e308ccce8e6df85144784a0f4580f5ac6a1 (diff)
Backed out changeset b782a75c99e6
Diffstat (limited to 'indra/llmessage/llmail.cpp')
-rw-r--r--indra/llmessage/llmail.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/indra/llmessage/llmail.cpp b/indra/llmessage/llmail.cpp
index 8a898ab1b0..08b31e9c7a 100644
--- a/indra/llmessage/llmail.cpp
+++ b/indra/llmessage/llmail.cpp
@@ -50,7 +50,6 @@
#include "llstring.h"
#include "lluuid.h"
#include "net.h"
-#include "llaprpool.h"
//
// constants
@@ -58,7 +57,7 @@
const size_t LL_MAX_KNOWN_GOOD_MAIL_SIZE = 4096;
static bool gMailEnabled = true;
-static LLAPRPool gMailPool;
+static apr_pool_t* gMailPool;
static apr_sockaddr_t* gSockAddr;
static apr_socket_t* gMailSocket;
@@ -83,7 +82,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))
@@ -140,19 +139,19 @@ BOOL LLMail::send(
}
// static
-void LLMail::init(const std::string& hostname)
+void LLMail::init(const std::string& hostname, apr_pool_t* pool)
{
gMailSocket = NULL;
- if (hostname.empty())
+ if(hostname.empty() || !pool)
{
+ gMailPool = NULL;
gSockAddr = NULL;
- gMailPool.destroy();
}
else
{
- gMailPool.create();
+ gMailPool = pool;
- // Collect all the information into a sockaddr structure. the
+ // collect all the information into a socaddr sturcture. 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.
@@ -162,7 +161,7 @@ void LLMail::init(const std::string& hostname)
APR_UNSPEC,
25,
APR_IPV4_ADDR_OK,
- gMailPool());
+ gMailPool);
ll_apr_warn_status(status);
}
}