Skip to content
This repository was archived by the owner on Aug 11, 2020. It is now read-only.

quic: multiple refactors #207

Closed
wants to merge 15 commits into from
Closed
Prev Previous commit
Next Next commit
quic: address multiple nits
jasnell committed Dec 4, 2019

Verified

This commit was signed with the committer’s verified signature.
jasnell James M Snell
commit e244ba9e351bdfe73cfe9bd1afa2911d6541e969
16 changes: 8 additions & 8 deletions doc/api/quic.md
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@ socket.on('listening', () => {

## QUIC Basics

QUIC is a UDP-based network transport protocol that includes built in security
QUIC is a UDP-based network transport protocol that includes built-in security
via TLS 1.3, flow control, error correction, connection migration,
multiplexing, and more.

@@ -388,7 +388,7 @@ added: REPLACEME

* Type: {BigInt}

A `BigInt` representing the number of retranmissions caused by delayed
A `BigInt` representing the number of retransmissions caused by delayed
acknowledgements.

#### quicsession.address
@@ -448,7 +448,7 @@ added: REPLACEME

* Type: {number}

The total number of unacknoledged bytes this QUIC endpoint has tramitted
The total number of unacknowledged bytes this QUIC endpoint has transmitted
to the connected peer.

#### quicsession.bytesReceived
@@ -630,7 +630,7 @@ added: REPLACEME

* Type: {BigInt}

A `BigInt` representing the number of lost-packet retranmissions that have been
A `BigInt` representing the number of lost-packet retransmissions that have been
performed on this `QuicSession`.

#### quicsession.maxDataLeft
@@ -650,7 +650,7 @@ added: REPLACEME

* Type: {BigInt}

A `BigInt` representing the maximum number of in flight bytes recorded
A `BigInt` representing the maximum number of in-flight bytes recorded
for this `QuicSession`.

#### quicsession.maxStreams
@@ -711,7 +711,7 @@ added: REPLACEME

* Type: {BigInt}

A `BigInt` representing the total number of `QuicStreams` initated by the
A `BigInt` representing the total number of `QuicStreams` initiated by the
connected peer.

#### quicsession.remoteAddress
@@ -928,7 +928,7 @@ added: REPLACEME
-->

* `servername` {String} A DNS name to associate with the given context.
* `context` {Object} A TLS SecureContext to associate with the `servername`.
* `context` {tls.SecureContext} A TLS SecureContext to associate with the `servername`.

TBD

@@ -1604,7 +1604,7 @@ added: REPLACEME
-->
* Type: {boolean}

True if dataflow on the `QuicStream` was prematured terminated.
True if dataflow on the `QuicStream` was prematurely terminated.

#### quicstream.bidirectional
<!--YAML
2 changes: 1 addition & 1 deletion src/node_quic_session.cc
Original file line number Diff line number Diff line change
@@ -592,7 +592,7 @@ void JSQuicSessionListener::OnSessionTicket(int size, SSL_SESSION* session) {

AllocatedBuffer session_ticket = env->AllocateManaged(size);
unsigned char* session_data =
reinterpret_cast<unsigned char*>(session_ticket.data());
reinterpret_cast<unsigned char*>(session_ticket.data());
memset(session_data, 0, size);
i2d_SSL_SESSION(session, &session_data);
if (!session_ticket.empty())
4 changes: 3 additions & 1 deletion src/node_quic_session.h
Original file line number Diff line number Diff line change
@@ -195,7 +195,9 @@ enum QuicSessionStatsIdx : int {
IDX_QUIC_SESSION_STATS_RETRY_COUNT,
IDX_QUIC_SESSION_STATS_LOSS_RETRANSMIT_COUNT,
IDX_QUIC_SESSION_STATS_ACK_DELAY_RETRANSMIT_COUNT,
IDX_QUIC_SESSION_STATS_PATH_VALIDATION_SUCCESS_COUNT,IDX_QUIC_SESSION_STATS_PATH_VALIDATION_FAILURE_COUNT,IDX_QUIC_SESSION_STATS_MAX_BYTES_IN_FLIGHT
IDX_QUIC_SESSION_STATS_PATH_VALIDATION_SUCCESS_COUNT,
IDX_QUIC_SESSION_STATS_PATH_VALIDATION_FAILURE_COUNT,
IDX_QUIC_SESSION_STATS_MAX_BYTES_IN_FLIGHT
};

class QuicSessionListener {
4 changes: 2 additions & 2 deletions src/node_sockaddr-inl.h
Original file line number Diff line number Diff line change
@@ -132,12 +132,12 @@ SocketAddress::SocketAddress(const SocketAddress& addr) {
memcpy(&address_, &addr.address_, addr.GetLength());
}

inline SocketAddress& SocketAddress::operator=(const sockaddr* addr) {
SocketAddress& SocketAddress::operator=(const sockaddr* addr) {
memcpy(&address_, addr, GetLength(addr));
return *this;
}

inline SocketAddress& SocketAddress::operator=(const SocketAddress& addr) {
SocketAddress& SocketAddress::operator=(const SocketAddress& addr) {
memcpy(&address_, &addr.address_, addr.GetLength());
}