aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmessage/llmail.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/llmessage/llmail.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/linden/indra/llmessage/llmail.cpp b/linden/indra/llmessage/llmail.cpp
index d52ff6c..8850e29 100644
--- a/linden/indra/llmessage/llmail.cpp
+++ b/linden/indra/llmessage/llmail.cpp
@@ -56,6 +56,7 @@
56#include "llstring.h" 56#include "llstring.h"
57#include "lluuid.h" 57#include "lluuid.h"
58#include "net.h" 58#include "net.h"
59#include "aiaprpool.h"
59 60
60// 61//
61// constants 62// constants
@@ -63,7 +64,7 @@
63const size_t LL_MAX_KNOWN_GOOD_MAIL_SIZE = 4096; 64const size_t LL_MAX_KNOWN_GOOD_MAIL_SIZE = 4096;
64 65
65static bool gMailEnabled = true; 66static bool gMailEnabled = true;
66static apr_pool_t* gMailPool; 67static AIAPRPool gMailPool;
67static apr_sockaddr_t* gSockAddr; 68static apr_sockaddr_t* gSockAddr;
68static apr_socket_t* gMailSocket; 69static apr_socket_t* gMailSocket;
69 70
@@ -88,7 +89,7 @@ bool connect_smtp()
88 gSockAddr->sa.sin.sin_family, 89 gSockAddr->sa.sin.sin_family,
89 SOCK_STREAM, 90 SOCK_STREAM,
90 APR_PROTO_TCP, 91 APR_PROTO_TCP,
91 gMailPool); 92 gMailPool());
92 if(ll_apr_warn_status(status)) return false; 93 if(ll_apr_warn_status(status)) return false;
93 status = apr_socket_connect(gMailSocket, gSockAddr); 94 status = apr_socket_connect(gMailSocket, gSockAddr);
94 if(ll_apr_warn_status(status)) 95 if(ll_apr_warn_status(status))
@@ -145,19 +146,19 @@ BOOL LLMail::send(
145} 146}
146 147
147// static 148// static
148void LLMail::init(const std::string& hostname, apr_pool_t* pool) 149void LLMail::init(const std::string& hostname)
149{ 150{
150 gMailSocket = NULL; 151 gMailSocket = NULL;
151 if(hostname.empty() || !pool) 152 if (hostname.empty())
152 { 153 {
153 gMailPool = NULL;
154 gSockAddr = NULL; 154 gSockAddr = NULL;
155 gMailPool.destroy();
155 } 156 }
156 else 157 else
157 { 158 {
158 gMailPool = pool; 159 gMailPool.create();
159 160
160 // collect all the information into a socaddr sturcture. the 161 // Collect all the information into a sockaddr structure. the
161 // documentation is a bit unclear, but I either have to 162 // documentation is a bit unclear, but I either have to
162 // specify APR_UNSPEC or not specify any flags. I am not sure 163 // specify APR_UNSPEC or not specify any flags. I am not sure
163 // which option is better. 164 // which option is better.
@@ -167,7 +168,7 @@ void LLMail::init(const std::string& hostname, apr_pool_t* pool)
167 APR_UNSPEC, 168 APR_UNSPEC,
168 25, 169 25,
169 APR_IPV4_ADDR_OK, 170 APR_IPV4_ADDR_OK,
170 gMailPool); 171 gMailPool());
171 ll_apr_warn_status(status); 172 ll_apr_warn_status(status);
172 } 173 }
173} 174}