From c7a027183057a561882618c0c4c88b5fe1568ba8 Mon Sep 17 00:00:00 2001 From: Eric House Date: Fri, 4 Jun 2010 22:23:46 -0700 Subject: [PATCH] fix problem where client held on to its first message forever, sending it each time resendAll was called on connect etc. --- xwords4/common/comms.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/xwords4/common/comms.c b/xwords4/common/comms.c index 1f9f46452..f7570fd50 100644 --- a/xwords4/common/comms.c +++ b/xwords4/common/comms.c @@ -961,16 +961,16 @@ removeFromQueue( CommsCtxt* comms, XP_PlayerAddr channelNo, MsgID msgID ) XP_Bool knownGood = XP_FALSE; next = elem->next; - /* remove the 0-channel message if we've established a channel - number. Only clients should have any 0-channel messages in the - queue, and receiving something from the server is an implicit - ACK -- IFF it isn't left over from the last game. */ - - if ( (elem->channelNo == 0) && (channelNo != 0) ) { - XP_ASSERT( !comms->isServer ); - XP_ASSERT( elem->msgID == 0 ); - } else if ( elem->channelNo != channelNo ) { - knownGood = XP_TRUE; + /* If I'm the server and there's more than one guest I have + multiple channels to worry about. Not so for the guest. So + while the guest's messages are labeled with two versions of the + channelNo, the 0th message having the two low bits clear and + all subsequent messages having at least one set, that's not an + issue here: the client needn't test channelNo. */ + if ( comms->isServer ) { + knownGood = elem->channelNo != channelNo; + } else { + knownGood = XP_FALSE; } if ( !knownGood && (elem->msgID <= msgID) ) {