mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-16 15:43:05 +01:00
Avoid a copy in RPC output
Split up HTTPReply into HTTPReply and HTTPReplyHeader, so that the message data can be streamed directly. Also removes a c_str(), which would have prevented binary output with NUL characters in it.
This commit is contained in:
@@ -143,6 +143,8 @@ private:
|
||||
std::string HTTPPost(const std::string& strMsg, const std::map<std::string,std::string>& mapRequestHeaders);
|
||||
std::string HTTPError(int nStatus, bool keepalive,
|
||||
bool headerOnly = false);
|
||||
std::string HTTPReplyHeader(int nStatus, bool keepalive, size_t contentLength,
|
||||
const char *contentType = "application/json");
|
||||
std::string HTTPReply(int nStatus, const std::string& strMsg, bool keepalive,
|
||||
bool headerOnly = false,
|
||||
const char *contentType = "application/json");
|
||||
|
||||
Reference in New Issue
Block a user