Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -1945,7 +1945,7 @@ incoming data, after it has finished writing the last response, before a socket
will be destroyed.

This timeout value is combined with the
\[`server.keepAliveTimeoutBuffer`]\[] option to determine the actual socket
[`server.keepAliveTimeoutBuffer`][] option to determine the actual socket
timeout, calculated as:
socketTimeout = keepAliveTimeout + keepAliveTimeoutBuffer
If the server receives new data before the keep-alive timeout has fired, it
Expand Down Expand Up @@ -4453,6 +4453,7 @@ const agent2 = new http.Agent({ proxyEnv: process.env });
[`response.writeHead()`]: #responsewriteheadstatuscode-statusmessage-headers
[`server.close()`]: #serverclosecallback
[`server.headersTimeout`]: #serverheaderstimeout
[`server.keepAliveTimeoutBuffer`]: #serverkeepalivetimeoutbuffer
[`server.keepAliveTimeout`]: #serverkeepalivetimeout
[`server.listen()`]: net.md#serverlisten
[`server.requestTimeout`]: #serverrequesttimeout
Expand Down
8 changes: 8 additions & 0 deletions src/node_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1526,6 +1526,14 @@ uint32_t FastWriteString(Local<Value> receiver,
uint32_t max_length,
// NOLINTNEXTLINE(runtime/references)
FastApiCallbackOptions& options) {
// Just a heads up... this is a v8 fast api function. The use of
// FastOneByteString has some caveats. Specifically, a GC occurring
// between the time the FastOneByteString is created and the time
// we use it below can cause the FastOneByteString to become invalid
// and produce garbage data. This is not a problem here because we
// are not performing any allocations or other operations that would
// trigger a GC before the FastOneByteString is used. Take care when
// modifying this code to ensure that no operations would trigger a GC.
HandleScope handle_scope(options.isolate);
SPREAD_BUFFER_ARG(dst_obj, dst);
CHECK(offset <= dst_length);
Expand Down
8 changes: 5 additions & 3 deletions src/quic/data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,15 @@ T Store::convert() const {
}

Store::operator uv_buf_t() const {
return convert<uv_buf_t, typeof(*uv_buf_t::base)>();
return convert<uv_buf_t, char>();
}

Store::operator ngtcp2_vec() const {
return convert<ngtcp2_vec, typeof(*ngtcp2_vec::base)>();
return convert<ngtcp2_vec, uint8_t>();
}

Store::operator nghttp3_vec() const {
return convert<nghttp3_vec, typeof(*ngtcp2_vec::base)>();
return convert<nghttp3_vec, uint8_t>();
}

void Store::MemoryInfo(MemoryTracker* tracker) const {
Expand Down Expand Up @@ -386,6 +386,8 @@ const QuicError QuicError::FromConnectionClose(ngtcp2_conn* session) {
QUIC_TRANSPORT_ERRORS(V)
#undef V

const QuicError QuicError::TRANSPORT_NO_ERROR =
ForTransport(TransportError::NO_ERROR_);
const QuicError QuicError::HTTP3_NO_ERROR = ForApplication(NGHTTP3_H3_NO_ERROR);
const QuicError QuicError::VERSION_NEGOTIATION = ForVersionNegotiation();
const QuicError QuicError::IDLE_CLOSE = ForIdleClose();
Expand Down
6 changes: 5 additions & 1 deletion src/quic/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ class Store final : public MemoryRetainer {

// Periodically, these need to be updated to match the latest ngtcp2 defs.
#define QUIC_TRANSPORT_ERRORS(V) \
V(NO_ERROR) \
V(INTERNAL_ERROR) \
V(CONNECTION_REFUSED) \
V(FLOW_CONTROL_ERROR) \
Expand Down Expand Up @@ -155,6 +154,10 @@ class QuicError final : public MemoryRetainer {
public:
// The known error codes for the transport namespace.
enum class TransportError : error_code {
// NO_ERROR has to be treated specially since it is a macro on
// some Windows cases and results in a compile error if we leave
// it as is.
NO_ERROR_ = NGTCP2_NO_ERROR,
#define V(name) name = NGTCP2_##name,
QUIC_TRANSPORT_ERRORS(V)
#undef V
Expand Down Expand Up @@ -273,6 +276,7 @@ class QuicError final : public MemoryRetainer {

static const QuicError FromConnectionClose(ngtcp2_conn* session);

static const QuicError TRANSPORT_NO_ERROR;
#define V(name) static const QuicError TRANSPORT_##name;
QUIC_TRANSPORT_ERRORS(V)
#undef V
Expand Down
2 changes: 1 addition & 1 deletion test/cctest/test_quic_error.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ TEST(QuicError, NoError) {
CHECK_EQ(err.reason(), "");
CHECK_EQ(err, QuicError::TRANSPORT_NO_ERROR);

CHECK_EQ(QuicError::TransportError::NO_ERROR, QuicError::QUIC_NO_ERROR);
CHECK_EQ(QuicError::TransportError::NO_ERROR_, QuicError::QUIC_NO_ERROR);
CHECK_EQ(QuicError::Http3Error::H3_NO_ERROR, QuicError::HTTP3_NO_ERROR_CODE);

QuicError err2("a reason");
Expand Down
Loading