Improve some debugging information to find the weird data problem.

Turns out list.pop() removes the *last* item, not the first one.  Oops.  It
all works great for queues of only one item... :)
This commit is contained in:
Avery Pennarun
2010-05-02 01:18:55 -04:00
parent 915a96b0ec
commit bfd506dcdc
3 changed files with 37 additions and 21 deletions

View File

@ -32,11 +32,10 @@ def main():
handlers = filter(lambda s: s.ok, handlers)
for s in handlers:
s.pre_select(r,w,x)
log('\n')
log('Waiting: %d[%d,%d,%d]...\n'
% (len(handlers), len(r), len(w), len(x)))
(r,w,x) = select.select(r,w,x)
log('r=%r w=%r x=%r\n' % (r,w,x))
#log('r=%r w=%r x=%r\n' % (r,w,x))
ready = set(r) | set(w) | set(x)
for s in handlers:
if s.socks & ready: