diff options
author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-04-18 09:39:02 +0000 |
---|---|---|
committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-04-18 09:39:02 +0000 |
commit | 4f0aeb3cf739b246bfae2ac8a789e1f57c582abc (patch) | |
tree | 357c1aef0bf57364c00c910343ed0d9fad04a4f4 /lib/net/protocol.rb | |
parent | c8f58f2a16c88603abe56c34b346cad5817975b3 (diff) | |
download | ruby-4f0aeb3cf739b246bfae2ac8a789e1f57c582abc.tar.gz |
{protocol,smtp,pop}.rb version 1.1.14
o http.rb: HTTP#head2
o http.rb: HTTPResponse#value
o http.rb: get2/post2 returns response header
o http.rb: *2 does not raise exceptions
o smtp.rb: try esmtp only first time
o protocol.rb: remove error_occured
o protocol.rb: Command#error! does not take argument
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net/protocol.rb')
-rw-r--r-- | lib/net/protocol.rb | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/lib/net/protocol.rb b/lib/net/protocol.rb index 5fbfb53230..534cfa355e 100644 --- a/lib/net/protocol.rb +++ b/lib/net/protocol.rb @@ -15,7 +15,7 @@ require 'socket' module Net - Version = '1.1.13' + Version = '1.1.14' =begin @@ -224,13 +224,12 @@ Object def initialize( sock ) @socket = sock - @error_occured = false @last_reply = nil @critical = false end - attr_reader :socket, :error_occured, :last_reply - attr_writer :socket + attr_accessor :socket + attr_reader :last_reply # abstract quit @@ -250,9 +249,7 @@ Object return rep end end - - @error_occured = true - rep.error! @socket.sending + rep.error! end def getok( line, ok = SuccessCode ) @@ -298,17 +295,8 @@ Object attr_reader :code_type, :code, :message alias msg message - def error!( sending ) - raise @code_type.error_type, - sprintf( <<MSG, @code, Net.quote(sending), Net.quote(@message) ) - -status %s -writing string is: -%s - -error message from server is: -%s -MSG + def error! + raise @code_type.error_type, @code + ' ' + Net.quote(@message) end end |