diff --git a/lib/nghttp2_session.c b/lib/nghttp2_session.c index b84b6d1a..3b180865 100644 --- a/lib/nghttp2_session.c +++ b/lib/nghttp2_session.c @@ -4196,9 +4196,8 @@ int nghttp2_session_on_push_promise_received(nghttp2_session *session, session, frame, NGHTTP2_ERR_PROTO, "PUSH_PROMISE: stream in idle"); } } - rv = nghttp2_session_add_rst_stream(session, - frame->push_promise.promised_stream_id, - NGHTTP2_REFUSED_STREAM); + rv = nghttp2_session_add_rst_stream( + session, frame->push_promise.promised_stream_id, NGHTTP2_CANCEL); if (rv != 0) { return rv; } diff --git a/tests/nghttp2_session_test.c b/tests/nghttp2_session_test.c index e990e611..21ee5798 100644 --- a/tests/nghttp2_session_test.c +++ b/tests/nghttp2_session_test.c @@ -2632,7 +2632,7 @@ void test_nghttp2_session_on_push_promise_received(void) { item = nghttp2_session_get_next_ob_item(session); CU_ASSERT(NGHTTP2_RST_STREAM == item->frame.hd.type); CU_ASSERT(6 == item->frame.hd.stream_id); - CU_ASSERT(NGHTTP2_REFUSED_STREAM == item->frame.rst_stream.error_code); + CU_ASSERT(NGHTTP2_CANCEL == item->frame.rst_stream.error_code); CU_ASSERT(0 == nghttp2_session_send(session)); /* Attempt to PUSH_PROMISE against non-existent stream */ @@ -2806,7 +2806,7 @@ void test_nghttp2_session_on_push_promise_received(void) { item = nghttp2_session_get_next_ob_item(session); CU_ASSERT(NGHTTP2_RST_STREAM == item->frame.hd.type); - CU_ASSERT(NGHTTP2_REFUSED_STREAM == item->frame.rst_stream.error_code); + CU_ASSERT(NGHTTP2_CANCEL == item->frame.rst_stream.error_code); nghttp2_frame_push_promise_free(&frame.push_promise, mem); nghttp2_session_del(session);