Skip to content

Commit

Permalink
fix: Fixed the issue that there is no running request when http2 goaw…
Browse files Browse the repository at this point in the history
…ay (#3875)

(cherry picked from commit 9b8abb8)
  • Loading branch information
ShenHongFei authored and github-actions[bot] committed Nov 24, 2024
1 parent ee6176c commit 6a72b99
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/dispatcher/client-h2.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,12 @@ function onHTTP2GoAway (code) {
util.destroy(this[kSocket], err)

// Fail head of pipeline.
const request = client[kQueue][client[kRunningIdx]]
client[kQueue][client[kRunningIdx]++] = null
util.errorRequest(client, request, err)

client[kPendingIdx] = client[kRunningIdx]
if (client[kRunningIdx] < client[kQueue].length) {
const request = client[kQueue][client[kRunningIdx]]
client[kQueue][client[kRunningIdx]++] = null
util.errorRequest(client, request, err)
client[kPendingIdx] = client[kRunningIdx]
}

assert(client[kRunning] === 0)

Expand Down

0 comments on commit 6a72b99

Please sign in to comment.