From 93a98820e1a8e967e4e215d1ad30f321cc2a6c8b Mon Sep 17 00:00:00 2001 From: Eric House Date: Sun, 6 Sep 2020 13:51:16 -0700 Subject: [PATCH] cleanup --- .../app/src/main/java/org/eehouse/android/xw4/MQTTUtils.java | 5 ++--- xwords4/common/comms.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/MQTTUtils.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/MQTTUtils.java index 47dc26603..71ac2eee3 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/MQTTUtils.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/MQTTUtils.java @@ -552,13 +552,12 @@ public class MQTTUtils extends Thread implements IMqttActionListener, MqttCallba public static void handleMessage( Context context, CommsAddrRec from, int gameID, byte[] data ) { - Log.d( TAG, "handleMessage(gameID=%d): got message", gameID ); - MQTTServiceHelper helper = new MQTTServiceHelper( context, from ); long[] rowids = DBUtils.getRowIDsFor( context, gameID ); - Log.d( TAG, "got %d rows for gameID %d", rowids.length, gameID ); + Log.d( TAG, "handleMessage(): got %d rows for gameID %d", rowids.length, gameID ); if ( 0 == rowids.length ) { notifyNotHere( context, from.mqtt_devID, gameID ); } else { + MQTTServiceHelper helper = new MQTTServiceHelper( context, from ); for ( long rowid : rowids ) { MultiMsgSink sink = new MultiMsgSink( context, rowid ); helper.receiveMessage( rowid, sink, data ); diff --git a/xwords4/common/comms.c b/xwords4/common/comms.c index f4137012f..f410a689f 100644 --- a/xwords4/common/comms.c +++ b/xwords4/common/comms.c @@ -2420,7 +2420,6 @@ comms_checkIncomingStream( CommsCtxt* comms, XWEnv xwe, XWStreamCtxt* stream, + sizeof(msgID) + sizeof(lastMsgRcd)); if ( messageValid ) { XP_U16 payloadSize = 0; - AddressRecord* rec = NULL; XP_U16 flags; (void)getFlags( stream, &connID, &flags ); @@ -2459,6 +2458,7 @@ comms_checkIncomingStream( CommsCtxt* comms, XWEnv xwe, XWStreamCtxt* stream, XP_LOGF( TAGFMT() "got message to self?", TAGPRMS ); } + AddressRecord* rec = NULL; if ( messageValid ) { if ( connID == CONN_ID_NONE ) { /* special case: initial message from client or server */