Skip to content

Commit 718f7f3

Browse files
committed
merge revision(s) 13771:
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_5@16905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent e782b42 commit 718f7f3

File tree

5 files changed

+26
-6
lines changed

5 files changed

+26
-6
lines changed

ChangeLog

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
Sun Jun 8 01:51:52 2008 James Edward Gray II <jeg2@ruby-lang.org>
2+
3+
Merged 13767, 13768, 13769, and 13770 from trunk.
4+
5+
* lib/xmlrpc/parser.rb (XMLRPC::Convert::dateTime): Fixing a bug that
6+
caused time zone conversion to fail for some ISO 8601 date formats.
7+
[ruby-Bugs-12677]
8+
9+
* lib/xmlrpc/client.rb (XMLRPC::Client#do_rpc): Explicitly start
10+
the HTTP connection to support keepalive requests. [ruby-Bugs-9353]
11+
12+
* lib/xmlrpc/client.rb (XMLRPC::Client#do_rpc): Improving the error
13+
message for Content-Type check failures. [ruby-core:12163]
14+
15+
* lib/xmlrpc/utils.rb (XMLRPC::ParseContentType#parse_content_type):
16+
Making Content-Type checks case insensitive. [ruby-Bugs-3367]
17+
118
Sun Jun 8 01:45:27 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
219

320
* marshal.c (r_bytes0): refined length check. [ruby-dev:32059]

lib/xmlrpc/client.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,9 @@ def do_rpc(request, async=false)
530530
}
531531
else
532532
# reuse the HTTP object for each call => connection alive is possible
533+
# we must start connection explicitely first time so that http.request
534+
# does not assume that we don't want keepalive
535+
@http.start if not @http.started?
533536

534537
# post request
535538
resp = @http.post2(@path, request, header)
@@ -549,9 +552,9 @@ def do_rpc(request, async=false)
549552
ct = parse_content_type(resp["Content-Type"]).first
550553
if ct != "text/xml"
551554
if ct == "text/html"
552-
raise "Wrong content-type: \n#{data}"
555+
raise "Wrong content-type (received '#{ct}' but expected 'text/xml'): \n#{data}"
553556
else
554-
raise "Wrong content-type"
557+
raise "Wrong content-type (received '#{ct}' but expected 'text/xml')"
555558
end
556559
end
557560

lib/xmlrpc/parser.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def self.dateTime(str)
9292
if $7
9393
ofs = $8.to_i*3600 + $9.to_i*60
9494
ofs = -ofs if $7=='+'
95-
utc = Time.utc(a.reverse) + ofs
95+
utc = Time.utc(*a) + ofs
9696
a = [ utc.year, utc.month, utc.day, utc.hour, utc.min, utc.sec ]
9797
end
9898
XMLRPC::DateTime.new(*a)
@@ -106,7 +106,7 @@ def self.dateTime(str)
106106
if $7
107107
ofs = $8.to_i*3600 + $9.to_i*60
108108
ofs = -ofs if $7=='+'
109-
utc = Time.utc(a.reverse) + ofs
109+
utc = Time.utc(*a) + ofs
110110
a = [ utc.year, utc.month, utc.day, utc.hour, utc.min, utc.sec ]
111111
end
112112
XMLRPC::DateTime.new(*a)

lib/xmlrpc/utils.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def self.iPIMethods(prefix)
157157
module ParseContentType
158158
def parse_content_type(str)
159159
a, *b = str.split(";")
160-
return a.strip, *b
160+
return a.strip.downcase, *b
161161
end
162162
end
163163

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define RUBY_RELEASE_DATE "2008-06-08"
33
#define RUBY_VERSION_CODE 185
44
#define RUBY_RELEASE_CODE 20080608
5-
#define RUBY_PATCHLEVEL 136
5+
#define RUBY_PATCHLEVEL 137
66

77
#define RUBY_VERSION_MAJOR 1
88
#define RUBY_VERSION_MINOR 8

0 commit comments

Comments
 (0)