From f9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Thu, 21 Nov 2013 22:16:57 +0100 Subject: Boost/C++11 shared pointers. --- src/net/smtp/SMTPTransport.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/net/smtp/SMTPTransport.cpp') diff --git a/src/net/smtp/SMTPTransport.cpp b/src/net/smtp/SMTPTransport.cpp index 91487ed4..4f409a03 100644 --- a/src/net/smtp/SMTPTransport.cpp +++ b/src/net/smtp/SMTPTransport.cpp @@ -51,7 +51,7 @@ namespace net { namespace smtp { -SMTPTransport::SMTPTransport(ref sess, ref auth, const bool secured) +SMTPTransport::SMTPTransport(shared_ptr sess, shared_ptr auth, const bool secured) : transport(sess, getInfosInstance(), auth), m_isSMTPS(secured), m_needReset(false) { } @@ -88,8 +88,8 @@ void SMTPTransport::connect() if (isConnected()) throw exceptions::already_connected(); - m_connection = vmime::create - (thisRef().dynamicCast (), getAuthenticator()); + m_connection = make_shared + (dynamicCast (shared_from_this()), getAuthenticator()); try { @@ -97,7 +97,7 @@ void SMTPTransport::connect() } catch (std::exception&) { - m_connection = NULL; + m_connection = null; throw; } } @@ -118,16 +118,16 @@ bool SMTPTransport::isSecuredConnection() const } -ref SMTPTransport::getConnectionInfos() const +shared_ptr SMTPTransport::getConnectionInfos() const { if (m_connection == NULL) - return NULL; + return null; return m_connection->getConnectionInfos(); } -ref SMTPTransport::getConnection() +shared_ptr SMTPTransport::getConnection() { return m_connection; } @@ -139,7 +139,7 @@ void SMTPTransport::disconnect() throw exceptions::not_connected(); m_connection->disconnect(); - m_connection = NULL; + m_connection = null; } @@ -150,7 +150,7 @@ void SMTPTransport::noop() m_connection->sendRequest(SMTPCommand::NOOP()); - ref resp = m_connection->readResponse(); + shared_ptr resp = m_connection->readResponse(); if (resp->getCode() != 250) { @@ -177,8 +177,8 @@ void SMTPTransport::sendEnvelope getInfos().getPropertyValue (getSession(), dynamic_cast (getInfos()).getProperties().PROPERTY_OPTIONS_PIPELINING); - ref resp; - ref commands = SMTPCommandSet::create(hasPipelining); + shared_ptr resp; + shared_ptr commands = SMTPCommandSet::create(hasPipelining); // Emit a "RSET" command if we previously sent a message on this connection if (needReset) @@ -336,7 +336,7 @@ void SMTPTransport::send // Send end-of-data delimiter m_connection->getSocket()->sendRaw("\r\n.\r\n", 5); - ref resp; + shared_ptr resp; if ((resp = m_connection->readResponse())->getCode() != 250) { @@ -349,7 +349,7 @@ void SMTPTransport::send void SMTPTransport::send - (ref msg, const mailbox& expeditor, const mailboxList& recipients, + (shared_ptr msg, const mailbox& expeditor, const mailboxList& recipients, utility::progressListener* progress, const mailbox& sender) { if (!isConnected()) -- cgit v1.2.3