mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/net/protocol.rb, smtp.rb, pop.rb, http.rb: 1.1.26.
* lib/net/protocol.rb (finish): do nothing unless active. * lib/net/http.rb: HTTP#{get,post}2 again (for new impl). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4550e07889
commit
9dd98aa46e
2 changed files with 6 additions and 14 deletions
|
@ -248,30 +248,23 @@ module Net
|
||||||
|
|
||||||
undef head
|
undef head
|
||||||
alias head head2
|
alias head head2
|
||||||
undef head2
|
|
||||||
|
|
||||||
alias old_get2 get2
|
|
||||||
undef get2
|
|
||||||
undef get
|
undef get
|
||||||
|
|
||||||
def get( path, u_header = nil, dest = nil, &block )
|
def get( path, u_header = nil, dest = nil, &block )
|
||||||
old_get2( path, u_header ) {|f| f.body( dest, &block ) }
|
get2( path, u_header ) {|f| f.body( dest, &block ) }
|
||||||
end
|
end
|
||||||
|
|
||||||
alias old_post2 post2
|
|
||||||
undef post2
|
|
||||||
undef post
|
undef post
|
||||||
|
|
||||||
def post( path, data, u_header = nil, dest = nil, &block )
|
def post( path, data, u_header = nil, dest = nil, &block )
|
||||||
old_post2( path, data, u_header ) {|f| f.body( dest, &block ) }
|
post2( path, data, u_header ) {|f| f.body( dest, &block ) }
|
||||||
end
|
end
|
||||||
|
|
||||||
alias old_put2 put2
|
|
||||||
undef put2
|
|
||||||
undef put
|
undef put
|
||||||
|
|
||||||
def put( path, src, u_header = nil )
|
def put( path, src, u_header = nil )
|
||||||
old_put2( path, src, u_header ) {|f| f.body }
|
put2( path, src, u_header ) {|f| f.body }
|
||||||
end
|
end
|
||||||
|
|
||||||
^
|
^
|
||||||
|
|
|
@ -64,7 +64,7 @@ module Net
|
||||||
|
|
||||||
class Protocol
|
class Protocol
|
||||||
|
|
||||||
Version = '1.1.25'
|
Version = '1.1.26'
|
||||||
|
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
|
@ -173,13 +173,12 @@ module Net
|
||||||
end
|
end
|
||||||
|
|
||||||
def finish
|
def finish
|
||||||
ret = active?
|
return false unless active?
|
||||||
|
|
||||||
do_finish
|
do_finish
|
||||||
disconnect
|
disconnect
|
||||||
@active = false
|
@active = false
|
||||||
|
true
|
||||||
ret
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def active?
|
def active?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue