From bbe05bf00f26025996d46e5ac629770c9976114c Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 23 Jul 2020 10:15:23 -0700 Subject: [PATCH 1/3] quic: remove extraneous unused debug property --- lib/internal/quic/core.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/internal/quic/core.js b/lib/internal/quic/core.js index 14da5d28bb4fc0..a3dda49873d180 100644 --- a/lib/internal/quic/core.js +++ b/lib/internal/quic/core.js @@ -2518,7 +2518,6 @@ function streamOnPause() { this[kHandle].readStop(); } class QuicStream extends Duplex { - #count = 0; [kInternalState] = { closed: false, closePromise: undefined, From 8311f2628ed1a538c505624b335eb17ce0bd0fdd Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 23 Jul 2020 10:23:01 -0700 Subject: [PATCH 2/3] quic: remove no-longer relevant TODO statements --- lib/internal/quic/core.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/internal/quic/core.js b/lib/internal/quic/core.js index a3dda49873d180..6a227d3d4ae965 100644 --- a/lib/internal/quic/core.js +++ b/lib/internal/quic/core.js @@ -1858,7 +1858,6 @@ class QuicSession extends EventEmitter { if (!this[kHandshakePost]()) { if (typeof state.handshakeCompletePromiseReject === 'function') { - // TODO(@jasnell): Proper error state.handshakeCompletePromiseReject( new ERR_OPERATION_FAILED('Handshake failed')); } @@ -2005,7 +2004,6 @@ class QuicSession extends EventEmitter { state.closePromiseResolve(); if (typeof state.handshakeCompletePromiseReject === 'function') { - // TODO(@jasnell): Proper error state.handshakeCompletePromiseReject( new ERR_OPERATION_FAILED('Handshake failed')); } From b3623ae1902be79304f2c3a3fdf1a67fe925689c Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 23 Jul 2020 12:11:12 -0700 Subject: [PATCH 3/3] quic: refactor ocsp to use async function rather than event/callback --- doc/api/quic.md | 91 ++++++++------ lib/internal/quic/core.js | 117 ++++++++---------- lib/internal/quic/util.js | 33 +++-- src/quic/node_quic_session.cc | 10 +- src/quic/node_quic_session.h | 2 +- test/parallel/test-quic-client-server.js | 69 ++++++----- .../test-quic-errors-quicsocket-connect.js | 4 +- 7 files changed, 177 insertions(+), 149 deletions(-) diff --git a/doc/api/quic.md b/doc/api/quic.md index 64b5f7ff087437..9a2d94080cde71 100644 --- a/doc/api/quic.md +++ b/doc/api/quic.md @@ -1188,23 +1188,6 @@ added: REPLACEME The `QuicClientSession` class implements the client side of a QUIC connection. Instances are created using the `quicsocket.connect()` method. -#### Event: `'OCSPResponse'` - - -Emitted when the `QuicClientSession` receives a requested OCSP certificate -status response from the QUIC server peer. - -The callback is invoked with a single argument: - -* `response` {Buffer} - -Node.js does not perform any automatic validation or processing of the -response. - -The `'OCSPResponse'` event will not be emitted more than once. - #### Event: `'sessionTicket'` - -Emitted when the `QuicServerSession` has received a OCSP certificate status -request as part of the TLS handshake. - -The callback is invoked with three arguments: - -* `servername` {string} -* `context` {tls.SecureContext} -* `callback` {Function} - -The callback *must* be invoked in order for the TLS handshake to continue. - -The `'OCSPRequest'` event will not be emitted more than once. - #### `quicserversession.addContext(servername\[, context\])`