mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-16 15:41:16 +01:00
don't assume send will succeed
(Pulling in change that's been on eehouse.org for a while)
This commit is contained in:
parent
22f697cd37
commit
475206a373
1 changed files with 6 additions and 1 deletions
|
@ -267,10 +267,13 @@ def main():
|
|||
|
||||
while g_con:
|
||||
if g_debug: print
|
||||
nSent = 0
|
||||
devids = getPendingMsgs( g_con, typ )
|
||||
# print "got msgs:", len(devids)
|
||||
if 0 < len(devids):
|
||||
devids = addClntVers( g_con, devids )
|
||||
targets = targetsAfterBackoff( devids )
|
||||
# print "got targets:", len(targets)
|
||||
if 0 < len(targets):
|
||||
if 0 < emptyCount: print ""
|
||||
emptyCount = 0
|
||||
|
@ -283,10 +286,12 @@ def main():
|
|||
and 3 <= target['clntVers'] \
|
||||
and target['msg64']:
|
||||
toDelete.append( str(target['id']) )
|
||||
nSent += 1
|
||||
pruneSent( devids )
|
||||
deleteMsgs( g_con, toDelete )
|
||||
elif g_debug: print "no targets after backoff"
|
||||
else:
|
||||
|
||||
if nSent == 0:
|
||||
emptyCount += 1
|
||||
if (0 == (emptyCount%5)) and not g_debug:
|
||||
sys.stdout.write('.')
|
||||
|
|
Loading…
Reference in a new issue