# HG changeset patch # User Matt Johnston # Date 1350222715 -28800 # Node ID d9d59a245461ea70b4d8002af6960958b7e6d828 # Parent 516bb4ef0587fdffeb7e084d4f452641157184ba# Parent 649648020123f5c24fdb6d465c05fcb9fd86b6ca merge diff -r 516bb4ef0587 -r d9d59a245461 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 516bb4ef0587 -r d9d59a245461 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)