mirror of
https://gitea.invidious.io/iv-org/lsquic.cr
synced 2024-08-15 00:43:31 +00:00
Catch closed stream in readf
This commit is contained in:
parent
50041fa046
commit
1f7c9c652f
1 changed files with 7 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue