Commit 19cf3038 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Compile with the latest ngtcp2 and nghttp3

parent 217d2fc1
...@@ -472,6 +472,7 @@ struct Client { ...@@ -472,6 +472,7 @@ struct Client {
int quic_acked_stream_data_offset(int64_t stream_id, size_t datalen); int quic_acked_stream_data_offset(int64_t stream_id, size_t datalen);
int quic_stream_close(int64_t stream_id, uint64_t app_error_code); int quic_stream_close(int64_t stream_id, uint64_t app_error_code);
int quic_stream_reset(int64_t stream_id, uint64_t app_error_code); int quic_stream_reset(int64_t stream_id, uint64_t app_error_code);
int quic_stream_stop_sending(int64_t stream_id, uint64_t app_error_code);
int quic_extend_max_local_streams(); int quic_extend_max_local_streams();
int quic_on_key(ngtcp2_crypto_level level, const uint8_t *rx_secret, int quic_on_key(ngtcp2_crypto_level level, const uint8_t *rx_secret,
......
...@@ -252,8 +252,8 @@ int Http3Session::close_stream(int64_t stream_id, uint64_t app_error_code) { ...@@ -252,8 +252,8 @@ int Http3Session::close_stream(int64_t stream_id, uint64_t app_error_code) {
} }
} }
int Http3Session::reset_stream(int64_t stream_id) { int Http3Session::shutdown_stream_read(int64_t stream_id) {
auto rv = nghttp3_conn_reset_stream(conn_, stream_id); auto rv = nghttp3_conn_shutdown_stream_read(conn_, stream_id);
if (rv != 0) { if (rv != 0) {
return -1; return -1;
} }
......
...@@ -54,7 +54,7 @@ public: ...@@ -54,7 +54,7 @@ public:
int send_stop_sending(int64_t stream_id, uint64_t app_error_code); int send_stop_sending(int64_t stream_id, uint64_t app_error_code);
int close_stream(int64_t stream_id, uint64_t app_error_code); int close_stream(int64_t stream_id, uint64_t app_error_code);
int reset_stream(int64_t stream_id); int shutdown_stream_read(int64_t stream_id);
int extend_max_local_streams(); int extend_max_local_streams();
int64_t submit_request_internal(); int64_t submit_request_internal();
......
...@@ -141,7 +141,28 @@ int stream_reset(ngtcp2_conn *conn, int64_t stream_id, uint64_t final_size, ...@@ -141,7 +141,28 @@ int stream_reset(ngtcp2_conn *conn, int64_t stream_id, uint64_t final_size,
int Client::quic_stream_reset(int64_t stream_id, uint64_t app_error_code) { int Client::quic_stream_reset(int64_t stream_id, uint64_t app_error_code) {
auto s = static_cast<Http3Session *>(session.get()); auto s = static_cast<Http3Session *>(session.get());
if (s->reset_stream(stream_id) != 0) { if (s->shutdown_stream_read(stream_id) != 0) {
return -1;
}
return 0;
}
namespace {
int stream_stop_sending(ngtcp2_conn *conn, int64_t stream_id,
uint64_t app_error_code, void *user_data,
void *stream_user_data) {
auto c = static_cast<Client *>(user_data);
if (c->quic_stream_stop_sending(stream_id, app_error_code) != 0) {
return -1;
}
return 0;
}
} // namespace
int Client::quic_stream_stop_sending(int64_t stream_id,
uint64_t app_error_code) {
auto s = static_cast<Http3Session *>(session.get());
if (s->shutdown_stream_read(stream_id) != 0) {
return -1; return -1;
} }
return 0; return 0;
...@@ -327,6 +348,11 @@ int Client::quic_init(const sockaddr *local_addr, socklen_t local_addrlen, ...@@ -327,6 +348,11 @@ int Client::quic_init(const sockaddr *local_addr, socklen_t local_addrlen,
nullptr, // recv_new_token nullptr, // recv_new_token
ngtcp2_crypto_delete_crypto_aead_ctx_cb, ngtcp2_crypto_delete_crypto_aead_ctx_cb,
ngtcp2_crypto_delete_crypto_cipher_ctx_cb, ngtcp2_crypto_delete_crypto_cipher_ctx_cb,
nullptr, // recv_datagram
nullptr, // ack_datagram
nullptr, // lost_datagram
nullptr, // get_path_challenge_data
h2load::stream_stop_sending,
}; };
ngtcp2_cid scid, dcid; ngtcp2_cid scid, dcid;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment