From ed5f036c78574a3ff4ee7d37a631e5d8b0c481e9 Mon Sep 17 00:00:00 2001 From: bill fort Date: Mon, 13 Feb 2023 11:58:55 -0700 Subject: [PATCH] Return error when can't get conn to send ACK Signed-off-by: bill fort --- errors.go | 1 + session.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/errors.go b/errors.go index f2960c0..3b0af6e 100644 --- a/errors.go +++ b/errors.go @@ -12,6 +12,7 @@ var ( ErrRecvWindowFull = NewGenericError("receive window full", false, true) ErrNotHandshake = NewGenericError("first packet is not handshake packet", false, true) ErrConnClosed = NewGenericError("connection closed", false, false) + ErrConnNotFound = NewGenericError("connection not found", false, false) ) type GenericError struct { diff --git a/session.go b/session.go index 6c55fc4..8b2a6e7 100644 --- a/session.go +++ b/session.go @@ -296,6 +296,8 @@ func (session *Session) ReceiveWith(localClientID, remoteClientID string, buf [] if conn, ok := session.connections[connKey(localClientID, remoteClientID)]; ok { conn.SendAck(packet.SequenceId) + } else { + return ErrConnNotFound } }