From 573a87993ebabeebcdba8fff4fbb57d61152335a Mon Sep 17 00:00:00 2001 From: Eric House Date: Sat, 20 Jul 2013 08:01:56 -0700 Subject: [PATCH] Don't propogate chat when queue too full. This *should* only impact tests since users won't keep chatting at a non-responsive friend. --- xwords4/common/server.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/xwords4/common/server.c b/xwords4/common/server.c index 400f05977..afee1c88c 100644 --- a/xwords4/common/server.c +++ b/xwords4/common/server.c @@ -611,10 +611,14 @@ server_initClientConnection( ServerCtxt* server, XWStreamCtxt* stream ) static void sendChatTo( ServerCtxt* server, XP_U16 devIndex, const XP_UCHAR const* msg ) { - XWStreamCtxt* stream = messageStreamWithHeader( server, devIndex, - XWPROTO_CHAT ); - stringToStream( stream, msg ); - stream_destroy( stream ); + if ( comms_canChat( server->vol.comms ) ) { + XWStreamCtxt* stream = messageStreamWithHeader( server, devIndex, + XWPROTO_CHAT ); + stringToStream( stream, msg ); + stream_destroy( stream ); + } else { + XP_LOGF( "%s: dropping chat %s; queue too full?", __func__, msg ); + } } static void