summaryrefslogtreecommitdiff
path: root/lib/net/smtp.rb
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-09-29 14:39:54 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-09-29 14:39:54 +0000
commit819e8e6c82f05203c28d4e191d7dbe351d2f2905 (patch)
treede99c6531bdbb6cbeaf919eb93c4b6fda9ee2fae /lib/net/smtp.rb
parentccf1c21d3e0b0de90dc4fbaeab186f69296983ea (diff)
* lib/net/http.rb (finish): does not raise IOError even if !started?, to allow duplicated #finish call.
* lib/net/pop.rb (finish): ditto. * lib/net/smtp.rb (finish): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net/smtp.rb')
-rw-r--r--lib/net/smtp.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb
index d2de78239b..b14d43832a 100644
--- a/lib/net/smtp.rb
+++ b/lib/net/smtp.rb
@@ -331,7 +331,7 @@ module Net # :nodoc:
do_start(helo, user, secret, authtype)
return yield(self)
ensure
- finish if @started
+ finish
end
else
do_start(helo, user, secret, authtype)
@@ -365,11 +365,8 @@ module Net # :nodoc:
end
private :do_start
- # Finish (close) the SMTP session.
- #
- # If the SMTP session has not been started, an IOError is raised.
+ # Finishes the SMTP session and closes TCP connection.
def finish
- raise IOError, 'closing already closed SMTP session' unless @started
quit if @socket and not @socket.closed? and not @error_occured
@socket.close if @socket and not @socket.closed?
@socket = nil