1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Connection::Receive(): receive Network Packet instead of SharedBuffer<u8>.

Because we get a Buffer<u8> from ConnectionEvent, don't convert it to SharedBuffer<u8> and return it to Server/Client::Receive which will convert it to NetworkPacket
Instead, put the Buffer<u8> directly to NetworkPacket and return it to packet processing
This remove a long existing memory copy
Also check the packet size directly into Connection::Receive instead of packet processing
This commit is contained in:
Loic Blot 2015-03-31 10:35:51 +02:00
parent ab77bf98ee
commit 1fe4256462
9 changed files with 104 additions and 98 deletions

View file

@ -219,7 +219,7 @@ public:
void handleCommand_NodeMetaFields(NetworkPacket* pkt);
void handleCommand_InventoryFields(NetworkPacket* pkt);
void ProcessData(u8 *data, u32 datasize, u16 peer_id);
void ProcessData(NetworkPacket *pkt);
void Send(NetworkPacket* pkt);