From 1fe4256462826c218ed9bf171be4c07e0db33e25 Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Tue, 31 Mar 2015 10:35:51 +0200 Subject: Connection::Receive(): receive Network Packet instead of SharedBuffer. Because we get a Buffer from ConnectionEvent, don't convert it to SharedBuffer and return it to Server/Client::Receive which will convert it to NetworkPacket Instead, put the Buffer 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 --- src/server.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server.h') diff --git a/src/server.h b/src/server.h index 0c0a5f91c..a584cbe5a 100644 --- a/src/server.h +++ b/src/server.h @@ -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); -- cgit v1.2.3