summaryrefslogtreecommitdiff
path: root/ext/openssl/lib/openssl
diff options
context:
space:
mode:
authorgotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-08-17 08:22:45 +0000
committergotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-08-17 08:22:45 +0000
commit39c4886fe761cf4cc4f4f137cf3602c9ee616184 (patch)
treeedadc927e0f71fa96d55a26318d9a11be1298803 /ext/openssl/lib/openssl
parent7544cb39302fc5964849d43b80472c2071f28261 (diff)
* ext/openssl/lib/openssl/ssl.rb (SSLSocket#sync_close=): add a
method to specify if the underlying IO will be closed in SSLSocket#close. * ext/openssl/lib/openssl/buffering.rb: add forwarders to setsockopt, getsockopt and fcntl. * ext/openssl/lib/net/protocols.rb: enable sync for SSLSocket. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/lib/openssl')
-rw-r--r--ext/openssl/lib/openssl/buffering.rb4
-rw-r--r--ext/openssl/lib/openssl/ssl.rb13
2 files changed, 15 insertions, 2 deletions
diff --git a/ext/openssl/lib/openssl/buffering.rb b/ext/openssl/lib/openssl/buffering.rb
index f07e5bc4c16..6ddec099bf6 100644
--- a/ext/openssl/lib/openssl/buffering.rb
+++ b/ext/openssl/lib/openssl/buffering.rb
@@ -16,7 +16,7 @@
module Buffering
include Enumerable
- attr_accessor :sync
+ attr_accessor :sync, :sync_close
BLOCK_SIZE = 1024*16
#
@@ -185,5 +185,7 @@ module Buffering
def close
flush
sysclose
+ @sync_close ||= false
+ @io.close if @sync_close
end
end
diff --git a/ext/openssl/lib/openssl/ssl.rb b/ext/openssl/lib/openssl/ssl.rb
index e4349419133..39d975b1c88 100644
--- a/ext/openssl/lib/openssl/ssl.rb
+++ b/ext/openssl/lib/openssl/ssl.rb
@@ -29,10 +29,21 @@ module OpenSSL
@io.peeraddr
end
+ def getsockopt(level, optname, optval)
+ @io.setsockopt(level, optname, optval)
+ end
+
+ def setsockopt(level, optname)
+ @io.setsockopt(level, optname)
+ end
+
+ def fcntl(*args)
+ @io.fcntl(*args)
+ end
+
def closed?
@io.closed?
end
end
end
end
-