need deepCopy; don't do anything if no connections exist

This commit is contained in:
Christian Ulrich 2020-11-08 01:53:30 +01:00
parent 272cb2f497
commit d5c74f5ce2
No known key found for this signature in database
GPG Key ID: 8241BE099775A097
1 changed files with 3 additions and 1 deletions

View File

@ -172,7 +172,9 @@ proc initContext(sock: AsyncSocket, certChainPath: string, keyPath: string,
result.tlsCtx.signCertificate = addr result.signCertificate.super
proc sendPackets(ctx: QuicP2PContext) =
let conns = ctx.connections
if ctx.connections.len == 0:
return
let conns = ctx.connections.deepCopy()
for i in 0 .. conns.len - 1:
var srcAddr, dstAddr: quicly_address_t
var dgrams: array[10, IOVec]