Skip to content

Commit

Permalink
quic: address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell committed Apr 10, 2023
1 parent 7b0fc29 commit 4891775
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/quic/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ bool SetOption(Environment* env,
if (!lossless) {
Utf8Value label(env->isolate(), name);
THROW_ERR_OUT_OF_RANGE(
env,
(std::string("options.") + (*label) + " is out of range").c_str());
env, ("options." + label.ToString() + " is out of range").c_str());
return false;
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/quic/logstream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void LogStream::Emit(const uint8_t* data, size_t len, EmitOption option) {
}

void LogStream::Emit(const std::string_view line, EmitOption option) {
Emit(reinterpret_cast<const uint8_t*>(line.begin()), line.length(), option);
Emit(reinterpret_cast<const uint8_t*>(line.data()), line.length(), option);
}

void LogStream::End() {
Expand Down
3 changes: 3 additions & 0 deletions src/quic/logstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ class LogStream : public AsyncWrap, public StreamBase {
bool reading_ = false;
std::deque<Chunk> buffer_;

// The value here is fairly arbitrary. Once we get everything
// fully implemented and start working with this, we might
// tune this number further.
static constexpr size_t kMaxLogStreamBuffer = 1024 * 10;

// The LogStream buffer enforces a maximum size of kMaxLogStreamBuffer.
Expand Down
3 changes: 1 addition & 2 deletions src/quic/transportparams.cc
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,8 @@ void TransportParams::GenerateStatelessResetToken(
}

CID TransportParams::GeneratePreferredAddressToken(const Session& session) {
DCHECK_NOT_NULL(session);
DCHECK(ptr_ == &params_);
DCHECK(pscid);
// DCHECK(pscid);
// TODO(@jasnell): To be implemented when Session is implemented
// *pscid = session->cid_factory_.Generate();
// params_.preferred_address.cid = *pscid;
Expand Down
4 changes: 2 additions & 2 deletions src/quic/transportparams.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class TransportParams final {
// address and port that the server would prefer the client to use when
// communicating with it. See the QUIC specification for more detail on how
// the preferred address mechanism works.
std::optional<SocketAddress> preferred_address_ipv4 = std::nullopt;
std::optional<SocketAddress> preferred_address_ipv6 = std::nullopt;
std::optional<SocketAddress> preferred_address_ipv4{};
std::optional<SocketAddress> preferred_address_ipv6{};

// The initial size of the flow control window of locally initiated streams.
// This is the maximum number of bytes that the *remote* endpoint can send
Expand Down
1 change: 1 addition & 0 deletions test/sequential/test-async-wrap-getasyncid.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const { getSystemErrorName } = require('util');
delete providers.BLOBREADER;
delete providers.RANDOMPRIMEREQUEST;
delete providers.CHECKPRIMEREQUEST;
delete providers.QUIC_LOGSTREAM;

const objKeys = Object.keys(providers);
if (objKeys.length > 0)
Expand Down

0 comments on commit 4891775

Please sign in to comment.