Skip to content

Commit

Permalink
refactor: apply review suggestions
Browse files Browse the repository at this point in the history
Co-authored-by: Robert Nagy <ronagy@icloud.com>
  • Loading branch information
metcoder95 and ronag committed Aug 16, 2023
1 parent d64e9e5 commit a589568
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class Client extends DispatcherBase {

// HTTP/2
this[kHTTP2Session] = null
this[kHTTP2SessionState] = {
this[kHTTP2SessionState] = !allowH2 ? null : {

Check failure on line 271 in lib/client.js

View workflow job for this annotation

GitHub Actions / lint

Expected newline between test and consequent of ternary expression

Check failure on line 271 in lib/client.js

View workflow job for this annotation

GitHub Actions / lint

Expected newline between consequent and alternate of ternary expression
// streams: null, // Fixed queue of streams - For future support of `push`
openStreams: 0, // Keep track of them to decide wether or not unref the session
maxStreams: 100 // Max peerConcurrentStreams for a Node h2 server
Expand Down Expand Up @@ -388,11 +388,7 @@ class Client extends DispatcherBase {

util.destroy(this[kHTTP2Session], err)
this[kHTTP2Session] = null
this[kHTTP2SessionState] = {
maxStreams,
openStreams: 0
// streams: null // Fixed queue of streams
}
this[kHTTP2SessionState] = null
}

if (!this[kSocket]) {
Expand Down Expand Up @@ -1198,7 +1194,7 @@ async function connect (client) {
})

if (client.destroyed) {
util.destroy(socket.on('error', () => { }), new ClientDestroyedError())
util.destroy(socket.on('error', () => {}), new ClientDestroyedError())
return
}

Expand Down Expand Up @@ -1410,7 +1406,7 @@ function _resume (client, sync) {
return
}

if ((socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking])) {
if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) {
return
}

Expand Down

0 comments on commit a589568

Please sign in to comment.