File tree 3 files changed +6
-16
lines changed
3 files changed +6
-16
lines changed Original file line number Diff line number Diff line change @@ -247,19 +247,11 @@ let warnedVerifyHostnameIdentity = false;
247
247
248
248
assert ( process . versions . ngtcp2 !== undefined ) ;
249
249
250
- // Called by the C++ internals when the socket is closed.
251
- // When this is called, the only thing left to do is destroy
252
- // the QuicSocket instance.
253
- function onSocketClose ( ) {
254
- this [ owner_symbol ] . destroy ( ) ;
255
- }
256
-
257
- // Called by the C++ internals when an error occurs on the socket.
258
- // When this is called, the only thing left to do is destroy
259
- // the QuicSocket instance with an error.
260
- // TODO(@jasnell): Should consolidate this with onSocketClose
261
- function onSocketError ( err ) {
262
- this [ owner_symbol ] . destroy ( errnoException ( err ) ) ;
250
+ // Called by the C++ internals when the QuicSocket is closed with
251
+ // or without an error. The only thing left to do is destroy the
252
+ // QuicSocket instance.
253
+ function onSocketClose ( err ) {
254
+ this [ owner_symbol ] . destroy ( err != null ? errnoException ( err ) : undefined ) ;
263
255
}
264
256
265
257
// Called by the C++ internals when the server busy state of
@@ -579,7 +571,6 @@ function onStreamBlocked() {
579
571
// Register the callbacks with the QUIC internal binding.
580
572
setCallbacks ( {
581
573
onSocketClose,
582
- onSocketError,
583
574
onSocketServerBusy,
584
575
onSessionReady,
585
576
onSessionCert,
Original file line number Diff line number Diff line change @@ -55,7 +55,6 @@ void QuicSetCallbacks(const FunctionCallbackInfo<Value>& args) {
55
55
} while (0 )
56
56
57
57
SETFUNCTION (" onSocketClose" , socket_close);
58
- SETFUNCTION (" onSocketError" , socket_error);
59
58
SETFUNCTION (" onSessionReady" , session_ready);
60
59
SETFUNCTION (" onSessionCert" , session_cert);
61
60
SETFUNCTION (" onSessionClientHello" , session_client_hello);
Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ void JSQuicSocketListener::OnError(ssize_t code) {
137
137
HandleScope scope (env->isolate ());
138
138
Context::Scope context_scope (env->context ());
139
139
Local<Value> arg = Number::New (env->isolate (), static_cast <double >(code));
140
- socket ()->MakeCallback (env->quic_on_socket_error_function (), 1 , &arg);
140
+ socket ()->MakeCallback (env->quic_on_socket_close_function (), 1 , &arg);
141
141
}
142
142
143
143
void JSQuicSocketListener::OnSessionReady (BaseObjectPtr<QuicSession> session) {
You can’t perform that action at this time.
0 commit comments