diff options
| author | Wladimir J. van der Laan <[email protected]> | 2014-08-06 13:01:49 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2014-08-06 13:01:49 +0200 |
| commit | e17151ad2a45599e8cad90552ffcd979730b7a32 (patch) | |
| tree | feccddd99d652a0dce8f4c054af2d8451a81f9ce /src/rpcprotocol.h | |
| parent | Merge pull request #4626 (diff) | |
| download | discoin-e17151ad2a45599e8cad90552ffcd979730b7a32.tar.xz discoin-e17151ad2a45599e8cad90552ffcd979730b7a32.zip | |
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.
Diffstat (limited to 'src/rpcprotocol.h')
| -rw-r--r-- | src/rpcprotocol.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/rpcprotocol.h b/src/rpcprotocol.h index 5627077bf..a088c379d 100644 --- a/src/rpcprotocol.h +++ b/src/rpcprotocol.h @@ -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"); |