mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Network part requires SharedBuffers to be pass as value
This can trigger unreproductible crashes due to concurrency problem on SharedBuffers This fixes #6354
This commit is contained in:
parent
2ac5a45faa
commit
eabf04bd34
4 changed files with 8 additions and 10 deletions
|
@ -102,16 +102,16 @@ struct BufferedPacket
|
|||
};
|
||||
|
||||
// This adds the base headers to the data and makes a packet out of it
|
||||
BufferedPacket makePacket(Address &address, const SharedBuffer<u8> &data,
|
||||
BufferedPacket makePacket(Address &address, SharedBuffer<u8> data,
|
||||
u32 protocol_id, u16 sender_peer_id, u8 channel);
|
||||
|
||||
// Depending on size, make a TYPE_ORIGINAL or TYPE_SPLIT packet
|
||||
// Increments split_seqnum if a split packet is made
|
||||
void makeAutoSplitPacket(const SharedBuffer<u8> &data, u32 chunksize_max,
|
||||
void makeAutoSplitPacket(SharedBuffer<u8> data, u32 chunksize_max,
|
||||
u16 &split_seqnum, std::list<SharedBuffer<u8>> *list);
|
||||
|
||||
// Add the TYPE_RELIABLE header to the data
|
||||
SharedBuffer<u8> makeReliablePacket(const SharedBuffer<u8> &data, u16 seqnum);
|
||||
SharedBuffer<u8> makeReliablePacket(SharedBuffer<u8> data, u16 seqnum);
|
||||
|
||||
struct IncomingSplitPacket
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue