mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
aamine
* lib/net/pop.rb: POP3#reset * lib/net/http.rb: a code for "Switch Protocol" was wrongly 100 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9dbce410e1
commit
76819ef99a
3 changed files with 32 additions and 7 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Thu Oct 12 18:56:28 2000 Minero Aoki <aamine@dp.u-netsurf.ne.jp>
|
||||||
|
|
||||||
|
* lib/net/pop.rb: POP3#reset
|
||||||
|
|
||||||
|
* lib/net/http.rb: a code for "Switch Protocol" was wrongly 100
|
||||||
|
|
||||||
Thu Oct 12 01:23:38 2000 Wakou Aoyama <wakou@fsinet.or.jp>
|
Thu Oct 12 01:23:38 2000 Wakou Aoyama <wakou@fsinet.or.jp>
|
||||||
|
|
||||||
* lib/cgi.rb: bug fix: CGI::html(): PRETTY option didn't work.
|
* lib/cgi.rb: bug fix: CGI::html(): PRETTY option didn't work.
|
||||||
|
|
|
@ -787,7 +787,7 @@ SRC
|
||||||
|
|
||||||
HTTPCODE_TO_OBJ = {
|
HTTPCODE_TO_OBJ = {
|
||||||
'100' => ContinueCode,
|
'100' => ContinueCode,
|
||||||
'100' => HTTPSwitchProtocol,
|
'101' => HTTPSwitchProtocol,
|
||||||
|
|
||||||
'200' => HTTPOK,
|
'200' => HTTPOK,
|
||||||
'201' => HTTPCreated,
|
'201' => HTTPCreated,
|
||||||
|
|
|
@ -45,6 +45,9 @@ Net::Protocol
|
||||||
an array of ((URL:#POPMail)).
|
an array of ((URL:#POPMail)).
|
||||||
This array is renewed when session started.
|
This array is renewed when session started.
|
||||||
|
|
||||||
|
: reset
|
||||||
|
reset the session. All "deleted mark" are removed.
|
||||||
|
|
||||||
|
|
||||||
== Net::APOP
|
== Net::APOP
|
||||||
|
|
||||||
|
@ -128,13 +131,22 @@ module Net
|
||||||
|
|
||||||
def initialize( addr = nil, port = nil )
|
def initialize( addr = nil, port = nil )
|
||||||
super
|
super
|
||||||
@mails = [].freeze
|
@mails = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
attr :mails
|
attr :mails
|
||||||
|
|
||||||
def each
|
def each( &block )
|
||||||
@mails.each {|m| yield m }
|
io_check
|
||||||
|
@mails.each &block
|
||||||
|
end
|
||||||
|
|
||||||
|
def reset
|
||||||
|
io_check
|
||||||
|
@command.rset
|
||||||
|
@mails.each do |m|
|
||||||
|
m.instance_eval { @deleted = false }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -144,15 +156,21 @@ module Net
|
||||||
@command.auth( acnt, pwd )
|
@command.auth( acnt, pwd )
|
||||||
|
|
||||||
@mails = []
|
@mails = []
|
||||||
t = type.mail_type
|
mtype = type.mail_type
|
||||||
@command.list.each_with_index do |size,idx|
|
@command.list.each_with_index do |size,idx|
|
||||||
if size then
|
if size then
|
||||||
@mails.push t.new( idx, size, @command )
|
@mails.push mtype.new( idx, size, @command )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@mails.freeze
|
@mails.freeze
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def io_check
|
||||||
|
if not @socket or @socket.closed? then
|
||||||
|
raise IOError, 'pop session is not opened yet'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
POP = POP3
|
POP = POP3
|
||||||
|
@ -197,13 +215,14 @@ module Net
|
||||||
end
|
end
|
||||||
|
|
||||||
def header( dest = '' )
|
def header( dest = '' )
|
||||||
top( 0, dest )
|
top 0, dest
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete
|
def delete
|
||||||
@command.dele( @num )
|
@command.dele( @num )
|
||||||
@deleted = true
|
@deleted = true
|
||||||
end
|
end
|
||||||
|
|
||||||
alias delete! delete
|
alias delete! delete
|
||||||
|
|
||||||
def deleted?
|
def deleted?
|
||||||
|
|
Loading…
Add table
Reference in a new issue