mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-22 15:07:26 +01:00
SecureSMTPClientSession now uses _host from SMTPClientSession
This commit is contained in:
parent
2086a497f5
commit
ec8ea48062
@ -187,6 +187,7 @@ protected:
|
||||
void loginUsingXOAUTH2(const std::string& username, const std::string& password);
|
||||
void loginUsingNTLM(const std::string& username, const std::string& password);
|
||||
DialogSocket& socket();
|
||||
const std::string& host() const;
|
||||
|
||||
private:
|
||||
void sendCommands(const MailMessage& message, const Recipients* pRecipients = 0);
|
||||
@ -231,6 +232,12 @@ inline DialogSocket& SMTPClientSession::socket()
|
||||
}
|
||||
|
||||
|
||||
inline const std::string& SMTPClientSession::host() const
|
||||
{
|
||||
return _host;
|
||||
}
|
||||
|
||||
|
||||
} } // namespace Poco::Net
|
||||
|
||||
|
||||
|
@ -84,9 +84,6 @@ public:
|
||||
///
|
||||
/// Returns true if the STARTTLS command was successful,
|
||||
/// false otherwise.
|
||||
|
||||
private:
|
||||
std::string _host;
|
||||
};
|
||||
|
||||
|
||||
|
@ -29,8 +29,7 @@ SecureSMTPClientSession::SecureSMTPClientSession(const StreamSocket& socket):
|
||||
|
||||
|
||||
SecureSMTPClientSession::SecureSMTPClientSession(const std::string& host, Poco::UInt16 port):
|
||||
SMTPClientSession(host, port),
|
||||
_host(host)
|
||||
SMTPClientSession(host, port)
|
||||
{
|
||||
}
|
||||
|
||||
@ -54,7 +53,7 @@ bool SecureSMTPClientSession::startTLS(Context::Ptr pContext)
|
||||
status = sendCommand("STARTTLS", response);
|
||||
if (!isPositiveCompletion(status)) return false;
|
||||
|
||||
SecureStreamSocket sss(SecureStreamSocket::attach(socket(), _host, pContext));
|
||||
SecureStreamSocket sss(SecureStreamSocket::attach(socket(), host(), pContext));
|
||||
socket() = sss;
|
||||
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user