

def _receive_alt_svc_frame(self, frame):
    '\n        An ALTSVC frame has been received. This frame, specified in RFC 7838,\n        is used to advertise alternative places where the same service can be\n        reached.\n\n        This frame can optionally be received either on a stream or on stream\n        0, and its semantics are different in each case.\n        '
    events = self.state_machine.process_input(ConnectionInputs.RECV_ALTERNATIVE_SERVICE)
    frames = []
    if frame.stream_id:
        try:
            stream = self._get_stream_by_id(frame.stream_id)
        except (NoSuchStreamError, StreamClosedError):
            pass
        else:
            (stream_frames, stream_events) = stream.receive_alt_svc(frame)
            frames.extend(stream_frames)
            events.extend(stream_events)
    else:
        if (not frame.origin):
            return (frames, events)
        if (not self.client_side):
            return (frames, events)
        event = AlternativeServiceAvailable()
        event.origin = frame.origin
        event.field_value = frame.field
        events.append(event)
    return (frames, events)

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