mirror of
https://github.com/nghttp2/nghttp2.git
synced 2025-12-06 18:18:52 +08:00
Compare commits
7 Commits
02e6cad121
...
8a552631b4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a552631b4 | ||
|
|
cff8106908 | ||
|
|
4eb49ac28e | ||
|
|
deb390cf85 | ||
|
|
d91ae6987d | ||
|
|
8ddb2273b9 | ||
|
|
e1446fd57a |
@@ -23,8 +23,6 @@ option(WITH_LIBXML2 "Use libxml2"
|
||||
${WITH_LIBXML2_DEFAULT})
|
||||
option(WITH_JEMALLOC "Use jemalloc"
|
||||
${WITH_JEMALLOC_DEFAULT})
|
||||
option(WITH_SPDYLAY "Use spdylay"
|
||||
${WITH_SPDYLAY_DEFAULT})
|
||||
option(WITH_MRUBY "Use mruby")
|
||||
option(WITH_NEVERBLEED "Use neverbleed")
|
||||
option(WITH_LIBBPF "Use libbpf")
|
||||
|
||||
@@ -1263,6 +1263,8 @@ int nghttp2_hd_inflate_change_table_size(
|
||||
return NGHTTP2_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
inflater->settings_hd_table_bufsize_max = settings_max_dynamic_table_size;
|
||||
|
||||
/* It seems that encoder is not required to send dynamic table size
|
||||
update if the table size is not changed after applying
|
||||
SETTINGS_HEADER_TABLE_SIZE. RFC 7541 is ambiguous here, but this
|
||||
@@ -1275,13 +1277,12 @@ int nghttp2_hd_inflate_change_table_size(
|
||||
/* Remember minimum value, and validate that encoder sends the
|
||||
value less than or equal to this. */
|
||||
inflater->min_hd_table_bufsize_max = settings_max_dynamic_table_size;
|
||||
|
||||
inflater->ctx.hd_table_bufsize_max = settings_max_dynamic_table_size;
|
||||
|
||||
hd_context_shrink_table_size(&inflater->ctx, NULL);
|
||||
}
|
||||
|
||||
inflater->settings_hd_table_bufsize_max = settings_max_dynamic_table_size;
|
||||
|
||||
inflater->ctx.hd_table_bufsize_max = settings_max_dynamic_table_size;
|
||||
|
||||
hd_context_shrink_table_size(&inflater->ctx, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1057,8 +1057,7 @@ if asyncio:
|
||||
"""HTTP/2 request (stream) handler base class.
|
||||
|
||||
The class is used to handle the HTTP/2 stream. By default, it does
|
||||
not nothing. It must be subclassed to handle each event callback
|
||||
method.
|
||||
nothing. It must be subclassed to handle each event callback method.
|
||||
|
||||
The first callback method invoked is on_headers(). It is called
|
||||
when HEADERS frame, which includes request header fields, is
|
||||
|
||||
@@ -535,12 +535,12 @@ void Client::quic_close_connection() {
|
||||
case quic::ErrorType::Transport:
|
||||
nwrite = ngtcp2_conn_write_connection_close(
|
||||
quic.conn, &ps.path, nullptr, buf.data(), buf.size(),
|
||||
quic.last_error.code, timestamp(worker->loop));
|
||||
quic.last_error.code, nullptr, 0, timestamp(worker->loop));
|
||||
break;
|
||||
case quic::ErrorType::Application:
|
||||
nwrite = ngtcp2_conn_write_application_close(
|
||||
quic.conn, &ps.path, nullptr, buf.data(), buf.size(),
|
||||
quic.last_error.code, timestamp(worker->loop));
|
||||
quic.last_error.code, nullptr, 0, timestamp(worker->loop));
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
|
||||
@@ -1406,7 +1406,7 @@ void Http3Upstream::on_handler_delete() {
|
||||
|
||||
auto nwrite = ngtcp2_conn_write_connection_close(
|
||||
conn_, &ps.path, &pi, conn_close_.data(), conn_close_.size(),
|
||||
NGTCP2_NO_ERROR, quic_timestamp());
|
||||
NGTCP2_NO_ERROR, nullptr, 0, quic_timestamp());
|
||||
if (nwrite < 0) {
|
||||
if (nwrite != NGTCP2_ERR_INVALID_STATE) {
|
||||
ULOG(ERROR, this) << "ngtcp2_conn_write_connection_close: "
|
||||
@@ -1764,7 +1764,7 @@ int Http3Upstream::handle_error() {
|
||||
if (last_error_.type == quic::ErrorType::Transport) {
|
||||
nwrite = ngtcp2_conn_write_connection_close(
|
||||
conn_, &ps.path, &pi, conn_close_.data(), conn_close_.size(),
|
||||
last_error_.code, ts);
|
||||
last_error_.code, nullptr, 0, ts);
|
||||
if (nwrite < 0) {
|
||||
ULOG(ERROR, this) << "ngtcp2_conn_write_connection_close: "
|
||||
<< ngtcp2_strerror(nwrite);
|
||||
@@ -1773,7 +1773,7 @@ int Http3Upstream::handle_error() {
|
||||
} else {
|
||||
nwrite = ngtcp2_conn_write_application_close(
|
||||
conn_, &ps.path, &pi, conn_close_.data(), conn_close_.size(),
|
||||
last_error_.code, ts);
|
||||
last_error_.code, nullptr, 0, ts);
|
||||
if (nwrite < 0) {
|
||||
ULOG(ERROR, this) << "ngtcp2_conn_write_application_close: "
|
||||
<< ngtcp2_strerror(nwrite);
|
||||
|
||||
@@ -615,7 +615,8 @@ int QUICConnectionHandler::send_connection_close(
|
||||
std::array<uint8_t, NGTCP2_MAX_UDP_PAYLOAD_SIZE> buf;
|
||||
|
||||
auto nwrite = ngtcp2_crypto_write_connection_close(
|
||||
buf.data(), buf.size(), version, &ini_scid, &ini_dcid, error_code);
|
||||
buf.data(), buf.size(), version, &ini_scid, &ini_dcid, error_code,
|
||||
nullptr, 0);
|
||||
if (nwrite < 0) {
|
||||
LOG(ERROR) << "ngtcp2_crypto_write_connection_close failed";
|
||||
return -1;
|
||||
|
||||
@@ -734,7 +734,7 @@ void test_nghttp2_hd_change_table_size(void) {
|
||||
|
||||
CU_ASSERT(4096 == deflater.ctx.hd_table_bufsize_max);
|
||||
|
||||
CU_ASSERT(8000 == inflater.ctx.hd_table_bufsize_max);
|
||||
CU_ASSERT(4096 == inflater.ctx.hd_table_bufsize_max);
|
||||
CU_ASSERT(8000 == inflater.settings_hd_table_bufsize_max);
|
||||
|
||||
/* This will emit encoding context update with header table size 4096 */
|
||||
@@ -830,8 +830,8 @@ void test_nghttp2_hd_change_table_size(void) {
|
||||
|
||||
CU_ASSERT(8000 == deflater.ctx.hd_table_bufsize_max);
|
||||
CU_ASSERT(8000 == nghttp2_hd_deflate_get_max_dynamic_table_size(&deflater));
|
||||
CU_ASSERT(8000 == inflater.ctx.hd_table_bufsize_max);
|
||||
CU_ASSERT(8000 == nghttp2_hd_inflate_get_max_dynamic_table_size(&inflater));
|
||||
CU_ASSERT(4096 == inflater.ctx.hd_table_bufsize_max);
|
||||
CU_ASSERT(4096 == nghttp2_hd_inflate_get_max_dynamic_table_size(&inflater));
|
||||
CU_ASSERT(8000 == inflater.settings_hd_table_bufsize_max);
|
||||
|
||||
rv = nghttp2_hd_deflate_hd_bufs(&deflater, &bufs, nva, 2);
|
||||
@@ -856,8 +856,8 @@ void test_nghttp2_hd_change_table_size(void) {
|
||||
CU_ASSERT(8192 == deflater.ctx.hd_table_bufsize_max);
|
||||
CU_ASSERT(8192 == nghttp2_hd_deflate_get_max_dynamic_table_size(&deflater));
|
||||
|
||||
CU_ASSERT(16383 == inflater.ctx.hd_table_bufsize_max);
|
||||
CU_ASSERT(16383 == nghttp2_hd_inflate_get_max_dynamic_table_size(&inflater));
|
||||
CU_ASSERT(8000 == inflater.ctx.hd_table_bufsize_max);
|
||||
CU_ASSERT(8000 == nghttp2_hd_inflate_get_max_dynamic_table_size(&inflater));
|
||||
CU_ASSERT(16383 == inflater.settings_hd_table_bufsize_max);
|
||||
|
||||
rv = nghttp2_hd_deflate_hd_bufs(&deflater, &bufs, nva, 2);
|
||||
|
||||
@@ -5720,7 +5720,7 @@ void test_nghttp2_submit_settings(void) {
|
||||
nghttp2_frame_settings_free(&ack_frame.settings, mem);
|
||||
|
||||
CU_ASSERT(16 * 1024 == session->local_settings.initial_window_size);
|
||||
CU_ASSERT(1023 == session->hd_inflater.ctx.hd_table_bufsize_max);
|
||||
CU_ASSERT(111 == session->hd_inflater.ctx.hd_table_bufsize_max);
|
||||
CU_ASSERT(111 == session->hd_inflater.min_hd_table_bufsize_max);
|
||||
CU_ASSERT(50 == session->local_settings.max_concurrent_streams);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user