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

ruby-changes:36500

From: naruse <ko1@a...>
Date: Wed, 26 Nov 2014 17:22:44 +0900 (JST)
Subject: [ruby-changes:36500] naruse:r48582 (trunk): use clock_gettime to avoid object creation

naruse	2014-11-26 17:22:35 +0900 (Wed, 26 Nov 2014)

  New Revision: 48582

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

  Log:
    use clock_gettime to avoid object creation

  Modified files:
    trunk/lib/net/http.rb
Index: lib/net/http.rb
===================================================================
--- lib/net/http.rb	(revision 48581)
+++ lib/net/http.rb	(revision 48582)
@@ -915,7 +915,7 @@ module Net   #:nodoc: https://github.com/ruby/ruby/blob/trunk/lib/net/http.rb#L915
             HTTPResponse.read_new(@socket).value
           end
           if @ssl_session and
-             Time.now < @ssl_session.time + @ssl_session.timeout
+             Process.clock_gettime(Process::CLOCK_REALTIME) < @ssl_session.time.to_f + @ssl_session.timeout
             s.session = @ssl_session if @ssl_session
           end
           # Server Name Indication (SNI) RFC 3546

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

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