1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Merged 13767, 13768, 13769, and 13770 from trunk.

* lib/xmlrpc/parser.rb (XMLRPC::Convert::dateTime): Fixing a bug that
  caused time zone conversion to fail for some ISO 8601 date formats.
  [ruby-Bugs-12677]

* lib/xmlrpc/client.rb (XMLRPC::Client#do_rpc): Explicitly start
  the HTTP connection to support keepalive requests. [ruby-Bugs-9353]

* lib/xmlrpc/client.rb (XMLRPC::Client#do_rpc): Improving the error
  message for Content-Type check failures. [ruby-core:12163]

* lib/xmlrpc/utils.rb (XMLRPC::ParseContentType#parse_content_type):
  Making Content-Type checks case insensitive. [ruby-Bugs-3367]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
jeg2 2007-10-24 23:04:42 +00:00
parent 238815c3b2
commit ae8bb3a00c
4 changed files with 25 additions and 5 deletions

View file

@ -1,3 +1,20 @@
Wed Oct 25 08:03:53 2007 James Edward Gray II <jeg2@ruby-lang.org>
Merged 13767, 13768, 13769, and 13770 from trunk.
* lib/xmlrpc/parser.rb (XMLRPC::Convert::dateTime): Fixing a bug that
caused time zone conversion to fail for some ISO 8601 date formats.
[ruby-Bugs-12677]
* lib/xmlrpc/client.rb (XMLRPC::Client#do_rpc): Explicitly start
the HTTP connection to support keepalive requests. [ruby-Bugs-9353]
* lib/xmlrpc/client.rb (XMLRPC::Client#do_rpc): Improving the error
message for Content-Type check failures. [ruby-core:12163]
* lib/xmlrpc/utils.rb (XMLRPC::ParseContentType#parse_content_type):
Making Content-Type checks case insensitive. [ruby-Bugs-3367]
Sun Oct 21 21:16:43 2007 Kouhei Sutou <kou@cozmixng.org> Sun Oct 21 21:16:43 2007 Kouhei Sutou <kou@cozmixng.org>
* lib/rss.rb, lib/rss/, test/rss/, sample/rss/: merged from trunk. * lib/rss.rb, lib/rss/, test/rss/, sample/rss/: merged from trunk.

View file

@ -530,6 +530,9 @@ module XMLRPC
} }
else else
# reuse the HTTP object for each call => connection alive is possible # reuse the HTTP object for each call => connection alive is possible
# we must start connection explicitely first time so that http.request
# does not assume that we don't want keepalive
@http.start if not @http.started?
# post request # post request
resp = @http.post2(@path, request, header) resp = @http.post2(@path, request, header)
@ -549,9 +552,9 @@ module XMLRPC
ct = parse_content_type(resp["Content-Type"]).first ct = parse_content_type(resp["Content-Type"]).first
if ct != "text/xml" if ct != "text/xml"
if ct == "text/html" if ct == "text/html"
raise "Wrong content-type: \n#{data}" raise "Wrong content-type (received '#{ct}' but expected 'text/xml'): \n#{data}"
else else
raise "Wrong content-type" raise "Wrong content-type (received '#{ct}' but expected 'text/xml')"
end end
end end

View file

@ -92,7 +92,7 @@ module XMLRPC
if $7 if $7
ofs = $8.to_i*3600 + $9.to_i*60 ofs = $8.to_i*3600 + $9.to_i*60
ofs = -ofs if $7=='+' ofs = -ofs if $7=='+'
utc = Time.utc(a.reverse) + ofs utc = Time.utc(*a) + ofs
a = [ utc.year, utc.month, utc.day, utc.hour, utc.min, utc.sec ] a = [ utc.year, utc.month, utc.day, utc.hour, utc.min, utc.sec ]
end end
XMLRPC::DateTime.new(*a) XMLRPC::DateTime.new(*a)
@ -106,7 +106,7 @@ module XMLRPC
if $7 if $7
ofs = $8.to_i*3600 + $9.to_i*60 ofs = $8.to_i*3600 + $9.to_i*60
ofs = -ofs if $7=='+' ofs = -ofs if $7=='+'
utc = Time.utc(a.reverse) + ofs utc = Time.utc(*a) + ofs
a = [ utc.year, utc.month, utc.day, utc.hour, utc.min, utc.sec ] a = [ utc.year, utc.month, utc.day, utc.hour, utc.min, utc.sec ]
end end
XMLRPC::DateTime.new(*a) XMLRPC::DateTime.new(*a)

View file

@ -157,7 +157,7 @@ module XMLRPC
module ParseContentType module ParseContentType
def parse_content_type(str) def parse_content_type(str)
a, *b = str.split(";") a, *b = str.split(";")
return a.strip, *b return a.strip.downcase, *b
end end
end end