Skip to content

Commit

Permalink
fix: missing error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Nov 21, 2024
1 parent 70f7314 commit 4730909
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lib/dispatcher/client-h1.js
Original file line number Diff line number Diff line change
Expand Up @@ -769,8 +769,20 @@ async function connectH1 (client, socket) {
client[kSocket] = socket

if (!llhttpInstance) {
llhttpInstance = await llhttpPromise
llhttpPromise = null
try {
const noop = () => {}
socket.on('error', noop)
llhttpInstance = await llhttpPromise
llhttpPromise = null
socket.off('error', noop)
} catch (err) {
util.destroy(socket)
throw err
}

if (socket.errored) {
throw socket.errored
}
}

socket[kNoRef] = false
Expand Down

0 comments on commit 4730909

Please sign in to comment.