Browse Source

Limit packet size

master
Intel 11 years ago
parent
commit
7676468780
  1. 4
      src/server/poolserver/Stratum/Client.cpp
  2. 2
      src/server/poolserver/Stratum/Server.h

4
src/server/poolserver/Stratum/Client.cpp

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

2
src/server/poolserver/Stratum/Server.h

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

Loading…
Cancel
Save