mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 14:53:43 +01:00
Remove size limit in RPC client, keep it in server
The size limit makes a lot of sense for the server, as it never has to accept very large data. The client, however, can request arbitrary amounts of data with `listtransactions` on a large wallet. Fixes #4604.
This commit is contained in:
@@ -201,14 +201,14 @@ int ReadHTTPHeaders(std::basic_istream<char>& stream, map<string, string>& mapHe
|
||||
|
||||
int ReadHTTPMessage(std::basic_istream<char>& stream, map<string,
|
||||
string>& mapHeadersRet, string& strMessageRet,
|
||||
int nProto)
|
||||
int nProto, size_t max_size)
|
||||
{
|
||||
mapHeadersRet.clear();
|
||||
strMessageRet = "";
|
||||
|
||||
// Read header
|
||||
int nLen = ReadHTTPHeaders(stream, mapHeadersRet);
|
||||
if (nLen < 0 || nLen > (int)MAX_SIZE)
|
||||
if (nLen < 0 || (size_t)nLen > max_size)
|
||||
return HTTP_INTERNAL_SERVER_ERROR;
|
||||
|
||||
// Read message
|
||||
|
||||
Reference in New Issue
Block a user