@@ -3485,6 +3485,24 @@ typedef int (*ngtcp2_stream_stop_sending)(ngtcp2_conn *conn, int64_t stream_id,
34853485 void * user_data ,
34863486 void * stream_user_data );
34873487
3488+ /**
3489+ * @functypedef
3490+ *
3491+ * :type:`ngtcp2_recv_stop_sending` is invoked when a STOP_SENDING frame
3492+ * is received from a remote endpoint for a stream identified by
3493+ * |stream_id|. |app_error_code| is the application error code carried
3494+ * by the STOP_SENDING frame. This callback is called at most
3495+ * once per stream.
3496+ *
3497+ * The callback function must return 0 if it succeeds. Returning
3498+ * :macro:`NGTCP2_ERR_CALLBACK_FAILURE` makes the library call return
3499+ * immediately.
3500+ */
3501+ typedef int (* ngtcp2_recv_stop_sending )(ngtcp2_conn * conn , int64_t stream_id ,
3502+ uint64_t app_error_code ,
3503+ void * user_data ,
3504+ void * stream_user_data );
3505+
34883506/**
34893507 * @functypedef
34903508 *
@@ -3626,7 +3644,8 @@ typedef int (*ngtcp2_get_path_challenge_data2)(ngtcp2_conn *conn,
36263644#define NGTCP2_CALLBACKS_V1 1
36273645#define NGTCP2_CALLBACKS_V2 2
36283646#define NGTCP2_CALLBACKS_V3 3
3629- #define NGTCP2_CALLBACKS_VERSION NGTCP2_CALLBACKS_V3
3647+ #define NGTCP2_CALLBACKS_V4 4
3648+ #define NGTCP2_CALLBACKS_VERSION NGTCP2_CALLBACKS_V4
36303649
36313650/**
36323651 * @struct
@@ -3964,6 +3983,16 @@ typedef struct ngtcp2_callbacks {
39643983 * .. version-added:: 1.22.0
39653984 */
39663985 ngtcp2_get_path_challenge_data2 get_path_challenge_data2 ;
3986+ /* The following fields have been added since
3987+ NGTCP2_CALLBACKS_V3. */
3988+ /**
3989+ * :member:`recv_stop_sending` is a callback function which is invoked
3990+ * when a STOP_SENDING frame is received from a remote endpoint. This
3991+ * callback function is optional.
3992+ *
3993+ * .. version-added:: 1.24.0
3994+ */
3995+ ngtcp2_recv_stop_sending recv_stop_sending ;
39673996} ngtcp2_callbacks ;
39683997
39693998/**
0 commit comments