mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 09:05:19 +02:00
Make Connection::Receive return the data via a SharedBuffer reference, so the caller doesn't have to choose the right buffer size in advance.
Conflicts: src/test.cpp
This commit is contained in:
@@ -1777,14 +1777,13 @@ void Server::AsyncRunStep()
|
||||
void Server::Receive()
|
||||
{
|
||||
DSTACK(__FUNCTION_NAME);
|
||||
u32 data_maxsize = 10000;
|
||||
Buffer<u8> data(data_maxsize);
|
||||
SharedBuffer<u8> data;
|
||||
u16 peer_id;
|
||||
u32 datasize;
|
||||
try{
|
||||
{
|
||||
JMutexAutoLock conlock(m_con_mutex);
|
||||
datasize = m_con.Receive(peer_id, *data, data_maxsize);
|
||||
datasize = m_con.Receive(peer_id, data);
|
||||
}
|
||||
|
||||
// This has to be called so that the client list gets synced
|
||||
|
Reference in New Issue
Block a user