mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-04 23:02:02 +01:00
Merge branch 'relay_proxy' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into relay_proxy
This commit is contained in:
commit
46ff3c3b68
3 changed files with 23 additions and 11 deletions
|
@ -1226,13 +1226,13 @@ curses_util_askPassword( XW_UtilCtxt* XP_UNUSED(uc),
|
||||||
|
|
||||||
static void
|
static void
|
||||||
curses_util_yOffsetChange( XW_UtilCtxt* XP_UNUSED(uc),
|
curses_util_yOffsetChange( XW_UtilCtxt* XP_UNUSED(uc),
|
||||||
XP_U16 XP_UNUSED_DBG(maxOffset),
|
XP_U16 XP_UNUSED(maxOffset),
|
||||||
XP_U16 oldOffset, XP_U16 newOffset )
|
XP_U16 XP_UNUSED(oldOffset), XP_U16 XP_UNUSED(newOffset) )
|
||||||
{
|
{
|
||||||
if ( oldOffset != newOffset ) {
|
/* if ( oldOffset != newOffset ) { */
|
||||||
XP_WARNF( "curses_util_yOffsetChange(%d,%d,%d) not implemented",
|
/* XP_WARNF( "curses_util_yOffsetChange(%d,%d,%d) not implemented", */
|
||||||
maxOffset, oldOffset, newOffset );
|
/* maxOffset, oldOffset, newOffset ); */
|
||||||
}
|
/* } */
|
||||||
} /* curses_util_yOffsetChange */
|
} /* curses_util_yOffsetChange */
|
||||||
|
|
||||||
static XP_Bool
|
static XP_Bool
|
||||||
|
|
|
@ -64,6 +64,7 @@ build_cmds() {
|
||||||
for DEV in $(seq $NDEVS); do
|
for DEV in $(seq $NDEVS); do
|
||||||
FILE="${LOGDIR}/GAME_${GAME}_${DEV}.xwg"
|
FILE="${LOGDIR}/GAME_${GAME}_${DEV}.xwg"
|
||||||
LOG=${LOGDIR}/${GAME}_${DEV}_LOG.txt
|
LOG=${LOGDIR}/${GAME}_${DEV}_LOG.txt
|
||||||
|
touch $LOG # so greps won't show errors
|
||||||
CMD="./obj_linux_memdbg/xwords -C $ROOM -r ${NAMES[$DEV]} $OTHERS"
|
CMD="./obj_linux_memdbg/xwords -C $ROOM -r ${NAMES[$DEV]} $OTHERS"
|
||||||
CMD="$CMD -d dict.xwd -p $PORT -a $HOST -f $FILE -z 1:3 $PLAT_PARMS"
|
CMD="$CMD -d dict.xwd -p $PORT -a $HOST -f $FILE -z 1:3 $PLAT_PARMS"
|
||||||
CMDS[$COUNTER]=$CMD
|
CMDS[$COUNTER]=$CMD
|
||||||
|
@ -86,13 +87,14 @@ close_device() {
|
||||||
if [ ${PIDS[$ID]} -ne 0 ]; then
|
if [ ${PIDS[$ID]} -ne 0 ]; then
|
||||||
kill ${PIDS[$ID]}
|
kill ${PIDS[$ID]}
|
||||||
fi
|
fi
|
||||||
|
echo -n "closing $ID (log ${LOGS[$ID]}): "
|
||||||
|
date
|
||||||
unset PIDS[$ID]
|
unset PIDS[$ID]
|
||||||
unset CMDS[$ID]
|
unset CMDS[$ID]
|
||||||
mv ${FILES[$ID]} $DONEDIR
|
mv ${FILES[$ID]} $DONEDIR
|
||||||
unset FILES[$ID]
|
unset FILES[$ID]
|
||||||
mv ${LOGS[$ID]} $DONEDIR
|
mv ${LOGS[$ID]} $DONEDIR
|
||||||
unset LOGS[$ID]
|
unset LOGS[$ID]
|
||||||
echo "closed $ID"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check_game() {
|
check_game() {
|
||||||
|
@ -101,14 +103,14 @@ check_game() {
|
||||||
CONNNAME="$(connName $LOG)"
|
CONNNAME="$(connName $LOG)"
|
||||||
unset OTHERS
|
unset OTHERS
|
||||||
if [ -n "$CONNNAME" ]; then
|
if [ -n "$CONNNAME" ]; then
|
||||||
if grep -q 'all remaining tiles' $LOG; then
|
if grep -q '\[unused tiles\]' $LOG; then
|
||||||
ALL_DONE=TRUE
|
ALL_DONE=TRUE
|
||||||
for INDX in ${!LOGS[*]}; do
|
for INDX in ${!LOGS[*]}; do
|
||||||
[ $INDX -eq $KEY ] && continue
|
[ $INDX -eq $KEY ] && continue
|
||||||
ALOG=${LOGS[$INDX]}
|
ALOG=${LOGS[$INDX]}
|
||||||
CONNNAME2="$(connName $ALOG)"
|
CONNNAME2="$(connName $ALOG)"
|
||||||
if [ "$CONNNAME2" = "$CONNNAME" ]; then
|
if [ "$CONNNAME2" = "$CONNNAME" ]; then
|
||||||
if ! grep -q 'all remaining tiles' $ALOG; then
|
if ! grep -q '\[unused tiles\]' $ALOG; then
|
||||||
unset OTHERS
|
unset OTHERS
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
@ -126,9 +128,11 @@ check_game() {
|
||||||
}
|
}
|
||||||
|
|
||||||
run_cmds() {
|
run_cmds() {
|
||||||
|
ENDTIME=$(($(date +%s) + TIMEOUT))
|
||||||
while :; do
|
while :; do
|
||||||
COUNT=${#CMDS[*]}
|
COUNT=${#CMDS[*]}
|
||||||
[ 0 -ge $COUNT ] && break
|
[ 0 -ge $COUNT ] && break
|
||||||
|
[ $(date +%s) -ge $ENDTIME ] && break
|
||||||
INDX=$(($RANDOM%COUNT))
|
INDX=$(($RANDOM%COUNT))
|
||||||
KEYS=( ${!CMDS[*]} )
|
KEYS=( ${!CMDS[*]} )
|
||||||
KEY=${KEYS[$INDX]}
|
KEY=${KEYS[$INDX]}
|
||||||
|
@ -142,6 +146,14 @@ run_cmds() {
|
||||||
check_game $KEY
|
check_game $KEY
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# kill any remaining games
|
||||||
|
for PID in ${PIDS[*]}; do
|
||||||
|
if [ $PID -ne 0 ]; then
|
||||||
|
echo "$PID still alive; killing..."
|
||||||
|
kill $PID
|
||||||
|
fi
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
print_stats() {
|
print_stats() {
|
||||||
|
@ -153,3 +165,5 @@ run_cmds
|
||||||
print_stats
|
print_stats
|
||||||
|
|
||||||
wait
|
wait
|
||||||
|
echo -n "$0 done: "
|
||||||
|
date
|
||||||
|
|
|
@ -423,7 +423,6 @@ XWThreadPool::grab_elem_locked( QueuePr* prp )
|
||||||
void
|
void
|
||||||
XWThreadPool::release_socket_locked( int socket )
|
XWThreadPool::release_socket_locked( int socket )
|
||||||
{
|
{
|
||||||
logf( XW_LOGINFO, "%s(%d)", __func__, socket );
|
|
||||||
if ( -1 != socket ) {
|
if ( -1 != socket ) {
|
||||||
set<int>::iterator iter = m_sockets_in_use.find( socket );
|
set<int>::iterator iter = m_sockets_in_use.find( socket );
|
||||||
assert( iter != m_sockets_in_use.end() );
|
assert( iter != m_sockets_in_use.end() );
|
||||||
|
@ -443,5 +442,4 @@ XWThreadPool::print_in_use( void )
|
||||||
iter != m_sockets_in_use.end(); ++iter ) {
|
iter != m_sockets_in_use.end(); ++iter ) {
|
||||||
len += snprintf( &buf[len], sizeof(buf)-len, "%d ", *iter );
|
len += snprintf( &buf[len], sizeof(buf)-len, "%d ", *iter );
|
||||||
}
|
}
|
||||||
logf( XW_LOGINFO, "%s: %s", __func__, buf );
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue