diff options
| author | orivej <[email protected]> | 2022-02-10 16:44:49 +0300 |
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:44:49 +0300 |
| commit | 718c552901d703c502ccbefdfc3c9028d608b947 (patch) | |
| tree | 46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /contrib/libs/poco/NetSSL_OpenSSL/src/SecureSMTPClientSession.cpp | |
| parent | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/poco/NetSSL_OpenSSL/src/SecureSMTPClientSession.cpp')
| -rw-r--r-- | contrib/libs/poco/NetSSL_OpenSSL/src/SecureSMTPClientSession.cpp | 128 |
1 files changed, 64 insertions, 64 deletions
diff --git a/contrib/libs/poco/NetSSL_OpenSSL/src/SecureSMTPClientSession.cpp b/contrib/libs/poco/NetSSL_OpenSSL/src/SecureSMTPClientSession.cpp index c1a9569bc76..ff0fd5b0d4e 100644 --- a/contrib/libs/poco/NetSSL_OpenSSL/src/SecureSMTPClientSession.cpp +++ b/contrib/libs/poco/NetSSL_OpenSSL/src/SecureSMTPClientSession.cpp @@ -1,64 +1,64 @@ -// -// SecureSMTPClientSession.h -// -// Library: NetSSL_OpenSSL -// Package: Mail -// Module: SecureSMTPClientSession -// -// Copyright (c) 2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/Net/SecureSMTPClientSession.h" -#include "Poco/Net/SecureStreamSocket.h" -#include "Poco/Net/SSLManager.h" -#include "Poco/Net/DialogSocket.h" - - -namespace Poco { -namespace Net { - - -SecureSMTPClientSession::SecureSMTPClientSession(const StreamSocket& socket): - SMTPClientSession(socket) -{ -} - - -SecureSMTPClientSession::SecureSMTPClientSession(const std::string& host, Poco::UInt16 port): - SMTPClientSession(host, port), - _host(host) -{ -} - - -SecureSMTPClientSession::~SecureSMTPClientSession() -{ -} - - -bool SecureSMTPClientSession::startTLS() -{ - return startTLS(SSLManager::instance().defaultClientContext()); -} - - -bool SecureSMTPClientSession::startTLS(Context::Ptr pContext) -{ - int status = 0; - std::string response; - - status = sendCommand("STARTTLS", response); - if (!isPositiveCompletion(status)) return false; - - SecureStreamSocket sss(SecureStreamSocket::attach(socket(), _host, pContext)); - socket() = sss; - - return true; -} - - -} } // namespace Poco::Net +// +// SecureSMTPClientSession.h +// +// Library: NetSSL_OpenSSL +// Package: Mail +// Module: SecureSMTPClientSession +// +// Copyright (c) 2010, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "Poco/Net/SecureSMTPClientSession.h" +#include "Poco/Net/SecureStreamSocket.h" +#include "Poco/Net/SSLManager.h" +#include "Poco/Net/DialogSocket.h" + + +namespace Poco { +namespace Net { + + +SecureSMTPClientSession::SecureSMTPClientSession(const StreamSocket& socket): + SMTPClientSession(socket) +{ +} + + +SecureSMTPClientSession::SecureSMTPClientSession(const std::string& host, Poco::UInt16 port): + SMTPClientSession(host, port), + _host(host) +{ +} + + +SecureSMTPClientSession::~SecureSMTPClientSession() +{ +} + + +bool SecureSMTPClientSession::startTLS() +{ + return startTLS(SSLManager::instance().defaultClientContext()); +} + + +bool SecureSMTPClientSession::startTLS(Context::Ptr pContext) +{ + int status = 0; + std::string response; + + status = sendCommand("STARTTLS", response); + if (!isPositiveCompletion(status)) return false; + + SecureStreamSocket sss(SecureStreamSocket::attach(socket(), _host, pContext)); + socket() = sss; + + return true; +} + + +} } // namespace Poco::Net |
