Store app_error_code to ngtcp2_strm received in RESET_STREAM or STOP_SENDING
@@ -6793,6 +6793,10 @@ static int conn_recv_reset_stream(ngtcp2_conn *conn,
strm->rx.last_offset = fr->final_size;
strm->flags |= NGTCP2_STRM_FLAG_SHUT_RD | NGTCP2_STRM_FLAG_RECV_RST;
+ if (!strm->app_error_code) {
+ strm->app_error_code = fr->app_error_code;
+ }
+
return ngtcp2_conn_close_stream_if_shut_rdwr(conn, strm, fr->app_error_code);
}
@@ -6868,6 +6872,10 @@ static int conn_recv_stop_sending(ngtcp2_conn *conn,
}
}
+ if (!strm->app_error_code) {
+ strm->app_error_code = fr->app_error_code;
+ }
+
/* No RESET_STREAM is required if we have sent FIN and all data have
been acknowledged. */
if ((strm->flags & NGTCP2_STRM_FLAG_SHUT_WR) &&
