Catch closed stream in readf

This commit is contained in:
Omar Roth 2019-11-24 14:24:45 -05:00
parent 50041fa046
commit 1f7c9c652f
1 changed files with 7 additions and 3 deletions

View File

@ -12,9 +12,13 @@ module QUIC
class Client
STREAM_READF = ->(stream_if_ctx : Void*, buf : UInt8*, buf_len : LibC::SizeT, fin : LibC::Int) do
stream_ctx = Box(StreamCtx).unbox(stream_if_ctx)
stream_ctx.io.write Slice.new(buf, buf_len)
buf_len
begin
stream_ctx = Box(StreamCtx).unbox(stream_if_ctx)
stream_ctx.io.write Slice.new(buf, buf_len)
buf_len
rescue ex
0_u64
end
end
ON_NEW_STREAM = ->(stream_if_ctx : Void*, s : LibLsquic::StreamT) do