mirror of
https://gitea.invidious.io/iv-org/lsquic.cr
synced 2024-08-15 00:43:31 +00:00
Remove the ensure block and close the socket only if there is no exception so that exception during reads do not leave an engine running with no socket.
This commit is contained in:
parent
4855742c45
commit
5ef544c1bd
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_process_conns(engine)
|
||||
end
|
||||
rescue IO::Error
|
||||
# may have already been closed
|
||||
ensure
|
||||
@socket.try &.close
|
||||
@socket = nil
|
||||
rescue IO::Error
|
||||
# may have already been closed
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue