Merge pull request #34542 from Faless/net/packet_peer_stream_input_buffer
Fix buffers size calculation in PacketPeerStream.
This commit is contained in:
commit
ac046b7bac
1 changed files with 1 additions and 1 deletions
|
@ -282,7 +282,7 @@ void PacketPeerStream::set_input_buffer_max_size(int p_max_size) {
|
|||
ERR_FAIL_COND_MSG(p_max_size < 0, "Max size of input buffer size cannot be smaller than 0.");
|
||||
//warning may lose packets
|
||||
ERR_FAIL_COND_MSG(ring_buffer.data_left(), "Buffer in use, resizing would cause loss of data.");
|
||||
ring_buffer.resize(nearest_shift(p_max_size + 4));
|
||||
ring_buffer.resize(nearest_shift(next_power_of_2(p_max_size + 4)) - 1);
|
||||
input_buffer.resize(next_power_of_2(p_max_size + 4));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue