attempt to pthread write_buffer: failing so far due to concatenated zlib streams