summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/xmlrpc/client.rb7
-rw-r--r--lib/xmlrpc/parser.rb4
-rw-r--r--lib/xmlrpc/utils.rb2
3 files changed, 8 insertions, 5 deletions
diff --git a/lib/xmlrpc/client.rb b/lib/xmlrpc/client.rb
index 10f547b632..726945ea39 100644
--- a/lib/xmlrpc/client.rb
+++ b/lib/xmlrpc/client.rb
@@ -530,6 +530,9 @@ module XMLRPC
}
else
# 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
resp = @http.post2(@path, request, header)
@@ -549,9 +552,9 @@ module XMLRPC
ct = parse_content_type(resp["Content-Type"]).first
if ct != "text/xml"
if ct == "text/html"
- raise "Wrong content-type: \n#{data}"
+ raise "Wrong content-type (received '#{ct}' but expected 'text/xml'): \n#{data}"
else
- raise "Wrong content-type"
+ raise "Wrong content-type (received '#{ct}' but expected 'text/xml')"
end
end
diff --git a/lib/xmlrpc/parser.rb b/lib/xmlrpc/parser.rb
index d27d7c3827..6d10fde9d9 100644
--- a/lib/xmlrpc/parser.rb
+++ b/lib/xmlrpc/parser.rb
@@ -92,7 +92,7 @@ module XMLRPC
if $7
ofs = $8.to_i*3600 + $9.to_i*60
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 ]
end
XMLRPC::DateTime.new(*a)
@@ -106,7 +106,7 @@ module XMLRPC
if $7
ofs = $8.to_i*3600 + $9.to_i*60
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 ]
end
XMLRPC::DateTime.new(*a)
diff --git a/lib/xmlrpc/utils.rb b/lib/xmlrpc/utils.rb
index 85c6bba372..f0966fee40 100644
--- a/lib/xmlrpc/utils.rb
+++ b/lib/xmlrpc/utils.rb
@@ -157,7 +157,7 @@ module XMLRPC
module ParseContentType
def parse_content_type(str)
a, *b = str.split(";")
- return a.strip, *b
+ return a.strip.downcase, *b
end
end