mirror of
https://github.com/GOSTSec/poolserver
synced 2025-01-28 07:24:16 +00:00
Limit packet size
This commit is contained in:
parent
2911f81a18
commit
7676468780
@ -388,6 +388,10 @@ namespace Stratum
|
|||||||
} else
|
} else
|
||||||
_recvMessage += c;
|
_recvMessage += c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if message doesn't exceed maximum packet size
|
||||||
|
if (_recvMessage.size() > MAX_PACKET)
|
||||||
|
Disconnect();
|
||||||
|
|
||||||
StartRead();
|
StartRead();
|
||||||
} else {
|
} else {
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#define MAX_PACKET 4096
|
||||||
|
|
||||||
using namespace boost;
|
using namespace boost;
|
||||||
using namespace boost::asio::ip;
|
using namespace boost::asio::ip;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user