mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-29 23:45:51 +00:00
Rename MAX_SIZE and move it to rpc.cpp
This commit is contained in:
@@ -11,8 +11,6 @@ std::string strprintf(const char* format, ...);
|
|||||||
std::string FormatFullVersion();
|
std::string FormatFullVersion();
|
||||||
void RandAddSeedPerfmon();
|
void RandAddSeedPerfmon();
|
||||||
|
|
||||||
static const unsigned int MAX_SIZE = 0x02000000;
|
|
||||||
|
|
||||||
#define loop for (;;)
|
#define loop for (;;)
|
||||||
#define PAIR(t1, t2) pair<t1, t2>
|
#define PAIR(t1, t2) pair<t1, t2>
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ SETUP_LOG (RPC)
|
|||||||
using namespace boost;
|
using namespace boost;
|
||||||
using namespace boost::asio;
|
using namespace boost::asio;
|
||||||
|
|
||||||
|
unsigned int const gMaxHTTPHeaderSize = 0x02000000;
|
||||||
|
|
||||||
Json::Value JSONRPCError(int code, const std::string& message)
|
Json::Value JSONRPCError(int code, const std::string& message)
|
||||||
{
|
{
|
||||||
Json::Value error(Json::objectValue);
|
Json::Value error(Json::objectValue);
|
||||||
@@ -173,7 +175,7 @@ int ReadHTTP(std::basic_istream<char>& stream, std::map<std::string, std::string
|
|||||||
|
|
||||||
// Read header
|
// Read header
|
||||||
int nLen = ReadHTTPHeader(stream, mapHeadersRet);
|
int nLen = ReadHTTPHeader(stream, mapHeadersRet);
|
||||||
if (nLen < 0 || nLen > MAX_SIZE)
|
if (nLen < 0 || nLen > gMaxHTTPHeaderSize)
|
||||||
return 500;
|
return 500;
|
||||||
|
|
||||||
// Read message
|
// Read message
|
||||||
|
|||||||
Reference in New Issue
Block a user