mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@6411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6dee0fab9b
commit
fde5c3ff92
3 changed files with 19 additions and 8 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ module OpenSSL
|
|||
@svr
|
||||
end
|
||||
|
||||
def listen(basklog=5)
|
||||
def listen(backlog=5)
|
||||
@svr.listen(backlog)
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue