From 7e4bc4249daeef8f9e8a6965c38ceab2ff998bf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 10 Apr 2017 01:47:04 +0200 Subject: [PATCH] tools/qubesd-query: handle events-based methods Pass the data as it arrives, instead of buffering it all. QubesOS/qubes-issues#2622 --- qubes/tools/qubesd_query.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qubes/tools/qubesd_query.py b/qubes/tools/qubesd_query.py index 68f00147..7960d922 100644 --- a/qubes/tools/qubesd_query.py +++ b/qubes/tools/qubesd_query.py @@ -54,8 +54,10 @@ def qubesd_client(socket, payload, *args): writer.write_eof() try: - data = yield from reader.read() - sys.stdout.buffer.write(data) # pylint: disable=no-member + while not reader.at_eof(): + data = yield from reader.read(4096) + sys.stdout.buffer.write(data) # pylint: disable=no-member + sys.stdout.flush() except asyncio.CancelledError: return finally: