mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
{protocol,smtp,pop,http}.rb for ruby 1.4 branch
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_4@673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
cf520dda16
commit
54588fb3f1
3 changed files with 82 additions and 72 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue