Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update lib/_http_agent.js
Co-Authored-By: Denys Otrishko <shishugi@gmail.com>
  • Loading branch information
ronag and lundibundi authored Apr 14, 2020
commit f88a1850cd043933c5df143f56434316bcfaba4f
9 changes: 6 additions & 3 deletions lib/_http_agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,13 @@ function Agent(options) {
return;
}

if (this.requests[name] && this.requests[name].length) {
const req = this.requests[name].shift();
const requests = this.requests[name];
if (requests && requests.length) {
const req = requests.shift();
setRequestSocket(this, req, socket);
if (this.requests[name].length === 0) {
if (requests.length === 0) {
delete this.requests[name];
}
delete this.requests[name];
}
return;
Expand Down