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

@ -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 {

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

@ -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…
Cancel
Save