mirror of
https://github.com/pocoproject/poco.git
synced 2025-07-04 09:37:11 +02:00
SecureSMTPClientSession now uses _host from SMTPClientSession
This commit is contained in:
parent
dc4d36dad5
commit
e98f752cff
@ -59,7 +59,7 @@ public:
|
|||||||
/// Destroys the SMTPClientSession.
|
/// Destroys the SMTPClientSession.
|
||||||
|
|
||||||
bool startTLS();
|
bool startTLS();
|
||||||
/// Sends a STARTTLS command and, if successful,
|
/// Sends a STARTTLS command and, if successful,
|
||||||
/// creates a secure SSL/TLS connection over the
|
/// creates a secure SSL/TLS connection over the
|
||||||
/// existing socket connection.
|
/// existing socket connection.
|
||||||
///
|
///
|
||||||
@ -71,7 +71,7 @@ public:
|
|||||||
/// false otherwise.
|
/// false otherwise.
|
||||||
|
|
||||||
bool startTLS(Context::Ptr pContext);
|
bool startTLS(Context::Ptr pContext);
|
||||||
/// Sends a STARTTLS command and, if successful,
|
/// Sends a STARTTLS command and, if successful,
|
||||||
/// creates a secure SSL/TLS connection over the
|
/// creates a secure SSL/TLS connection over the
|
||||||
/// existing socket connection.
|
/// existing socket connection.
|
||||||
///
|
///
|
||||||
@ -84,9 +84,6 @@ public:
|
|||||||
///
|
///
|
||||||
/// Returns true if the STARTTLS command was successful,
|
/// Returns true if the STARTTLS command was successful,
|
||||||
/// false otherwise.
|
/// false otherwise.
|
||||||
|
|
||||||
private:
|
|
||||||
std::string _host;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,8 +29,7 @@ SecureSMTPClientSession::SecureSMTPClientSession(const StreamSocket& socket):
|
|||||||
|
|
||||||
|
|
||||||
SecureSMTPClientSession::SecureSMTPClientSession(const std::string& host, Poco::UInt16 port):
|
SecureSMTPClientSession::SecureSMTPClientSession(const std::string& host, Poco::UInt16 port):
|
||||||
SMTPClientSession(host, port),
|
SMTPClientSession(host, port)
|
||||||
_host(host)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,13 +49,13 @@ bool SecureSMTPClientSession::startTLS(Context::Ptr pContext)
|
|||||||
{
|
{
|
||||||
int status = 0;
|
int status = 0;
|
||||||
std::string response;
|
std::string response;
|
||||||
|
|
||||||
status = sendCommand("STARTTLS", response);
|
status = sendCommand("STARTTLS", response);
|
||||||
if (!isPositiveCompletion(status)) return false;
|
if (!isPositiveCompletion(status)) return false;
|
||||||
|
|
||||||
SecureStreamSocket sss(SecureStreamSocket::attach(socket(), _host, pContext));
|
SecureStreamSocket sss(SecureStreamSocket::attach(socket(), host(), pContext));
|
||||||
socket() = sss;
|
socket() = sss;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user