This commit is contained in:
Eric House 2020-09-06 13:51:16 -07:00
parent 9752c96add
commit 93a98820e1
2 changed files with 3 additions and 4 deletions

View file

@ -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 );

View file

@ -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 */