diff --git a/src/quic/application.cc b/src/quic/application.cc index 5924fc3b4899e7..b949a7fa99cf12 100644 --- a/src/quic/application.cc +++ b/src/quic/application.cc @@ -3,6 +3,7 @@ #include "application.h" #include #include +#include "defs.h" #include "endpoint.h" #include "packet.h" #include "session.h" @@ -378,9 +379,7 @@ class DefaultApplication final : public Session::Application { return i == cnt; }; - if (!stream_data.stream || !is_empty(stream_data.buf, stream_data.count)) - return false; - return true; + return stream_data.stream && is_empty(stream_data.buf, stream_data.count); } bool StreamCommit(StreamData* stream_data, size_t datalen) override { diff --git a/src/quic/bindingdata.h b/src/quic/bindingdata.h index 4468d29b750583..2b33642b7ad76a 100644 --- a/src/quic/bindingdata.h +++ b/src/quic/bindingdata.h @@ -149,7 +149,7 @@ constexpr size_t kMaxVectorCount = 16; V(max_connections_total, "maxConnectionsTotal") \ V(max_datagram_frame_size, "maxDatagramFrameSize") \ V(max_field_section_size, "maxFieldSectionSize") \ - V(max_header_length, "maxHeaderLength"); \ + V(max_header_length, "maxHeaderLength") \ V(max_header_pairs, "maxHeaderPairs") \ V(max_idle_timeout, "maxIdleTimeout") \ V(max_payload_size, "maxPayloadSize") \ diff --git a/src/quic/endpoint.cc b/src/quic/endpoint.cc index 6f8a8e20e029b4..bc47cfb26be9e2 100644 --- a/src/quic/endpoint.cc +++ b/src/quic/endpoint.cc @@ -298,7 +298,7 @@ class Endpoint::UDP::Impl final : public HandleWrap { return; } - impl->endpoint_->Receive(uv_buf_t{buf->base, static_cast(nread)}, + impl->endpoint_->Receive(uv_buf_init(buf->base, static_cast(nread)), SocketAddress(addr)); } @@ -459,7 +459,7 @@ void Endpoint::Initialize(Environment* env, Local target) { #undef V #define V(name, key, __) \ - auto IDX_STATE_ENDPOINT_##name = OffsetOf(&Endpoint::State::key); + auto IDX_STATE_ENDPOINT_##name = offsetof(Endpoint::State, key); ENDPOINT_STATE(V) #undef V diff --git a/src/quic/endpoint.h b/src/quic/endpoint.h index 97259aaa09c4c3..700630c2244420 100644 --- a/src/quic/endpoint.h +++ b/src/quic/endpoint.h @@ -268,10 +268,10 @@ class Endpoint final : public AsyncWrap, public Packet::Listener { SET_MEMORY_INFO_NAME(Endpoint) SET_SELF_SIZE(Endpoint) - private: struct Stats; struct State; + private: class UDP final : public MemoryRetainer { public: explicit UDP(Endpoint* endpoint); diff --git a/src/quic/session.cc b/src/quic/session.cc index 77bb6d107bf4de..d6891f923a4bd9 100644 --- a/src/quic/session.cc +++ b/src/quic/session.cc @@ -1273,7 +1273,7 @@ void Session::SelectPreferredAddress(PreferredAddress* preferredAddress) { switch (family) { case AF_INET: { auto ipv4 = preferredAddress->ipv4(); - if (ipv4 != std::nullopt) { + if (ipv4.has_value()) { if (ipv4->address.empty() || ipv4->port == 0) return; SocketAddress::New(AF_INET, std::string(ipv4->address).c_str(), @@ -1285,7 +1285,7 @@ void Session::SelectPreferredAddress(PreferredAddress* preferredAddress) { } case AF_INET6: { auto ipv6 = preferredAddress->ipv6(); - if (ipv6 != std::nullopt) { + if (ipv6.has_value()) { if (ipv6->address.empty() || ipv6->port == 0) return; SocketAddress::New(AF_INET, std::string(ipv6->address).c_str(), @@ -2133,7 +2133,7 @@ void Session::Initialize(Environment* env, Local target) { #undef V #define V(name, key, __) \ - auto IDX_STATE_SESSION_##name = OffsetOf(&Session::State::key); + auto IDX_STATE_SESSION_##name = offsetof(Session::State, key); SESSION_STATE(V) #undef V diff --git a/src/quic/session.h b/src/quic/session.h index 21c03096bb66b4..2c6bb38ff9bd18 100644 --- a/src/quic/session.h +++ b/src/quic/session.h @@ -68,9 +68,9 @@ class Session final : public AsyncWrap, private SessionTicket::AppData::Source { // HTTP/3 specific options. uint64_t max_field_section_size = 0; - size_t qpack_max_dtable_capacity = 0; - size_t qpack_encoder_max_dtable_capacity = 0; - size_t qpack_blocked_streams = 0; + uint64_t qpack_max_dtable_capacity = 0; + uint64_t qpack_encoder_max_dtable_capacity = 0; + uint64_t qpack_blocked_streams = 0; SET_NO_MEMORY_INFO() SET_MEMORY_INFO_NAME(Application::Options) @@ -225,11 +225,12 @@ class Session final : public AsyncWrap, private SessionTicket::AppData::Source { SET_MEMORY_INFO_NAME(Session) SET_SELF_SIZE(Session) + struct State; + struct Stats; + private: struct Impl; struct MaybeCloseConnectionScope; - struct State; - struct Stats; using StreamsMap = std::unordered_map>; using QuicConnectionPointer = DeleteFnPtr; diff --git a/test/sequential/test-async-wrap-getasyncid.js b/test/sequential/test-async-wrap-getasyncid.js index 33a5bc1ed91a5e..eb5bf1453683a9 100644 --- a/test/sequential/test-async-wrap-getasyncid.js +++ b/test/sequential/test-async-wrap-getasyncid.js @@ -70,6 +70,8 @@ const { getSystemErrorName } = require('util'); delete providers.QUIC_PACKET; delete providers.QUIC_UDP; delete providers.QUIC_ENDPOINT; + delete providers.QUIC_SESSION; + delete providers.QUIC_STREAM; const objKeys = Object.keys(providers); if (objKeys.length > 0)