src: make minor tweaks to quic c++ for c++20

PR-URL: https://github.com/nodejs/node/pull/53256
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
This commit is contained in:
James M Snell 2024-09-28 10:10:32 -07:00
parent cdae315706
commit 858bce5698
19 changed files with 38 additions and 77 deletions

View File

@ -10,8 +10,7 @@
#include "sessionticket.h"
#include "streams.h"
namespace node {
namespace quic {
namespace node::quic {
// An Application implements the ALPN-protocol specific semantics on behalf
// of a QUIC Session.
@ -154,8 +153,7 @@ struct Session::Application::StreamData final {
std::string ToString() const;
};
} // namespace quic
} // namespace node
} // namespace node::quic
#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

View File

@ -16,8 +16,7 @@
#include <vector>
#include "defs.h"
namespace node {
namespace quic {
namespace node::quic {
class Endpoint;
class Packet;
@ -267,8 +266,7 @@ struct CallbackScope final : public CallbackScopeBase {
explicit CallbackScope(T* ptr) : CallbackScopeBase(ptr->env()), ref(ptr) {}
};
} // namespace quic
} // namespace node
} // namespace node::quic
#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

View File

@ -8,8 +8,7 @@
#include "ncrypto.h"
#include "quic/defs.h"
namespace node {
namespace quic {
namespace node::quic {
// ============================================================================
// CID
@ -150,6 +149,5 @@ const CID::Factory& CID::Factory::random() {
return instance;
}
} // namespace quic
} // namespace node
} // namespace node::quic
#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC

View File

@ -7,8 +7,7 @@
#include <string>
#include "defs.h"
namespace node {
namespace quic {
namespace node::quic {
// CIDS are used to identify endpoints participating in a QUIC session.
// Once created, CID instances are immutable.
@ -122,8 +121,7 @@ class CID::Factory {
// of CID::Factory that implement the QUIC Load Balancers spec.
};
} // namespace quic
} // namespace node
} // namespace node::quic
#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

View File

@ -13,8 +13,7 @@
#include <string>
#include "defs.h"
namespace node {
namespace quic {
namespace node::quic {
struct Path final : public ngtcp2_path {
Path(const SocketAddress& local, const SocketAddress& remote);
@ -143,8 +142,7 @@ class QuicError final : public MemoryRetainer {
const ngtcp2_ccerr* ptr_ = nullptr;
};
} // namespace quic
} // namespace node
} // namespace node::quic
#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

View File

@ -9,8 +9,7 @@
#include <v8.h>
#include <limits>
namespace node {
namespace quic {
namespace node::quic {
#define NGTCP2_SUCCESS 0
#define NGTCP2_ERR(V) (V != NGTCP2_SUCCESS)
@ -243,5 +242,4 @@ class DebugIndentScope {
static int indent_;
};
} // namespace quic
} // namespace node
} // namespace node::quic

View File

@ -17,8 +17,7 @@
#include "sessionticket.h"
#include "tokens.h"
namespace node {
namespace quic {
namespace node::quic {
#define ENDPOINT_CC(V) \
V(RENO, reno) \
@ -453,8 +452,7 @@ class Endpoint final : public AsyncWrap, public Packet::Listener {
friend class Session;
};
} // namespace quic
} // namespace node
} // namespace node::quic
#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

View File

@ -17,8 +17,7 @@
#include "session.h"
#include "sessionticket.h"
namespace node {
namespace quic {
namespace node::quic {
namespace {
struct Http3HeadersTraits {
@ -831,7 +830,6 @@ std::unique_ptr<Session::Application> createHttp3Application(
return std::make_unique<Http3Application>(session, options);
}
} // namespace quic
} // namespace node
} // namespace node::quic
#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC

View File

@ -5,14 +5,11 @@
#include "session.h"
namespace node {
namespace quic {
namespace node::quic {
std::unique_ptr<Session::Application> createHttp3Application(
Session* session, const Session::Application_Options& options);
} // namespace quic
} // namespace node
} // namespace node::quic
#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

View File

@ -9,8 +9,7 @@
#include <stream_base.h>
#include <deque>
namespace node {
namespace quic {
namespace node::quic {
// The LogStream is a utility that the QUIC impl uses to publish both QLog
// and Keylog diagnostic data (one instance for each).
@ -76,8 +75,7 @@ class LogStream : public AsyncWrap, public StreamBase {
void ensure_space(size_t amt);
};
} // namespace quic
} // namespace node
} // namespace node::quic
#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

View File

@ -18,8 +18,7 @@
#include "defs.h"
#include "tokens.h"
namespace node {
namespace quic {
namespace node::quic {
struct PathDescriptor {
uint32_t version;
@ -147,8 +146,7 @@ class Packet final : public ReqWrap<uv_udp_send_t> {
std::shared_ptr<Data> data_;
};
} // namespace quic
} // namespace node
} // namespace node::quic
#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

View File

@ -10,8 +10,7 @@
#include <string>
#include "defs.h"
namespace node {
namespace quic {
namespace node::quic {
// PreferredAddress is a helper class used only when a client Session receives
// an advertised preferred address from a server. The helper provides
@ -67,8 +66,7 @@ class PreferredAddress final {
const ngtcp2_preferred_addr* paddr_;
};
} // namespace quic
} // namespace node
} // namespace node::quic
#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

View File

@ -25,8 +25,7 @@
#include "tlscontext.h"
#include "transportparams.h"
namespace node {
namespace quic {
namespace node::quic {
class Endpoint;
@ -438,8 +437,7 @@ class Session final : public AsyncWrap, private SessionTicket::AppData::Source {
friend class TransportParams;
};
} // namespace quic
} // namespace node
} // namespace node::quic
#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

View File

@ -11,8 +11,7 @@
#include "data.h"
#include "defs.h"
namespace node {
namespace quic {
namespace node::quic {
// A TLS 1.3 Session resumption ticket. Encapsulates both the TLS
// ticket and the encoded QUIC transport parameters. The encoded
@ -103,8 +102,7 @@ class SessionTicket::AppData final {
SSL* ssl_;
};
} // namespace quic
} // namespace node
} // namespace node::quic
#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

View File

@ -15,8 +15,7 @@
#include "bindingdata.h"
#include "data.h"
namespace node {
namespace quic {
namespace node::quic {
class Session;
@ -227,8 +226,7 @@ class Stream : public AsyncWrap,
void Unschedule();
};
} // namespace quic
} // namespace node
} // namespace node::quic
#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

View File

@ -13,8 +13,7 @@
#include "defs.h"
#include "sessionticket.h"
namespace node {
namespace quic {
namespace node::quic {
class Session;
class TLSContext;
@ -221,8 +220,7 @@ class TLSContext final : public MemoryRetainer,
friend class TLSSession;
};
} // namespace quic
} // namespace node
} // namespace node::quic
#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

View File

@ -10,8 +10,7 @@
#include "nbytes.h"
#include "ncrypto.h"
namespace node {
namespace quic {
namespace node::quic {
// ============================================================================
// TokenSecret
@ -300,7 +299,6 @@ RegularToken::operator const char*() const {
return reinterpret_cast<const char*>(ptr_.base);
}
} // namespace quic
} // namespace node
} // namespace node::quic
#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC

View File

@ -10,8 +10,7 @@
#include "cid.h"
#include "defs.h"
namespace node {
namespace quic {
namespace node::quic {
// TokenSecrets are used to generate things like stateless reset tokens,
// retry tokens, and token packets. They are always QUIC_TOKENSECRET_LEN
@ -251,8 +250,7 @@ class RegularToken final : public MemoryRetainer {
const ngtcp2_vec ptr_;
};
} // namespace quic
} // namespace node
} // namespace node::quic
#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

View File

@ -13,8 +13,7 @@
#include "data.h"
#include "tokens.h"
namespace node {
namespace quic {
namespace node::quic {
class Endpoint;
class Session;
@ -160,8 +159,7 @@ class TransportParams final {
QuicError error_ = QuicError::TRANSPORT_NO_ERROR;
};
} // namespace quic
} // namespace node
} // namespace node::quic
#endif // HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS