def encode_body(body, frame_size):
    """Generate a sequence of chunks for body where each chunk is less than frame_size"""
    limit = frame_size - 7 - 1
    while body:
        payload, body = body[:limit], body[limit:]
        yield 3, payload
