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
|
class Client
|
||||||
STREAM_READF = ->(stream_if_ctx : Void*, buf : UInt8*, buf_len : LibC::SizeT, fin : LibC::Int) do
|
STREAM_READF = ->(stream_if_ctx : Void*, buf : UInt8*, buf_len : LibC::SizeT, fin : LibC::Int) do
|
||||||
stream_ctx = Box(StreamCtx).unbox(stream_if_ctx)
|
begin
|
||||||
stream_ctx.io.write Slice.new(buf, buf_len)
|
stream_ctx = Box(StreamCtx).unbox(stream_if_ctx)
|
||||||
buf_len
|
stream_ctx.io.write Slice.new(buf, buf_len)
|
||||||
|
buf_len
|
||||||
|
rescue ex
|
||||||
|
0_u64
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
ON_NEW_STREAM = ->(stream_if_ctx : Void*, s : LibLsquic::StreamT) do
|
ON_NEW_STREAM = ->(stream_if_ctx : Void*, s : LibLsquic::StreamT) do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue