mirror of
https://gitea.invidious.io/iv-org/lsquic.cr
synced 2024-08-15 00:43:31 +00:00
Catch exception in on_read
This commit is contained in:
parent
7f2ecbfcdc
commit
aa94a6ea1b
1 changed files with 3 additions and 2 deletions
|
@ -83,11 +83,12 @@ class QUIC::Client
|
|||
bytes_read = LibLsquic.stream_read(s, buffer, buffer.size)
|
||||
|
||||
if bytes_read > 0
|
||||
if stream_ctx.writer && !stream_ctx.writer.try &.closed?
|
||||
begin
|
||||
stream_ctx.writer.try &.write buffer[0, bytes_read]
|
||||
else
|
||||
rescue ex
|
||||
LibLsquic.stream_shutdown(s, 0)
|
||||
LibLsquic.stream_wantread(s, 0)
|
||||
return Box.box(stream_ctx)
|
||||
end
|
||||
elsif bytes_read == 0
|
||||
LibLsquic.stream_shutdown(s, 0)
|
||||
|
|
Loading…
Reference in a new issue