diff --git a/src/proto/streams/streams.rs b/src/proto/streams/streams.rs index e6c9ed8a..d3ef1188 100644 --- a/src/proto/streams/streams.rs +++ b/src/proto/streams/streams.rs @@ -504,7 +504,7 @@ impl Inner { actions.send.schedule_implicit_reset( stream, - Reason::REFUSED_STREAM, + Reason::PROTOCOL_ERROR, counts, &mut actions.task); @@ -512,7 +512,7 @@ impl Inner { Ok(()) } else { - Err(Error::library_reset(stream.id, Reason::REFUSED_STREAM)) + Err(Error::library_reset(stream.id, Reason::PROTOCOL_ERROR)) } }, Err(RecvHeaderBlockError::State(err)) => Err(err), diff --git a/tests/h2-tests/tests/client_request.rs b/tests/h2-tests/tests/client_request.rs index 50be06e6..261fe65f 100644 --- a/tests/h2-tests/tests/client_request.rs +++ b/tests/h2-tests/tests/client_request.rs @@ -844,7 +844,7 @@ async fn recv_too_big_headers() { srv.send_frame(frames::headers(3).response(200)).await; // no reset for 1, since it's closed anyway // but reset for 3, since server hasn't closed stream - srv.recv_frame(frames::reset(3).refused()).await; + srv.recv_frame(frames::reset(3).protocol_error()).await; idle_ms(10).await; }; @@ -865,7 +865,7 @@ async fn recv_too_big_headers() { // waiting for a response. let req1 = tokio::spawn(async move { let err = req1.expect("send_request").0.await.expect_err("response1"); - assert_eq!(err.reason(), Some(Reason::REFUSED_STREAM)); + assert_eq!(err.reason(), Some(Reason::PROTOCOL_ERROR)); }); let request = Request::builder() @@ -876,7 +876,7 @@ async fn recv_too_big_headers() { let req2 = client.send_request(request, true); let req2 = tokio::spawn(async move { let err = req2.expect("send_request").0.await.expect_err("response2"); - assert_eq!(err.reason(), Some(Reason::REFUSED_STREAM)); + assert_eq!(err.reason(), Some(Reason::PROTOCOL_ERROR)); }); let conn = tokio::spawn(async move {