mirror of
https://gitea.invidious.io/iv-org/lsquic.cr
synced 2024-08-15 00:43:31 +00:00
Merge pull request #5 from vhuynh3000/fix_closed_stream_with_open_engine
Remove the ensure block and close the socket only if there is no exception
This commit is contained in:
commit
cd6ec66292
1 changed files with 2 additions and 3 deletions
|
@ -225,11 +225,10 @@ module QUIC
|
||||||
LibLsquic.engine_packet_in(engine, buffer[0, bytes_read], bytes_read, socket.local_address, socket.remote_address, Box.box(socket), 0) if bytes_read != 0
|
LibLsquic.engine_packet_in(engine, buffer[0, bytes_read], bytes_read, socket.local_address, socket.remote_address, Box.box(socket), 0) if bytes_read != 0
|
||||||
LibLsquic.engine_process_conns(engine)
|
LibLsquic.engine_process_conns(engine)
|
||||||
end
|
end
|
||||||
rescue IO::Error
|
|
||||||
# may have already been closed
|
|
||||||
ensure
|
|
||||||
@socket.try &.close
|
@socket.try &.close
|
||||||
@socket = nil
|
@socket = nil
|
||||||
|
rescue IO::Error
|
||||||
|
# may have already been closed
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue