diff --git a/xwords4/common/comms.c b/xwords4/common/comms.c index c641fc98e..b980441a6 100644 --- a/xwords4/common/comms.c +++ b/xwords4/common/comms.c @@ -1773,7 +1773,7 @@ relayPreProcess( CommsCtxt* comms, XWStreamCtxt* stream, XWHostID* senderID ) } if ( consumed ) { - XP_LOGF( "%s: rejecting data message", __func__ ); + XP_LOGF( "%s: rejecting data message (consumed)", __func__ ); } else { *senderID = srcID; } diff --git a/xwords4/linux/gtkmain.c b/xwords4/linux/gtkmain.c index 51da3f2ce..9058ad5fe 100644 --- a/xwords4/linux/gtkmain.c +++ b/xwords4/linux/gtkmain.c @@ -513,7 +513,7 @@ static void handle_movescheck( GtkWidget* XP_UNUSED(widget), GtkAppGlobals* apg ) { LaunchParams* params = apg->params; - checkForMsgsNow( params ); + relaycon_checkMsgs( params ); } static void diff --git a/xwords4/linux/relaycon.c b/xwords4/linux/relaycon.c index 112b0e54c..e5b377a70 100644 --- a/xwords4/linux/relaycon.c +++ b/xwords4/linux/relaycon.c @@ -215,8 +215,9 @@ runWitCurl( RelayTask* task, const gchar* proc, ...) } void -checkForMsgsNow( LaunchParams* params ) +relaycon_checkMsgs( LaunchParams* params ) { + LOG_FUNC(); RelayConStorage* storage = getStorage( params ); XP_ASSERT( onMainThread(storage) ); checkForMovesOnce( storage ); @@ -414,6 +415,30 @@ onMainThread( RelayConStorage* storage ) return storage->mainThread = pthread_self(); } +static const gchar* +taskName( const RelayTask* task ) +{ + switch (task->typ) { + case POST: return "POST"; + case QUERY: return "QUERY"; + default: XP_ASSERT(0); + return NULL; + } +} + +static gchar* +listTasks( GSList* tasks ) +{ + gchar* names[1 + g_slist_length(tasks)]; + names[g_slist_length(tasks)] = NULL; + for ( int ii = 0; !!tasks; ++ii ) { + names[ii] = (gchar*)taskName( (RelayTask*)tasks->data ); + tasks = tasks->next; + } + + return g_strjoinv( ",", names ); +} + static void* relayThread( void* arg ) { @@ -431,10 +456,13 @@ relayThread( void* arg ) RelayTask* task = head->data; g_slist_free( head ); + gchar* strs = listTasks(storage->relayTaskList); + pthread_mutex_unlock( &storage->relayMutex ); - XP_LOGF( "%s(): processing one of %d; created %d secs ago", - __func__, len, ((XP_U32)time(NULL)) - task->ctime ); + XP_LOGF( "%s(): processing one of %d (%s); created %d secs ago", + __func__, len, strs, ((XP_U32)time(NULL)) - task->ctime ); + g_free( strs ); switch ( task->typ ) { case POST: diff --git a/xwords4/linux/relaycon.h b/xwords4/linux/relaycon.h index fc57e1a79..494c86bad 100644 --- a/xwords4/linux/relaycon.h +++ b/xwords4/linux/relaycon.h @@ -59,5 +59,5 @@ void relaycon_cleanup( LaunchParams* params ); XP_U32 makeClientToken( sqlite3_int64 rowid, XP_U16 seed ); void rowidFromToken( XP_U32 clientToken, sqlite3_int64* rowid, XP_U16* seed ); -void checkForMsgsNow( LaunchParams* params ); +void relaycon_checkMsgs( LaunchParams* params ); #endif diff --git a/xwords4/linux/scripts/discon_ok2.sh b/xwords4/linux/scripts/discon_ok2.sh index 24824b895..5990beccb 100755 --- a/xwords4/linux/scripts/discon_ok2.sh +++ b/xwords4/linux/scripts/discon_ok2.sh @@ -478,10 +478,8 @@ update_ldevid() { if [ $RNUM -lt 30 ]; then # upgrade or first run CMD="--ldevid LINUX_TEST_$(printf %.5d ${KEY})_" fi - else - if [ $RNUM -lt 10 ]; then - CMD="${CMD}x" # give it a new local ID - fi + elif [ $RNUM -lt 10 ]; then + CMD="${CMD}x" # give it a new local ID fi ARGS_DEVID[$KEY]="$CMD" fi