

def receive_data(self, data):
    '\n        Pass some received HTTP/2 data to the connection for handling.\n\n        :param data: The data received from the remote peer on the network.\n        :type data: ``bytes``\n        :returns: A list of events that the remote peer triggered by sending\n            this data.\n        '
    events = []
    self.incoming_buffer.add_data(data)
    self.incoming_buffer.max_frame_size = self.max_inbound_frame_size
    try:
        for frame in self.incoming_buffer:
            events.extend(self._receive_frame(frame))
    except InvalidPaddingError:
        self._terminate_connection(PROTOCOL_ERROR)
        raise ProtocolError('Received frame with invalid padding.')
    except ProtocolError as e:
        self._terminate_connection(e.error_code)
        raise
    return events

dataset/ETHPy150Open python-hyper/hyper-h2/h2/connection.py H2Connection.receive_data/original