[#34261] ComplexFloat — "Kenta Murata" <muraken@...>

村田です.

117 messages 2008/04/06
[#34280] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/10

村田です.

[#34286] Re: ComplexFloat — Nobuyoshi Nakada <nobu@...> 2008/04/10

なかだです。

[#34288] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/10

むらたです.

[#34290] Re: ComplexFloat — "U.Nakamura" <usa@...> 2008/04/10

こんにちは、なかむら(う)です。

[#34293] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/10

むらたです.

[#34296] Re: ComplexFloat — "U.Nakamura" <usa@...> 2008/04/10

こんにちは、なかむら(う)です。

[#34298] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/10

むらたです.

[#34300] Re: ComplexFloat — Tanaka Akira <akr@...> 2008/04/10

In article <761216ce0804100221x67f10f12iab12b0e35b6f50e4@mail.gmail.com>,

[#34301] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/10

むらたです.

[#34303] Re: ComplexFloat — Yukihiro Matsumoto <matz@...> 2008/04/10

まつもと ゆきひろです

[#34314] Re: ComplexFloat — Tadayoshi Funaba <tadf@...> 2008/04/10

利点としては、拡張ライブラリが書きやすい、ということ。正当化の理由とし

[#34316] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/10

むらたです.

[#34317] Re: ComplexFloat — Tadayoshi Funaba <tadf@...> 2008/04/10

> 私にはいびつな進化という感じはしません.むしろ,せっかく C で実装できるのに

[#34318] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/10

むらたです.

[#34322] Re: ComplexFloat — Yukihiro Matsumoto <matz@...> 2008/04/10

まつもと ゆきひろです

[#34328] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/11

むらたです.

[#34331] Re: ComplexFloat — Yukihiro Matsumoto <matz@...> 2008/04/11

まつもと ゆきひろです

[#34340] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/11

むらたです.

[#34341] Re: ComplexFloat — Yukihiro Matsumoto <matz@...> 2008/04/11

まつもと ゆきひろです

[#34362] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/12

むらたです.

[#34363] Re: ComplexFloat — Tanaka Akira <akr@...> 2008/04/12

In article <761216ce0804120723n16bfbad7qdae90f142978d256@mail.gmail.com>,

[#34367] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/12

むらたです.

[#34368] Re: ComplexFloat — Tanaka Akira <akr@...> 2008/04/12

In article <761216ce0804121011h6132d58fh4916ecbb29d58690@mail.gmail.com>,

[#34369] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/12

むらたです.

[#34364] Re: ComplexFloat — Yukihiro Matsumoto <matz@...> 2008/04/12

まつもと ゆきひろです

[#34366] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/12

むらたです.

[#34386] Re: ComplexFloat — Yukihiro Matsumoto <matz@...> 2008/04/13

まつもと ゆきひろです

[#34415] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/15

むらたです.

[#34439] Re: ComplexFloat — Shin-ichiro HARA <sinara@...> 2008/04/17

原です。

[#34442] Re: ComplexFloat — Yukihiro Matsumoto <matz@...> 2008/04/17

まつもと ゆきひろです

[#34451] Re: ComplexFloat — Shin-ichiro HARA <sinara@...> 2008/04/18

原です。

[#34455] Re: ComplexFloat — Tadayoshi Funaba <tadf@...> 2008/04/18

> 1. ComplexFloat を組込みにし、Complex を標準ライブラリとして提供する。

[#34457] Re: ComplexFloat — Shin-ichiro HARA <sinara@...> 2008/04/20

原です。

[#34458] Re: ComplexFloat — Tadayoshi Funaba <tadf@...> 2008/04/20

> 分かりににくかったですが、これは、ComplexFloat を含めた組込みの数体系が

[#34502] Re: ComplexFloat — sheepman <sh@...> 2008/04/24

こんばんは sheepman です。

[#34601] Re: ComplexFloat — Yukihiro Matsumoto <matz@...> 2008/05/07

まつもと ゆきひろです

[#34603] Re: ComplexFloat — keiju@... (石塚圭樹) 2008/05/07

けいじゅ@いしつかです.

[#34614] Re: ComplexFloat — Yukihiro Matsumoto <matz@...> 2008/05/08

まつもと ゆきひろです

[#34621] Re: ComplexFloat — keiju@... (石塚圭樹) 2008/05/08

けいじゅ@いしつかです.

[ruby-dev:34403] XMLRPC::Client doesn't handle cookie correctly

From: Kouhei Sutou <kou@...>
Date: 2008-04-15 12:17:33 UTC
List: ruby-dev #34403
須藤です。

XMLRPC::ClientがSet-Cookieをきちんと扱っていないことを見つけ
てしまいました。trunk用のパッチですが、ruby_1_8にもあたります。

Attachments (1)

ruby-xmlrpc-client-cookie.diff (3.22 KB, text/x-diff)
Index: lib/xmlrpc/client.rb
===================================================================
--- lib/xmlrpc/client.rb	(revision 16040)
+++ lib/xmlrpc/client.rb	(working copy)
@@ -565,8 +565,13 @@
         raise "Wrong size. Was #{data.size}, should be #{expected}"
       end
 
-      c = resp["Set-Cookie"]
-      @cookie = c if c
+      set_cookies = resp.get_fields("Set-Cookie")
+      if set_cookies and !set_cookies.empty?
+        @cookie = set_cookies.collect do |set_cookie|
+          cookie = WEBrick::Cookie.parse_set_cookie(set_cookie)
+          WEBrick::Cookie.new(cookie.name, cookie.value).to_s
+        end.join("; ")
+      end
 
       return data
     end
Index: test/xmlrpc/test_cookie.rb
===================================================================
--- test/xmlrpc/test_cookie.rb	(revision 0)
+++ test/xmlrpc/test_cookie.rb	(revision 0)
@@ -0,0 +1,96 @@
+require 'test/unit'
+require 'time'
+require 'webrick'
+require File.join(File.dirname(__FILE__), 'webrick_testing')
+require "xmlrpc/server"
+require 'xmlrpc/client'
+
+class TestCookie < Test::Unit::TestCase
+  include WEBrick_Testing
+
+  def create_servlet
+    s = XMLRPC::WEBrickServlet.new
+
+    def s.logged_in_users
+      @logged_in_users ||= {}
+    end
+    def s.request
+      @request
+    end
+    def s.response
+      @response
+    end
+    def s.service(request, response)
+      @request = request
+      @response = response
+      super
+    ensure
+      @request = nil
+      @response = nil
+    end
+
+    key = Time.now.to_i.to_s
+    valid_user = "valid-user"
+    s.add_handler("test.login") do |user, password|
+      ok = (user == valid_user and password == "secret")
+      if ok
+        s.logged_in_users[key] = user
+        expires = (Time.now + 60 * 60).httpdate
+        cookies = s.response.cookies
+        cookies << "key=\"#{key}\"; path=\"/RPC2\"; expires=#{expires}"
+        cookies << "user=\"#{user}\"; path=\"/RPC2\""
+      end
+      ok
+    end
+
+    s.add_handler("test.require_authenticate_echo") do |string|
+      cookies = {}
+      s.request.cookies.each do |cookie|
+        cookies[cookie.name] = cookie.value
+      end
+      if cookies == {"key" => key, "user" => valid_user}
+        string
+      else
+        raise XMLRPC::FaultException.new(29, "Authentication required")
+      end
+    end
+
+    s.set_default_handler do |name, *args|
+      raise XMLRPC::FaultException.new(-99, "Method #{name} missing" +
+            " or wrong number of parameters!")
+    end
+
+    s.add_introspection
+
+    s
+  end
+
+  def setup_http_server(port)
+    option = {:Port => port}
+
+    start_server(option) {|w| w.mount('/RPC2', create_servlet) }
+
+    @s = XMLRPC::Client.new3(:port => port)
+  end
+
+  PORT = 8070
+  def test_cookie
+    begin
+      setup_http_server(PORT)
+      do_test
+    ensure
+      stop_server
+    end
+  end
+
+  def do_test
+    assert(!@s.call("test.login", "invalid-user", "invalid-password"))
+    exception = assert_raise(XMLRPC::FaultException) do
+      @s.call("test.require_authenticate_echo", "Hello")
+    end
+    assert_equal(29, exception.faultCode)
+
+    assert(@s.call("test.login", "valid-user", "secret"))
+    assert_equal("Hello", @s.call("test.require_authenticate_echo", "Hello"))
+  end
+end

In This Thread

Prev Next