doesn't fail loop fut if it is already finished

This commit is contained in:
Diego 2024-09-02 20:30:35 +02:00
parent 7e450f15cc
commit 892f874d2b
No known key found for this signature in database
GPG Key ID: C9DAC9BF68D1F806
1 changed files with 2 additions and 1 deletions

View File

@ -58,7 +58,8 @@ proc startSending(connection: Connection, remote: TransportAddress) =
except TransportError as e:
trace "Failed to send datagram", errorMsg = e.msg
trace "Failing connection loop future with error"
connection.loop.fail(e) # This might need to be revisited, see https://github.com/status-im/nim-quic/pull/41 for more details
if not connection.loop.finished:
connection.loop.fail(e) # This might need to be revisited, see https://github.com/status-im/nim-quic/pull/41 for more details
await connection.drop()
connection.loop = asyncLoop(send)