From a16a34adc9f8d0010ab7fa6c7ebe24963e8d2383 Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 11 Jan 2024 10:28:02 -0800 Subject: [PATCH] cleanup comms ack fix --- xwords4/common/comms.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/xwords4/common/comms.c b/xwords4/common/comms.c index 69e22e9bc..44f6ea47f 100644 --- a/xwords4/common/comms.c +++ b/xwords4/common/comms.c @@ -2919,15 +2919,16 @@ validateChannelMessage( CommsCtxt* comms, XWEnv xwe, const CommsAddrRec* addr, augmentChannelAddr( comms, rec, addr, senderID ); - if ( msgID == rec->lastMsgRcd + 1 ) { + if ( msgID == 0 ) { + /* an ACK; do nothing */ + rec = NULL; + } else if ( msgID == rec->lastMsgRcd + 1 ) { COMMS_LOGFF( TAGFMT() "expected %d AND got %d", TAGPRMS, msgID, msgID ); - } else if ( msgID != rec->lastMsgRcd + 1 ) { + } else { COMMS_LOGFF( TAGFMT() "expected %d, got %d", TAGPRMS, rec->lastMsgRcd + 1, msgID ); - if ( 0 != msgID ) { /* Don't ack ACKs! */ - ackAnyImpl( comms, xwe, XP_TRUE ); - } + ackAnyImpl( comms, xwe, XP_TRUE ); rec = NULL; } } else {