diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-05-14 06:41:32 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-05-14 06:41:32 +0200 |
commit | d4f18457a4bcdf321b6f97394c3a7c26dd2225e7 (patch) | |
tree | 8b1b20fd49869ace10fe449301ba0b21b878569d /test.d/dumb-client | |
parent | m fix (diff) | |
download | mds-d4f18457a4bcdf321b6f97394c3a7c26dd2225e7.tar.gz mds-d4f18457a4bcdf321b6f97394c3a7c26dd2225e7.tar.bz2 mds-d4f18457a4bcdf321b6f97394c3a7c26dd2225e7.tar.xz |
fix dumb-client and memory errors
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rwxr-xr-x | test.d/dumb-client | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/test.d/dumb-client b/test.d/dumb-client index 0ee7331..e347f37 100755 --- a/test.d/dumb-client +++ b/test.d/dumb-client @@ -36,13 +36,14 @@ socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) socket.connect(socket_path) def read_loop(): - data = socket.recv(1); - if not data: - return - sys.stdout.buffer.write(b'\033[34m'); - sys.stdout.buffer.write(data); - sys.stdout.buffer.write(b'\033[00m'); - sys.stdout.buffer.flush(); + while True: + data = socket.recv(2048); + if not data: + break + sys.stdout.buffer.write(b'\033[34m'); + sys.stdout.buffer.write(data); + sys.stdout.buffer.write(b'\033[00m'); + sys.stdout.buffer.flush(); thread = threading.Thread(target = read_loop) thread.setDaemon(True) |