mirror of
https://github.com/GOSTSec/poolserver
synced 2025-01-14 08:47:53 +00:00
Limit packet size
This commit is contained in:
parent
2911f81a18
commit
7676468780
@ -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 {
|
||||
|
@ -18,6 +18,8 @@
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
#define MAX_PACKET 4096
|
||||
|
||||
using namespace boost;
|
||||
using namespace boost::asio::ip;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user