ruby-changes:21804
From: naruse <ko1@a...>
Date: Sun, 27 Nov 2011 04:59:22 +0900 (JST)
Subject: [ruby-changes:21804] naruse:r33853 (trunk): * lib/net/http.rb (Net::HTTP::SSL_IVNAMES): rerefix 33701.
naruse 2011-11-27 04:59:11 +0900 (Sun, 27 Nov 2011) New Revision: 33853 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33853 Log: * lib/net/http.rb (Net::HTTP::SSL_IVNAMES): rerefix 33701. SSL_ATTRIBUTES stores names for set_params, they are symbol. SSL_IVNAMES stores instance variable names. Modified files: trunk/ChangeLog trunk/lib/net/http.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 33852) +++ ChangeLog (revision 33853) @@ -1,3 +1,9 @@ +Sun Nov 27 04:55:45 2011 NARUSE, Yui <naruse@r...> + + * lib/net/http.rb (Net::HTTP::SSL_IVNAMES): rerefix 33701. + SSL_ATTRIBUTES stores names for set_params, they are symbol. + SSL_IVNAMES stores instance variable names. + Sun Nov 27 00:16:07 2011 Tanaka Akira <akr@f...> * io.c (copy_stream_body): use 0666 for permission argument for open. Index: lib/net/http.rb =================================================================== --- lib/net/http.rb (revision 33852) +++ lib/net/http.rb (revision 33853) @@ -591,10 +591,8 @@ @enable_post_connection_check = true @compression = nil @sspi_enabled = false - if defined?(SSL_ATTRIBUTES) - SSL_ATTRIBUTES.each do |name| - instance_variable_set name, nil - end + SSL_IVNAMES.each do |ivname| + instance_variable_set ivname, nil end end @@ -676,7 +674,7 @@ @use_ssl = flag end - SSL_ATTRIBUTES = [ + SSL_IVNAMES = [ :@ca_file, :@ca_path, :@cert, @@ -689,6 +687,19 @@ :@verify_depth, :@verify_mode, ] + SSL_ATTRIBUTES = [ + :ca_file, + :ca_path, + :cert, + :cert_store, + :ciphers, + :key, + :ssl_timeout, + :ssl_version, + :verify_callback, + :verify_depth, + :verify_mode, + ] # Sets path of a CA certification file in PEM format. # @@ -775,10 +786,10 @@ if use_ssl? ssl_parameters = Hash.new iv_list = instance_variables - SSL_ATTRIBUTES.each do |ivname| + SSL_IVNAMES.each_with_index do |ivname, i| if iv_list.include?(ivname) and - value = instance_variable_get(ivname) - ssl_parameters[name] = value + value = instance_variable_get(ivname) + ssl_parameters[SSL_ATTRIBUTES[i]] = value if value end end @ssl_context = OpenSSL::SSL::SSLContext.new -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/