MCPcopy Create free account
hub / github.com/mitmproxy/mitmproxy / end_stream

Method end_stream

mitmproxy/proxy/layers/http/_http_h3.py:182–188  ·  view source on GitHub ↗

Ends the given stream if not already done so.

(self, stream_id: int)

Source from the content-addressed store, hash-verified

180 self._quic.close(error_code, frame_type, reason_phrase)
181
182 def end_stream(self, stream_id: int) -> None:
183 """Ends the given stream if not already done so."""
184
185 stream = self._get_or_create_stream(stream_id)
186 if stream.headers_send_state != HeadersState.AFTER_TRAILERS:
187 super().send_data(stream_id, b"", end_stream=True)
188 stream.headers_send_state = HeadersState.AFTER_TRAILERS
189
190 def get_next_available_stream_id(self, is_unidirectional: bool = False):
191 """Reserves and returns the next available stream ID."""

Callers 2

_handle_eventMethod · 0.45
_handle_eventMethod · 0.45

Calls 1

send_dataMethod · 0.45

Tested by

no test coverage detected