Sitelet https://github.com/nodejs/node/pull/34096/commits/73a51bb9dc677cea405ae6a143d6027e31eb375e
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b327d33
n-api: add version to wasm registration
devsnek Jun 25, 2020
95eecd5
doc: improve paragraph in esm.md
Trott Jun 26, 2020
90d5f35
doc: make minor improvements to paragraph in child_process.md
Trott Jun 26, 2020
da8a1ef
zlib: remove redundant variable in zlibBufferOnEnd
puzpuzpuz Jun 26, 2020
9e135ac
wasi: add reactor support
devsnek Jun 25, 2020
c23d2fd
src: allow embedders to disable esm loader
codebytere Jun 26, 2020
cb673e1
2020-06-30, Version 12.18.2 'Erbium' (LTS)
BethGriggs Jun 26, 2020
b613933
test: update test-child-process-spawn-loop for Python 3
richardlau Jun 26, 2020
68634d2
quic: remove redundant cast
gengjiawen Jun 27, 2020
204f20f
quic: minor cleanups in quic_buffer
jasnell Jun 26, 2020
8f4b4f2
stream: destroy wrapped streams on error
ronag Jun 28, 2020
312a4f3
net: fix bufferSize
ronag Jun 27, 2020
0edeeec
net: doc deprecate bufferSize
ronag Jun 28, 2020
eb8fc2b
2020-06-30, Version 14.5.0 (Current)
codebytere Jun 28, 2020
e20beaf
meta: fixup CODEOWNERS so it hopefully works
jasnell Jul 1, 2020
73a51bb
quic: cleanups in JS API
jasnell Jun 27, 2020
d603418
quic: cleanups for QuicSocket
jasnell Jun 30, 2020
def8e76
quic: fixup set_final_size
jasnell Jun 30, 2020
3bae2d5
quic: consolidate onSessionClose and onSessionSilentClose
jasnell Jun 30, 2020
b1fab88
quic: remove unused callback function
jasnell Jun 30, 2020
2afc1ab
quic: fixup constant exports, export all protocol error codes
jasnell Jun 30, 2020
b5fe31e
quic: avoid using private JS fields for now
jasnell Jun 30, 2020
31d6d9d
quic: reduce duplication of code
jasnell Jun 30, 2020
584fc7e
doc: clarify ambiguous rdev description
Trott Jun 28, 2020
8ff8c68
doc: clarify O_EXCL text in fs.md
Trott Jun 28, 2020
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
Prev Previous commit
Next Next commit
quic: cleanups in JS API
PR-URL: #34137
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
  • Loading branch information
jasnell committed Jul 1, 2020
commit 73a51bb9dc677cea405ae6a143d6027e31eb375e
19 changes: 5 additions & 14 deletions lib/internal/quic/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,19 +247,11 @@ let warnedVerifyHostnameIdentity = false;

assert(process.versions.ngtcp2 !== undefined);

// Called by the C++ internals when the socket is closed.
// When this is called, the only thing left to do is destroy
// the QuicSocket instance.
function onSocketClose() {
this[owner_symbol].destroy();
}

// Called by the C++ internals when an error occurs on the socket.
// When this is called, the only thing left to do is destroy
// the QuicSocket instance with an error.
// TODO(@jasnell): Should consolidate this with onSocketClose
function onSocketError(err) {
this[owner_symbol].destroy(errnoException(err));
// Called by the C++ internals when the QuicSocket is closed with
// or without an error. The only thing left to do is destroy the
// QuicSocket instance.
function onSocketClose(err) {
this[owner_symbol].destroy(err != null ? errnoException(err) : undefined);
}

// Called by the C++ internals when the server busy state of
Expand Down Expand Up @@ -579,7 +571,6 @@ function onStreamBlocked() {
// Register the callbacks with the QUIC internal binding.
setCallbacks({
onSocketClose,
onSocketError,
onSocketServerBusy,
onSessionReady,
onSessionCert,
Expand Down
1 change: 0 additions & 1 deletion src/quic/node_quic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ void QuicSetCallbacks(const FunctionCallbackInfo<Value>& args) {
} while (0)

SETFUNCTION("onSocketClose", socket_close);
SETFUNCTION("onSocketError", socket_error);
SETFUNCTION("onSessionReady", session_ready);
SETFUNCTION("onSessionCert", session_cert);
SETFUNCTION("onSessionClientHello", session_client_hello);
Expand Down
2 changes: 1 addition & 1 deletion src/quic/node_quic_socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void JSQuicSocketListener::OnError(ssize_t code) {
HandleScope scope(env->isolate());
Context::Scope context_scope(env->context());
Local<Value> arg = Number::New(env->isolate(), static_cast<double>(code));
socket()->MakeCallback(env->quic_on_socket_error_function(), 1, &arg);
socket()->MakeCallback(env->quic_on_socket_close_function(), 1, &arg);
}

void JSQuicSocketListener::OnSessionReady(BaseObjectPtr<QuicSession> session) {
Expand Down