summaryrefslogtreecommitdiff
path: root/lib/net
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net')
-rw-r--r--lib/net/http.rb14
-rw-r--r--lib/net/protocol.rb2
-rw-r--r--lib/net/smtp.rb7
3 files changed, 12 insertions, 11 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb
index 643d93fcc76..dfc776e9f34 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -156,7 +156,7 @@ All "key" is case-insensitive.
def get( path, u_header = nil, dest = nil, &block )
- resp = get2( path, u_header ) {|f| dest = f.entity( dest, &block ) }
+ resp = get2( path, u_header ) {|f| dest = f.body( dest, &block ) }
resp.value
return resp, dest
end
@@ -184,7 +184,7 @@ All "key" is case-insensitive.
def post( path, data, u_header = nil, dest = nil, &block )
resp = post2( path, data, u_header ) {|f|
- dest = f.entity( dest, &block ) }
+ dest = f.body( dest, &block ) }
resp.value
return resp, dest
end
@@ -199,7 +199,7 @@ All "key" is case-insensitive.
# not tested because I could not setup apache (__;;;
def put( path, src, u_header = nil )
ret = nil
- resp = put2( path, src, u_header ) {|f| ret = f.entity }
+ resp = put2( path, src, u_header ) {|f| ret = f.body }
resp.value
return resp, ret
end
@@ -249,8 +249,12 @@ All "key" is case-insensitive.
if /keep-alive/i === resp['connection'] then
return true
end
+ elsif resp.key? 'proxy-connection' then
+ if /keep-alive/i === resp['proxy-connection'] then
+ return true
+ end
elsif header.key? 'Connection' then
- if /\A\s*keep-alive/i === header['Connection'] then
+ if /keep-alive/i === header['Connection'] then
return true
end
else
@@ -518,12 +522,10 @@ All "key" is case-insensitive.
tmp = resp['connection']
if tmp and /close/i === tmp then
@socket.read_all dest
- @socket.close
else
tmp = resp['proxy-connection']
if tmp and /close/i === tmp then
@socket.read_all dest
- @socket.close
end
end
end
diff --git a/lib/net/protocol.rb b/lib/net/protocol.rb
index fbfb254a668..02a469cc0de 100644
--- a/lib/net/protocol.rb
+++ b/lib/net/protocol.rb
@@ -68,7 +68,7 @@ Object
class Protocol
- Version = '1.1.19'
+ Version = '1.1.20'
class << self
diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb
index 09ae8ecb669..d11cff62359 100644
--- a/lib/net/smtp.rb
+++ b/lib/net/smtp.rb
@@ -141,12 +141,11 @@ Net::Protocol
end
if user and secret then
- begin
- mid = 'auth_' + (authtype || 'cram_md5').to_s
- @command.send mid, user, secret
- rescue NameError
+ mid = 'auth_' + (authtype || 'cram_md5').to_s
+ unless @command.respond_to? mid then
raise ArgumentError, "wrong auth type #{authtype.to_s}"
end
+ @command.send mid, user, secret
end
end