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

ruby-changes:43446

From: nobu <ko1@a...>
Date: Tue, 28 Jun 2016 15:20:24 +0900 (JST)
Subject: [ruby-changes:43446] nobu:r55520 (trunk): Cache no proxy case

nobu	2016-06-28 15:20:20 +0900 (Tue, 28 Jun 2016)

  New Revision: 55520

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55520

  Log:
    Cache no proxy case
    
    * lib/net/http.rb (Net::HTTP#proxy_uri): cache the case no proxy
      is used.

  Modified files:
    trunk/ChangeLog
    trunk/lib/net/http.rb
Index: lib/net/http.rb
===================================================================
--- lib/net/http.rb	(revision 55519)
+++ lib/net/http.rb	(revision 55520)
@@ -1049,9 +1049,11 @@ module Net   #:nodoc: https://github.com/ruby/ruby/blob/trunk/lib/net/http.rb#L1049
 
     # The proxy URI determined from the environment for this connection.
     def proxy_uri # :nodoc:
+      return if @proxy_uri == false
       @proxy_uri ||= URI::HTTP.new(
         "http".freeze, nil, address, port, nil, nil, nil, nil, nil
-      ).find_proxy
+      ).find_proxy || false
+      @proxy_uri || nil
     end
 
     # The address of the proxy server, if one is configured.
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 55519)
+++ ChangeLog	(revision 55520)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Jun 28 15:20:18 2016  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/net/http.rb (Net::HTTP#proxy_uri): cache the case no proxy
+	  is used.
+
 Tue Jun 28 09:56:29 2016  Stefan Schussler  <mail@s...>
 
 	* object.c (rb_mod_eqq): [DOC] Fix typo in RDoc.  [Fix GH-1393]

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

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