Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 7 additions & 17 deletions lib/openssl/buffering.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ def initialize(*)
def fill_rbuff
begin
@rbuffer.append_as_bytes(self.sysread(BLOCK_SIZE))
rescue Errno::EAGAIN
retry
rescue EOFError
@eof = true
end
Expand Down Expand Up @@ -152,11 +150,7 @@ def readpartial(maxlen, buf=nil)
end
end
if @rbuffer.empty?
begin
return sysread(maxlen, buf)
rescue Errno::EAGAIN
retry
end
return sysread(maxlen, buf)
end
ret = consume_rbuff(maxlen)
if buf
Expand Down Expand Up @@ -356,17 +350,13 @@ def do_write(s)
nwrote = 0
begin
while nwrote < buffer_size do
begin
chunk = if nwrote > 0
@wbuffer.byteslice(nwrote, @wbuffer.bytesize)
else
@wbuffer
end

nwrote += syswrite(chunk)
rescue Errno::EAGAIN
retry
chunk = if nwrote > 0
@wbuffer.byteslice(nwrote, @wbuffer.bytesize)
else
@wbuffer
end

nwrote += syswrite(chunk)
end
ensure
if nwrote < @wbuffer.bytesize
Expand Down
Loading