aboutsummaryrefslogtreecommitdiff
path: root/src/rpcserver.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-08-06 13:01:49 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-08-06 13:01:49 +0200
commite17151ad2a45599e8cad90552ffcd979730b7a32 (patch)
treefeccddd99d652a0dce8f4c054af2d8451a81f9ce /src/rpcserver.cpp
parent5e94d0036a76ea9d63e4ed17b12554caef7f55da (diff)
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/rpcserver.cpp')
-rw-r--r--src/rpcserver.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp
index 716a7fba6a..d9a664dc54 100644
--- a/src/rpcserver.cpp
+++ b/src/rpcserver.cpp
@@ -862,7 +862,7 @@ static bool HTTPReq_JSONRPC(AcceptedConnection *conn,
else
throw JSONRPCError(RPC_PARSE_ERROR, "Top-level object parse error");
- conn->stream() << HTTPReply(HTTP_OK, strReply, fRun) << std::flush;
+ conn->stream() << HTTPReplyHeader(HTTP_OK, fRun, strReply.size()) << strReply << std::flush;
}
catch (Object& objError)
{