# HG changeset patch # User Matt Johnston # Date 1350222715 -28800 # Node ID 97aad447159360200310bc3109a17bc656c7055a # Parent 66d5e15f40d0040242bdcbfeecdeff56a79babfc# Parent de950be796dda4758ca0bcd6ac8559bbca3451a1 merge diff -r 66d5e15f40d0 -r 97aad4471593 server/dump.py --- a/server/dump.py Sun Oct 14 21:46:24 2012 +0800 +++ b/server/dump.py Sun Oct 14 21:51:55 2012 +0800 @@ -145,7 +145,11 @@ while True: l = readline(sock) - print l + if not l: + print '.', + sys.stdout.flush() + else: + print l testcount = 0 diff -r 66d5e15f40d0 -r 97aad4471593 server/ts.py --- a/server/ts.py Sun Oct 14 21:46:24 2012 +0800 +++ b/server/ts.py Sun Oct 14 21:51:55 2012 +0800 @@ -43,21 +43,34 @@ def flush(sock): - while readline(sock): - pass + ret = [] + while True: + l = readline(sock) + if l: + ret.append(l) + else: + break + return ret + +def encode_extra(extra_lines): + return ['extra%d=%s' % (n, l.strip()) for (n,l) in enumerate(extra_lines)] @retry() def fetch(sock): - flush(sock) + extra_lines = flush(sock) sock.send("fetch\n") crc = 0 lines = [] l = readline(sock) + if not l: + return None + if l != 'START\n': - W("Bad expected START line '%s'\n" % str(l).rstrip('\n')) - return None + W("Bad expected START line '%s'\n" % l.rstrip('\n')) + extra_lines.append(l) + return encode_extra(extra_lines) crc = crc16(l, crc) while True: @@ -70,6 +83,8 @@ lines.append(l.rstrip('\n')) + lines += encode_extra(extra_lines) + for d in lines: L("Received: %s" % d)