ninenines / cowlib

Support library for manipulating Web protocols.
ISC License
281 stars 172 forks source link

Call gun:cancel may lead to disconnect the whole connection. #97

Open rody-liu opened 4 years ago

rody-liu commented 4 years ago

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.