diff --git a/src/common/socket.cpp b/src/common/socket.cpp index c273840ee1..ef8d167502 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -47,6 +47,10 @@ #include "strlib.hpp" #include "timer.hpp" +// Reuseable global packet buffer to prevent too many allocations +// Take socket.cpp::socket_max_client_packet into consideration +int8 packet_buffer[UINT16_MAX]; + ///////////////////////////////////////////////////////////////////// #if defined(WIN32) ///////////////////////////////////////////////////////////////////// diff --git a/src/common/socket.hpp b/src/common/socket.hpp index c072ee399c..13664a1ea5 100644 --- a/src/common/socket.hpp +++ b/src/common/socket.hpp @@ -201,7 +201,7 @@ void send_shortlist_do_sends(); // Reuseable global packet buffer to prevent too many allocations // Take socket.cpp::socket_max_client_packet into consideration -static int8 packet_buffer[UINT16_MAX]; +extern int8 packet_buffer[UINT16_MAX]; template bool socket_send( int fd, P& packet ){