Skip to content

Commit

Permalink
Fix unlimited frame max setting
Browse files Browse the repository at this point in the history
  • Loading branch information
magne authored and icappello committed Dec 19, 2023
1 parent 5df253d commit 3119548
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,10 +470,9 @@ export class Connection {
}

private calculateFrameMaxSizeFrom(tuneResponseFrameMax: number) {
if (this.frameMax === DEFAULT_UNLIMITED_FRAME_SIZE && tuneResponseFrameMax === DEFAULT_UNLIMITED_FRAME_SIZE) {
return 0
}
return Math.max(1, Math.min(this.frameMax, tuneResponseFrameMax))
if (this.frameMax === DEFAULT_UNLIMITED_FRAME_SIZE) return tuneResponseFrameMax
if (tuneResponseFrameMax === DEFAULT_UNLIMITED_FRAME_SIZE) return this.frameMax
return Math.min(this.frameMax, tuneResponseFrameMax)
}
}

Expand Down

0 comments on commit 3119548

Please sign in to comment.