Project

General

Profile

Feature #14426 » openssl-memory-allocation.patch

janko (Janko Marohnić), 07/07/2018 05:04 PM

View differences:

ext/openssl/lib/openssl/buffering.rb
@wbuffer << s
@wbuffer.force_encoding(Encoding::BINARY)
@sync ||= false
if @sync or @wbuffer.size > BLOCK_SIZE or idx = @wbuffer.rindex("\n")
remain = idx ? idx + 1 : @wbuffer.size
nwritten = 0
while remain > 0
str = @wbuffer[nwritten,remain]
if @sync or @wbuffer.size > BLOCK_SIZE
until @wbuffer.empty?
begin
nwrote = syswrite(str)
nwrote = syswrite(@wbuffer)
rescue Errno::EAGAIN
retry
end
remain -= nwrote
nwritten += nwrote
@wbuffer[0, nwrote] = ""
end
@wbuffer[0,nwritten] = ""
end
end
    (1-1/1)