From d5c74f5ce224e95ff943448e958b37db774fd601 Mon Sep 17 00:00:00 2001 From: Christian Ulrich Date: Sun, 8 Nov 2020 01:53:30 +0100 Subject: [PATCH] need deepCopy; don't do anything if no connections exist --- quicp2p.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/quicp2p.nim b/quicp2p.nim index 051fe2d..315f751 100644 --- a/quicp2p.nim +++ b/quicp2p.nim @@ -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]