

def to_bytes(self, max_fragment_size=(2 ** 12)):
    bytes = ''.join([message.to_bytes() for message in self.messages])
    num_fragments = (len(bytes) / max_fragment_size)
    fragments = [bytes[i:(i + fragments)] for i in range(0, len(bytes), max_fragment_size)]
    return ''.join([(((struct.pack('B', self.content_type) + self.version.to_bytes()) + struct.pack('!H', len(fragment))) + fragment) for fragment in fragments])

dataset/ETHPy150Open google/nogotofail/nogotofail/mitm/util/tls/types/record.py TlsRecord.to_bytes/VarMisuse@60/73 `max_fragment_size`->`fragments`