From 1c628a996bd00fb959d0313b69964587709eeddc Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Mon, 5 Oct 2020 13:51:06 +0200 Subject: [PATCH] fix: always resume after complete if not destroy --- lib/core/client.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/core/client.js b/lib/core/client.js index 9b742674b4d..5e30d63a0bb 100644 --- a/lib/core/client.js +++ b/lib/core/client.js @@ -621,14 +621,12 @@ class Parser extends HTTPParser { util.destroy(socket, new InformationalError('reset')) } else if (!this.shouldKeepAlive) { util.destroy(socket, new InformationalError('reset')) - } else if (client[kReset]) { + } else if (client[kReset] && !client.running) { // Destroy socket once all requests have completed. // The request at the tail of the pipeline is the one // that requested reset and no further requests should // have been queued since then. - if (!client.running) { - util.destroy(socket, new InformationalError('reset')) - } + util.destroy(socket, new InformationalError('reset')) } else { socket[kResume]() resume(client)