summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-09 17:56:40 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-09 17:56:40 +0000
commita967390d04a26a134bfb7b1945d4dcec3d7355bc (patch)
tree82be6f3bb2af10d55c9706704e3543f04a0b7067
parent0bd01d00585400b11649072a1d72cb3c740abf91 (diff)
* lib/net/http.rb: come back autoload. OpenSSL constant is used
some places, so it leads mistakes like HTTP.start. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--lib/net/http.rb8
2 files changed, 7 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 26384c77d7..7cf7f23a62 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Aug 10 02:53:27 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/net/http.rb: come back autoload. OpenSSL constant is used
+ some places, so it leads mistakes like HTTP.start.
+
Tue Aug 9 22:57:45 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
* ext/date/date_parse.c (date_zone_to_diff): add RB_GC_GUARD.
diff --git a/lib/net/http.rb b/lib/net/http.rb
index 7c9032aaa6..7b9ec4f568 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -21,6 +21,7 @@
require 'net/protocol'
require 'uri'
+autoload :OpenSSL, 'openssl'
module Net #:nodoc:
@@ -666,12 +667,7 @@ module Net #:nodoc:
# If you change use_ssl value after session started,
# a Net::HTTP object raises IOError.
def use_ssl=(flag)
- flag = if flag
- require 'openssl' unless defined?(OpenSSL)
- true
- else
- false
- end
+ flag = flag ? true : false
if started? and @use_ssl != flag
raise IOError, "use_ssl value changed, but session already started"
end