mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02: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:
parent
5e94d0036a
commit
e17151ad2a
3 changed files with 18 additions and 9 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue