aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2014-01-19 15:36:06 +0000
committerVincent Richard <[email protected]>2014-01-19 15:36:06 +0000
commitb6469f68a8c61da02d440cdd022c17cd8cdaeeaa (patch)
tree53c4101591181362a8581934f617108ee4a7124e /src
parentAdded test for "+" not followed by space in continue_req. (diff)
downloadvmime-b6469f68a8c61da02d440cdd022c17cd8cdaeeaa.tar.gz
vmime-b6469f68a8c61da02d440cdd022c17cd8cdaeeaa.zip
Fixed SMTP disconnection error caused by handshake failure.
Diffstat (limited to 'src')
-rw-r--r--src/vmime/net/smtp/SMTPConnection.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/vmime/net/smtp/SMTPConnection.cpp b/src/vmime/net/smtp/SMTPConnection.cpp
index e0b5bc68..574e5354 100644
--- a/src/vmime/net/smtp/SMTPConnection.cpp
+++ b/src/vmime/net/smtp/SMTPConnection.cpp
@@ -522,16 +522,19 @@ void SMTPConnection::disconnect()
void SMTPConnection::internalDisconnect()
{
- try
+ if (isConnected())
{
- sendRequest(SMTPCommand::QUIT());
+ try
+ {
+ sendRequest(SMTPCommand::QUIT());
- // Do not wait for server response. This is contrary to the RFC, but
- // some servers never send a response to a QUIT command.
- }
- catch (exception&)
- {
- // Not important
+ // Do not wait for server response. This is contrary to the RFC, but
+ // some servers never send a response to a QUIT command.
+ }
+ catch (exception&)
+ {
+ // Not important
+ }
}
m_socket->disconnect();