Skip to content

Commit

Permalink
fix(session): fixed concurrency of streams within sessions
Browse files Browse the repository at this point in the history
Having multiple fetch requests to the same host caused them to be requested sequencially due to a
concurrency bug in the underlying concurrency library 'already' which is now fixed.

fixes #39, fixes #77 and fixes #85
  • Loading branch information
grantila committed Mar 16, 2020
1 parent 91748a5 commit 533ed40
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,13 +396,15 @@ export class Context
{
if ( cacheItem.protocol === "https1" )
{
shortcut( );
const resp = await tryWaitForHttp1( cacheItem.session );
if ( resp )
return resp;
}
else if ( cacheItem.protocol === "https2" )
{
cacheItem.session.ref( );
shortcut( );
return doFetchHttp2( cacheItem.session );
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
},
"dependencies": {
"@types/tough-cookie": "^2.3.6",
"already": "^1.11.1",
"already": "^1.12.0",
"callguard": "^1.2.1",
"get-stream": "^5.1.0",
"through2": "^3.0.1",
Expand Down

0 comments on commit 533ed40

Please sign in to comment.