We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f345b9 commit e2568b0Copy full SHA for e2568b0
1 file changed
lib/core/client.js
@@ -376,23 +376,29 @@ class Parser extends HTTPParser {
376
this.read = 0
377
this.request = null
378
this.paused = false
379
+ this.resuming = false
380
this.queue = []
381
382
this._resume = () => {
- if (!this.paused) {
383
+ if (!this.paused || this.resuming) {
384
return
385
}
386
387
388
- while (this.queue.length) {
389
- const [fn, ...args] = this.queue.shift()
+ this.resuming = true
390
+ try {
391
+ while (this.queue.length) {
392
+ const [fn, ...args] = this.queue.shift()
393
- Reflect.apply(fn, this, args)
394
+ Reflect.apply(fn, this, args)
395
- if (this.paused) {
- return
396
+ if (this.paused) {
397
+ return
398
+ }
399
400
+ } finally {
401
402
403
404
socketResume(socket)
0 commit comments