aboutsummaryrefslogtreecommitdiffstats
path: root/src/security/defaultAuthenticator.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2006-03-29 20:06:39 +0000
committerVincent Richard <[email protected]>2006-03-29 20:06:39 +0000
commite9501b48d86d3c450ac4cbd9b1726d0d22b21784 (patch)
tree13e2821f023bae07fb4d57beeddb2bae2d574ec7 /src/security/defaultAuthenticator.cpp
parentForce encoding when there is a CR/LF in the word. (diff)
downloadvmime-e9501b48d86d3c450ac4cbd9b1726d0d22b21784.tar.gz
vmime-e9501b48d86d3c450ac4cbd9b1726d0d22b21784.zip
Refactored and cleaned up smart pointers.
Diffstat (limited to 'src/security/defaultAuthenticator.cpp')
-rw-r--r--src/security/defaultAuthenticator.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/security/defaultAuthenticator.cpp b/src/security/defaultAuthenticator.cpp
index 010d7275..7c3402da 100644
--- a/src/security/defaultAuthenticator.cpp
+++ b/src/security/defaultAuthenticator.cpp
@@ -44,8 +44,10 @@ defaultAuthenticator::~defaultAuthenticator()
const string defaultAuthenticator::getUsername() const
{
- const string prefix = m_service->getInfos().getPropertyPrefix();
- const propertySet& props = m_service->getSession()->getProperties();
+ ref <const net::service> service = m_service.acquire();
+
+ const string prefix = service->getInfos().getPropertyPrefix();
+ const propertySet& props = service->getSession()->getProperties();
if (props.hasProperty(prefix + net::serviceInfos::property::AUTH_USERNAME.getName()))
return props[prefix + net::serviceInfos::property::AUTH_USERNAME.getName()];
@@ -56,8 +58,10 @@ const string defaultAuthenticator::getUsername() const
const string defaultAuthenticator::getPassword() const
{
- const string prefix = m_service->getInfos().getPropertyPrefix();
- const propertySet& props = m_service->getSession()->getProperties();
+ ref <const net::service> service = m_service.acquire();
+
+ const string prefix = service->getInfos().getPropertyPrefix();
+ const propertySet& props = service->getSession()->getProperties();
if (props.hasProperty(prefix + net::serviceInfos::property::AUTH_PASSWORD.getName()))
return props[prefix + net::serviceInfos::property::AUTH_PASSWORD.getName()];