Skip to content

Commit a325de7

Browse files
committed
quic: hopefully fixup windows build issues
1 parent ee923ac commit a325de7

File tree

8 files changed

+18
-27
lines changed

8 files changed

+18
-27
lines changed

src/quic/application.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "application.h"
44
#include <node_sockaddr-inl.h>
55
#include <v8.h>
6+
#include "defs.h"
67
#include "endpoint.h"
78
#include "packet.h"
89
#include "session.h"
@@ -378,9 +379,7 @@ class DefaultApplication final : public Session::Application {
378379
return i == cnt;
379380
};
380381

381-
if (!stream_data.stream || !is_empty(stream_data.buf, stream_data.count))
382-
return false;
383-
return true;
382+
return stream_data.stream && is_empty(stream_data.buf, stream_data.count);
384383
}
385384

386385
bool StreamCommit(StreamData* stream_data, size_t datalen) override {

src/quic/bindingdata.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ constexpr size_t kMaxVectorCount = 16;
149149
V(max_connections_total, "maxConnectionsTotal") \
150150
V(max_datagram_frame_size, "maxDatagramFrameSize") \
151151
V(max_field_section_size, "maxFieldSectionSize") \
152-
V(max_header_length, "maxHeaderLength"); \
152+
V(max_header_length, "maxHeaderLength") \
153153
V(max_header_pairs, "maxHeaderPairs") \
154154
V(max_idle_timeout, "maxIdleTimeout") \
155155
V(max_payload_size, "maxPayloadSize") \

src/quic/endpoint.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ class Endpoint::UDP::Impl final : public HandleWrap {
298298
return;
299299
}
300300

301-
impl->endpoint_->Receive(uv_buf_t{buf->base, static_cast<size_t>(nread)},
301+
impl->endpoint_->Receive(uv_buf_init(buf->base, static_cast<size_t>(nread)),
302302
SocketAddress(addr));
303303
}
304304

@@ -459,7 +459,7 @@ void Endpoint::Initialize(Environment* env, Local<Object> target) {
459459
#undef V
460460

461461
#define V(name, key, __) \
462-
auto IDX_STATE_ENDPOINT_##name = OffsetOf(&Endpoint::State::key);
462+
auto IDX_STATE_ENDPOINT_##name = offsetof(Endpoint::State, key);
463463
ENDPOINT_STATE(V)
464464
#undef V
465465

src/quic/endpoint.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,10 @@ class Endpoint final : public AsyncWrap, public Packet::Listener {
268268
SET_MEMORY_INFO_NAME(Endpoint)
269269
SET_SELF_SIZE(Endpoint)
270270

271-
private:
272271
struct Stats;
273272
struct State;
274273

274+
private:
275275
class UDP final : public MemoryRetainer {
276276
public:
277277
explicit UDP(Endpoint* endpoint);

src/quic/session.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,7 +1273,7 @@ void Session::SelectPreferredAddress(PreferredAddress* preferredAddress) {
12731273
switch (family) {
12741274
case AF_INET: {
12751275
auto ipv4 = preferredAddress->ipv4();
1276-
if (ipv4 != std::nullopt) {
1276+
if (ipv4.has_value()) {
12771277
if (ipv4->address.empty() || ipv4->port == 0) return;
12781278
SocketAddress::New(AF_INET,
12791279
std::string(ipv4->address).c_str(),
@@ -1285,7 +1285,7 @@ void Session::SelectPreferredAddress(PreferredAddress* preferredAddress) {
12851285
}
12861286
case AF_INET6: {
12871287
auto ipv6 = preferredAddress->ipv6();
1288-
if (ipv6 != std::nullopt) {
1288+
if (ipv6.has_value()) {
12891289
if (ipv6->address.empty() || ipv6->port == 0) return;
12901290
SocketAddress::New(AF_INET,
12911291
std::string(ipv6->address).c_str(),
@@ -2133,7 +2133,7 @@ void Session::Initialize(Environment* env, Local<Object> target) {
21332133
#undef V
21342134

21352135
#define V(name, key, __) \
2136-
auto IDX_STATE_SESSION_##name = OffsetOf(&Session::State::key);
2136+
auto IDX_STATE_SESSION_##name = offsetof(Session::State, key);
21372137
SESSION_STATE(V)
21382138
#undef V
21392139

src/quic/session.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ class Session final : public AsyncWrap, private SessionTicket::AppData::Source {
6868

6969
// HTTP/3 specific options.
7070
uint64_t max_field_section_size = 0;
71-
size_t qpack_max_dtable_capacity = 0;
72-
size_t qpack_encoder_max_dtable_capacity = 0;
73-
size_t qpack_blocked_streams = 0;
71+
uint64_t qpack_max_dtable_capacity = 0;
72+
uint64_t qpack_encoder_max_dtable_capacity = 0;
73+
uint64_t qpack_blocked_streams = 0;
7474

7575
SET_NO_MEMORY_INFO()
7676
SET_MEMORY_INFO_NAME(Application::Options)
@@ -225,11 +225,12 @@ class Session final : public AsyncWrap, private SessionTicket::AppData::Source {
225225
SET_MEMORY_INFO_NAME(Session)
226226
SET_SELF_SIZE(Session)
227227

228+
struct State;
229+
struct Stats;
230+
228231
private:
229232
struct Impl;
230233
struct MaybeCloseConnectionScope;
231-
struct State;
232-
struct Stats;
233234

234235
using StreamsMap = std::unordered_map<int64_t, BaseObjectPtr<Stream>>;
235236
using QuicConnectionPointer = DeleteFnPtr<ngtcp2_conn, ngtcp2_conn_del>;

src/quic/tlscontext.cc

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <v8.h>
1212
#include "bindingdata.h"
1313
#include "defs.h"
14+
#include "session.h"
1415
#include "transportparams.h"
1516

1617
namespace node {
@@ -29,18 +30,6 @@ namespace quic {
2930

3031
const TLSContext::Options TLSContext::Options::kDefault = {};
3132

32-
// TODO(@jasnell): This session class is just a placeholder.
33-
// The real session impl will be added in a separate commit.
34-
class Session {
35-
public:
36-
operator ngtcp2_conn*() { return nullptr; }
37-
void EmitKeylog(const char* line) const {}
38-
void EmitSessionTicket(Store&& store) {}
39-
void SetStreamOpenAllowed() {}
40-
bool is_destroyed() const { return false; }
41-
bool wants_session_ticket() const { return false; }
42-
};
43-
4433
namespace {
4534
constexpr size_t kMaxAlpnLen = 255;
4635

test/sequential/test-async-wrap-getasyncid.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ const { getSystemErrorName } = require('util');
7070
delete providers.QUIC_PACKET;
7171
delete providers.QUIC_UDP;
7272
delete providers.QUIC_ENDPOINT;
73+
delete providers.QUIC_SESSION;
74+
delete providers.QUIC_STREAM;
7375

7476
const objKeys = Object.keys(providers);
7577
if (objKeys.length > 0)

0 commit comments

Comments
 (0)