diff options
author | niel@nirvana-win7hp.planescape.home <niel@nirvana-win7hp.planescape.home> | 2011-10-26 01:42:26 +0100 |
---|---|---|
committer | niel@nirvana-win7hp.planescape.home <niel@nirvana-win7hp.planescape.home> | 2011-10-26 01:42:26 +0100 |
commit | 4fd9a53115bf85ffe17974323d5fa609e0df960c (patch) | |
tree | 7968008d0fa7c0347d637e1fb19add9d436b926d /indra/llmessage/llmail.cpp | |
parent | 42c166e451d362609d83fb17261f9e8f344e974d (diff) | |
parent | b7a349f231977d5917b29faacca143a85d925576 (diff) |
Merge STORM-959
Diffstat (limited to 'indra/llmessage/llmail.cpp')
-rw-r--r-- | indra/llmessage/llmail.cpp | 17 |
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); } } |