зеркало из https://github.com/github/ruby.git
openssl/buffering.rb: no RS when output
* ext/openssl/lib/openssl/buffering.rb (do_write, puts): output methods should not be affected by the input record separator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
b101d2c2b1
Коммит
07decad25f
|
@ -316,8 +316,8 @@ module OpenSSL::Buffering
|
||||||
@wbuffer << s
|
@wbuffer << s
|
||||||
@wbuffer.force_encoding(Encoding::BINARY)
|
@wbuffer.force_encoding(Encoding::BINARY)
|
||||||
@sync ||= false
|
@sync ||= false
|
||||||
if @sync or @wbuffer.size > BLOCK_SIZE or idx = @wbuffer.rindex($/)
|
if @sync or @wbuffer.size > BLOCK_SIZE or idx = @wbuffer.rindex("\n")
|
||||||
remain = idx ? idx + $/.size : @wbuffer.length
|
remain = idx ? idx + 1 : @wbuffer.size
|
||||||
nwritten = 0
|
nwritten = 0
|
||||||
while remain > 0
|
while remain > 0
|
||||||
str = @wbuffer[nwritten,remain]
|
str = @wbuffer[nwritten,remain]
|
||||||
|
@ -409,9 +409,7 @@ module OpenSSL::Buffering
|
||||||
end
|
end
|
||||||
args.each{|arg|
|
args.each{|arg|
|
||||||
s << arg.to_s
|
s << arg.to_s
|
||||||
if $/ && /\n\z/ !~ s
|
s.sub!(/(?<!\n)\z/, "\n")
|
||||||
s << "\n"
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
do_write(s)
|
do_write(s)
|
||||||
nil
|
nil
|
||||||
|
|
Загрузка…
Ссылка в новой задаче