diff options
author | Vincent Richard <[email protected]> | 2006-02-24 17:57:17 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2006-02-24 17:57:17 +0000 |
commit | 0b9fd48f97a44a8c401c13d791fe680e12224246 (patch) | |
tree | aa1128b046d2510a61fb39ef5fe30c676c5dbd3c | |
parent | Accept 8-bit characters even if not allowed (non-strict mode). (diff) | |
download | vmime-0b9fd48f97a44a8c401c13d791fe680e12224246.tar.gz vmime-0b9fd48f97a44a8c401c13d791fe680e12224246.zip |
Check for connection before any operation.
-rw-r--r-- | src/net/smtp/SMTPTransport.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/net/smtp/SMTPTransport.cpp b/src/net/smtp/SMTPTransport.cpp index e97bbb6f..4ce19716 100644 --- a/src/net/smtp/SMTPTransport.cpp +++ b/src/net/smtp/SMTPTransport.cpp @@ -520,6 +520,9 @@ void SMTPTransport::internalDisconnect() void SMTPTransport::noop() { + if (!isConnected()) + throw exceptions::not_connected(); + sendRequest("NOOP"); ref <SMTPResponse> resp = readResponse(); @@ -533,6 +536,9 @@ void SMTPTransport::send(const mailbox& expeditor, const mailboxList& recipients utility::inputStream& is, const utility::stream::size_type size, utility::progressListener* progress) { + if (!isConnected()) + throw exceptions::not_connected(); + // If no recipient/expeditor was found, throw an exception if (recipients.isEmpty()) throw exceptions::no_recipient(); |