

def _receive_data_frame(self, frame):
    '\n        Receive a data frame on the connection.\n        '
    flow_controlled_length = frame.flow_controlled_length
    try:
        window_size = self.remote_flow_control_window(frame.stream_id)
    except NoSuchStreamError:
        self.inbound_flow_control_window -= flow_controlled_length
        raise
    if (flow_controlled_length > window_size):
        raise FlowControlError(('Cannot receive %d bytes, flow control window is %d.' % (flow_controlled_length, window_size)))
    events = self.state_machine.process_input(ConnectionInputs.RECV_DATA)
    self.inbound_flow_control_window -= flow_controlled_length
    stream = self._get_stream_by_id(frame.stream_id)
    (frames, stream_events) = stream.receive_data(frame.data, ('END_STREAM' in frame.flags), flow_controlled_length)
    return (frames, (events + stream_events))

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