Skip to content

Commit

Permalink
fix: use buffer same size as C version
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpach committed Oct 18, 2020
1 parent ffb6761 commit 20e1324
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Assets/Mirror/Runtime/Transport/Kcp/Kcp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public Kcp(uint conv_, Action<byte[], int> output_)
SendWindowMax = WND_SND;
ReceiveWindowMax = WND_RCV;
RmtWnd = WND_RCV;
buffer = new byte[mtu];
buffer = new byte[(mtu + OVERHEAD) * 3];
output = output_;
refTime.Start();
}
Expand Down Expand Up @@ -874,7 +874,7 @@ public void SetMtu(uint mtu)
if (reserved >= (int)(mtu - OVERHEAD))
throw new ArgumentException("Please increase the MTU value so it is higher than reserved bytes.");

buffer = new byte[mtu];
buffer = new byte[(mtu + OVERHEAD) * 3];

this.mtu = mtu;
}
Expand Down

0 comments on commit 20e1324

Please sign in to comment.