Browse Source

prevent infinite loop + minor improvements

Natenom/support-murmur-13-1446181288462
Michael Ziegler 16 years ago
parent
commit
0e7397194b
  1. 4
      pyweb/mumble/management.py
  2. 6
      pyweb/mumble/mmobjects.py

4
pyweb/mumble/management.py

@ -58,7 +58,7 @@ def find_existing_instances( **kwargs ):
print "string's format."
print
dbusName = raw_input( "Service string: " );
dbusName = raw_input( "Service string: " ).strip();
if not dbusName:
if v:
@ -141,7 +141,7 @@ def find_existing_instances( **kwargs ):
if playerdata[0] == 0:
continue;
if v > 1:
print "Checking Player with id %d and name '%s'." % playerdata[:2];
print "Checking Player with id %d and name '%s'." % ( int(playerdata[0]), playerdata[1] );
try:
models.MumbleUser.objects.get( server=instance, mumbleid=playerdata[0] );
except models.MumbleUser.DoesNotExist:

6
pyweb/mumble/mmobjects.py

@ -42,7 +42,11 @@ class mmServer( object ):
chanlist = ctl.getChannels(model.srvid);
# sometimes, ICE seems to return the Channel list in a weird order.
while len(chanlist):
# itercount prevents infinite loops.
itercount = 0;
maxiter = len(chanlist) * 3;
while len(chanlist) and itercount < maxiter:
itercount += 1;
#print len(chanlist)
for theChan in chanlist:
# Channels - Fields: 0 = ID, 1 = Name, 2 = Parent-ID, 3 = Links

Loading…
Cancel
Save