diff options
author | gotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-06-30 18:21:39 +0000 |
---|---|---|
committer | gotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-06-30 18:21:39 +0000 |
commit | d1b92d20e7eb57eb5611a3cf3331f248e618ecb4 (patch) | |
tree | e6d1224b20f87d8d7cae95775ecdbabf04fc9522 /ext/openssl/lib | |
parent | 67bfb5bf0e62de7c9611420ddf51b1472244a576 (diff) | |
download | ruby-d1b92d20e7eb57eb5611a3cf3331f248e618ecb4.tar.gz ruby-d1b92d20e7eb57eb5611a3cf3331f248e618ecb4.tar.xz ruby-d1b92d20e7eb57eb5611a3cf3331f248e618ecb4.zip |
* ext/openssl/ossl_ssl.c (ossl_ssl_read): take optional second argument
to specify a string to be written.
* ext/openssl/lib/openssl/buffering.rb (OpenSSL::Buffering#read):
take optional second argument to specify a string to be written.
* ext/openssl/lib/openssl/buffering.rb (OpenSSL::Buffering#gets):
refine regexp for end-of-line.
* ext/opnessl/lib/openssl/ssl.rb
(OpenSSL::SSL::SocketForwarder#listen): fix typo.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/lib')
-rw-r--r-- | ext/openssl/lib/openssl/buffering.rb | 11 | ||||
-rw-r--r-- | ext/openssl/lib/openssl/ssl.rb | 9 |
2 files changed, 15 insertions, 5 deletions
diff --git a/ext/openssl/lib/openssl/buffering.rb b/ext/openssl/lib/openssl/buffering.rb index fdbd71bc0..6fcb143fc 100644 --- a/ext/openssl/lib/openssl/buffering.rb +++ b/ext/openssl/lib/openssl/buffering.rb @@ -54,14 +54,19 @@ module Buffering public - def read(size=nil) + def read(size=nil, buf=nil) fill_rbuff unless defined? @rbuffer @eof ||= nil until @eof break if size && size <= @rbuffer.size fill_rbuff end - consume_rbuff(size) + ret = consume_rbuff(size) || "" + if buf + buf.replace(ret) + ret = buf + end + (size && ret.empty?) ? nil : ret end def gets(eol=$/) @@ -164,7 +169,7 @@ module Buffering s = "" args.each{|arg| s << arg.to_s - unless /#{$/}\Z/o =~ s + unless /#{$/}\z/o =~ s s << $/ end } diff --git a/ext/openssl/lib/openssl/ssl.rb b/ext/openssl/lib/openssl/ssl.rb index 811a93550..629109a1d 100644 --- a/ext/openssl/lib/openssl/ssl.rb +++ b/ext/openssl/lib/openssl/ssl.rb @@ -14,7 +14,8 @@ $Id$ =end -require 'openssl/buffering' +require "openssl" +require "openssl/buffering" module OpenSSL module SSL @@ -42,6 +43,10 @@ module OpenSSL def closed? to_io.closed? end + + def do_not_reverse_lookup=(flag) + to_io.do_not_reverse_lookup = flag + end end class SSLSocket @@ -63,7 +68,7 @@ module OpenSSL @svr end - def listen(basklog=5) + def listen(backlog=5) @svr.listen(backlog) end |