Skip to content

Commit

Permalink
fix: minor connect cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Feb 28, 2024
1 parent a55d61f commit f0ed4bc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/dispatcher/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,14 @@ async function connect (client) {

assert(socket)

client[kHTTPContext] = socket.alpnProtocol === 'h2'
? await connectH2(client, socket)
: await connectH1(client, socket)
try {
client[kHTTPContext] = socket.alpnProtocol === 'h2'
? await connectH2(client, socket)
: await connectH1(client, socket)
} catch (err) {
socket.destroy().on('error', () => {})
throw err
}

socket[kCounter] = 0
socket[kMaxRequests] = client[kMaxRequests]
Expand Down

0 comments on commit f0ed4bc

Please sign in to comment.