From 18b1ecff1ee1eb618edf87d31f6ea678e525194e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 20 Feb 2015 15:52:37 +1100 Subject: [PATCH] Add support for compressed chunks on download uses lzma compression (4mb chunks currently) --- bam/cli.py | 57 ++++++++++++++----- .../application/modules/resources/__init__.py | 38 +++++++------ 2 files changed, 64 insertions(+), 31 deletions(-) diff --git a/bam/cli.py b/bam/cli.py index 53f2ac7..a2f5ca4 100755 --- a/bam/cli.py +++ b/bam/cli.py @@ -653,15 +653,21 @@ class bam_commands: import struct ID_MESSAGE = 1 ID_PAYLOAD = 2 - ID_PAYLOAD_EMPTY = 3 - ID_DONE = 4 + ID_PAYLOAD_APPEND = 3 + ID_PAYLOAD_EMPTY = 4 + ID_DONE = 5 head = r.raw.read(4) if head != b'BAM\0': fatal("bad header from server") file_index = 0 + is_header_read = True while True: - msg_type, msg_size = struct.unpack("= 0) + + yield struct.pack('