diff options
| author | Debi King (Dessie) <dessie@lindenlab.com> | 2011-10-06 14:00:26 -0400 |
|---|---|---|
| committer | Debi King (Dessie) <dessie@lindenlab.com> | 2011-10-06 14:00:26 -0400 |
| commit | 0a4b187301e1d5521dda7d2f157a94f02d597365 (patch) | |
| tree | 92cee20619bc5406670689bfa06bf9dc45c23bc4 /indra/llmessage/llmail.cpp | |
| parent | a7076142429eb604e4f756223b70ff85a5ea3490 (diff) | |
| parent | 6095127468f91770abe276b7d55754bbec228df3 (diff) | |
merged .hgtags
Diffstat (limited to 'indra/llmessage/llmail.cpp')
| -rw-r--r-- | indra/llmessage/llmail.cpp | 17 |
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); } } |
