mirror of
https://github.com/curl/curl.git
synced 2025-03-01 15:15:34 +08:00
ngtcp2: implement cb_h3_stop_sending and cb_h3_reset_stream callbacks
Closes #9135
This commit is contained in:
parent
72516ba1fe
commit
e9a2eced69
@ -1070,16 +1070,36 @@ static int cb_h3_recv_header(nghttp3_conn *conn, int64_t stream_id,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cb_h3_send_stop_sending(nghttp3_conn *conn, int64_t stream_id,
|
static int cb_h3_stop_sending(nghttp3_conn *conn, int64_t stream_id,
|
||||||
uint64_t app_error_code,
|
uint64_t app_error_code, void *user_data,
|
||||||
void *user_data,
|
void *stream_user_data)
|
||||||
void *stream_user_data)
|
|
||||||
{
|
{
|
||||||
|
struct quicsocket *qs = user_data;
|
||||||
|
int rv;
|
||||||
(void)conn;
|
(void)conn;
|
||||||
(void)stream_id;
|
|
||||||
(void)app_error_code;
|
|
||||||
(void)user_data;
|
|
||||||
(void)stream_user_data;
|
(void)stream_user_data;
|
||||||
|
|
||||||
|
rv = ngtcp2_conn_shutdown_stream_read(qs->qconn, stream_id, app_error_code);
|
||||||
|
if(rv && rv != NGTCP2_ERR_STREAM_NOT_FOUND) {
|
||||||
|
return NGTCP2_ERR_CALLBACK_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int cb_h3_reset_stream(nghttp3_conn *conn, int64_t stream_id,
|
||||||
|
uint64_t app_error_code, void *user_data,
|
||||||
|
void *stream_user_data) {
|
||||||
|
struct quicsocket *qs = user_data;
|
||||||
|
int rv;
|
||||||
|
(void)conn;
|
||||||
|
(void)stream_user_data;
|
||||||
|
|
||||||
|
rv = ngtcp2_conn_shutdown_stream_write(qs->qconn, stream_id, app_error_code);
|
||||||
|
if(rv && rv != NGTCP2_ERR_STREAM_NOT_FOUND) {
|
||||||
|
return NGTCP2_ERR_CALLBACK_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1094,9 +1114,9 @@ static nghttp3_callbacks ngh3_callbacks = {
|
|||||||
NULL, /* begin_trailers */
|
NULL, /* begin_trailers */
|
||||||
cb_h3_recv_header,
|
cb_h3_recv_header,
|
||||||
NULL, /* end_trailers */
|
NULL, /* end_trailers */
|
||||||
cb_h3_send_stop_sending,
|
cb_h3_stop_sending,
|
||||||
NULL, /* end_stream */
|
NULL, /* end_stream */
|
||||||
NULL, /* reset_stream */
|
cb_h3_reset_stream,
|
||||||
NULL /* shutdown */
|
NULL /* shutdown */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user