[前][次][番号順一覧][スレッド一覧]

ruby-changes:2280

From: ko1@a...
Date: 25 Oct 2007 08:05:04 +0900
Subject: [ruby-changes:2280] jeg2 - Ruby:r13771 (ruby_1_8): Merged 13767, 13768, 13769, and 13770 from trunk.

jeg2	2007-10-25 08:04:42 +0900 (Thu, 25 Oct 2007)

  New Revision: 13771

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/lib/xmlrpc/client.rb
    branches/ruby_1_8/lib/xmlrpc/parser.rb
    branches/ruby_1_8/lib/xmlrpc/utils.rb

  Log:
    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]


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/lib/xmlrpc/parser.rb?r1=13771&r2=13770
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ChangeLog?r1=13771&r2=13770
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/lib/xmlrpc/utils.rb?r1=13771&r2=13770
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/lib/xmlrpc/client.rb?r1=13771&r2=13770

Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 13770)
+++ ruby_1_8/ChangeLog	(revision 13771)
@@ -1,3 +1,20 @@
+Wed Oct 25 08:03:53 2007  James Edward Gray II  <jeg2@r...>
+
+	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@c...>
 
 	* lib/rss.rb, lib/rss/, test/rss/, sample/rss/: merged from trunk.
Index: ruby_1_8/lib/xmlrpc/client.rb
===================================================================
--- ruby_1_8/lib/xmlrpc/client.rb	(revision 13770)
+++ ruby_1_8/lib/xmlrpc/client.rb	(revision 13771)
@@ -530,6 +530,9 @@
         }
       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 @@
       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
 
Index: ruby_1_8/lib/xmlrpc/utils.rb
===================================================================
--- ruby_1_8/lib/xmlrpc/utils.rb	(revision 13770)
+++ ruby_1_8/lib/xmlrpc/utils.rb	(revision 13771)
@@ -157,7 +157,7 @@
   module ParseContentType
     def parse_content_type(str)
       a, *b = str.split(";")
-      return a.strip, *b
+      return a.strip.downcase, *b
     end
   end
 
Index: ruby_1_8/lib/xmlrpc/parser.rb
===================================================================
--- ruby_1_8/lib/xmlrpc/parser.rb	(revision 13770)
+++ ruby_1_8/lib/xmlrpc/parser.rb	(revision 13771)
@@ -92,7 +92,7 @@
         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 @@
         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)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧]