diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-08-06 13:01:49 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-08-06 13:01:49 +0200 |
commit | e17151ad2a45599e8cad90552ffcd979730b7a32 (patch) | |
tree | feccddd99d652a0dce8f4c054af2d8451a81f9ce /src/rpcserver.cpp | |
parent | 5e94d0036a76ea9d63e4ed17b12554caef7f55da (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.cpp | 2 |
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) { |