diff options
author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-12-07 10:12:52 +0000 |
---|---|---|
committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-12-07 10:12:52 +0000 |
commit | 772678cb7a56c58b83a53bd7782348052032da77 (patch) | |
tree | 0f4ea14c828b913d82734700fe7afda2729e0340 /lib | |
parent | 9a697aeb959af3549792e0bcc94f370c96163b94 (diff) |
aamine
* lib/net/smtp.rb: uses Digest::MD5 instead of MD5 (again).
* lib/net/pop.rb: ditto.
* lib/net/http.rb (HTTP#request): must pass block.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/http.rb | 6 | ||||
-rw-r--r-- | lib/net/pop.rb | 6 | ||||
-rw-r--r-- | lib/net/protocol.rb | 4 | ||||
-rw-r--r-- | lib/net/smtp.rb | 10 |
4 files changed, 13 insertions, 13 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb index e4f5b612ba..01f16a8864 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -1,6 +1,6 @@ =begin -= net/http.rb version 1.1.36 += net/http.rb version 1.1.37 Copyright (c) 1999-2001 Yukihiro Matsumoto @@ -591,11 +591,11 @@ module Net define_http_method_interface :Post, true, true define_http_method_interface :Put, false, true - def request( req, body = nil ) + def request( req, body = nil, &block ) unless active? then start { req['connection'] = 'close' - return request(req, body) + return request(req, body, &block) } end diff --git a/lib/net/pop.rb b/lib/net/pop.rb index a31276a622..b2dbb9339b 100644 --- a/lib/net/pop.rb +++ b/lib/net/pop.rb @@ -1,6 +1,6 @@ =begin -= net/pop.rb version 1.1.36 += net/pop.rb version 1.1.37 Copyright (c) 1999-2001 Yukihiro Matsumoto @@ -287,7 +287,7 @@ A class of mail which exists on POP server. =end require 'net/protocol' -require 'md5' +require 'digest/md5' module Net @@ -570,7 +570,7 @@ module Net critical { @socket.writeline sprintf( 'APOP %s %s', account, - MD5.new(@stamp + pass).hexdigest ) + Digest::MD5.hexdigest(@stamp + pass) ) check_reply_auth } end diff --git a/lib/net/protocol.rb b/lib/net/protocol.rb index 9781fb690f..66ca62df30 100644 --- a/lib/net/protocol.rb +++ b/lib/net/protocol.rb @@ -1,6 +1,6 @@ =begin -= net/protocol.rb version 1.1.36 += net/protocol.rb version 1.1.37 Copyright (c) 1999-2001 Yukihiro Matsumoto @@ -31,7 +31,7 @@ module Net class Protocol - Version = '1.1.36' + Version = '1.1.37' class << self diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb index 8813d7f835..73db96ee27 100644 --- a/lib/net/smtp.rb +++ b/lib/net/smtp.rb @@ -1,6 +1,6 @@ =begin -= net/smtp.rb version 1.1.36 += net/smtp.rb version 1.1.37 Copyright (c) 1999-2001 Yukihiro Matsumoto @@ -191,7 +191,7 @@ SMTP objects raise these exceptions: =end require 'net/protocol' -require 'md5' +require 'digest/md5' module Net @@ -317,7 +317,7 @@ module Net critical { rep = getok( 'AUTH CRAM-MD5', ContinueCode ) challenge = rep.msg.split(' ')[1].unpack('m')[0] - secret = MD5.new( secret ).digest if secret.size > 64 + secret = Digest::MD5.digest( secret ) if secret.size > 64 isecret = secret + "\0" * (64 - secret.size) osecret = isecret.dup @@ -325,8 +325,8 @@ module Net isecret[i] ^= 0x36 osecret[i] ^= 0x5c end - tmp = MD5.new( isecret + challenge ).digest - tmp = MD5.new( osecret + tmp ).hexdigest + tmp = Digest::MD5.digest( isecret + challenge ) + tmp = Digest::MD5.hexdigest( osecret + tmp ) getok [user + ' ' + tmp].pack('m').chomp } |