Skip to content

Commit

Permalink
Return error when can't get conn to send ACK
Browse files Browse the repository at this point in the history
Signed-off-by: bill fort <fxbao@hotmail.com>
  • Loading branch information
billfort authored and yilunzhang committed Feb 20, 2023
1 parent c86a46b commit ed5f036
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down

0 comments on commit ed5f036

Please sign in to comment.