Skip to content

Commit

Permalink
fix: bad client destroy on servername change
Browse files Browse the repository at this point in the history
Fixes: #3065
  • Loading branch information
ronag committed Apr 7, 2024
1 parent cae5625 commit 40e866f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/dispatcher/client.js
Expand Up @@ -581,7 +581,15 @@ function _resume (client, sync) {
}

client[kServerName] = request.servername
client[kHTTPContext]?.destroy(new InformationalError('servername changed'))
client[kHTTPContext]?.destroy(new InformationalError('servername changed'), (err) => {
if (err) {
// TODO (fix): What to do?
}

client[kHTTPContext] = null

resume(client)
})
}

if (client[kConnecting]) {
Expand Down

0 comments on commit 40e866f

Please sign in to comment.