After called gun:cancel, the corresponding stream would be removed in the state machine.
But it's possible it's response on the way, when gun receive the response, will disconnect the tcp connection with the reason:
{error, {connection_error, stream_closed,
'HEADERS frame received on a stream in closed or half-closed state. (RFC7540 5.1)'}, State}
In the function cow_http2_machine:client_headers_frame, the context stream can't be red out.
After called gun:cancel, the corresponding stream would be removed in the state machine. But it's possible it's response on the way, when gun receive the response, will disconnect the tcp connection with the reason: {error, {connection_error, stream_closed, 'HEADERS frame received on a stream in closed or half-closed state. (RFC7540 5.1)'}, State}
In the function cow_http2_machine:client_headers_frame, the context stream can't be red out.