1
0
mirror of https://github.com/GOSTSec/poolserver synced 2025-01-14 08:47:53 +00:00

Limit packet size

This commit is contained in:
Intel 2014-05-11 14:00:28 -04:00
parent 2911f81a18
commit 7676468780
2 changed files with 6 additions and 0 deletions

View File

@ -388,6 +388,10 @@ namespace Stratum
} else
_recvMessage += c;
}
// Check if message doesn't exceed maximum packet size
if (_recvMessage.size() > MAX_PACKET)
Disconnect();
StartRead();
} else {

View File

@ -18,6 +18,8 @@
#include <set>
#include <vector>
#define MAX_PACKET 4096
using namespace boost;
using namespace boost::asio::ip;