From 79ce5901f3e892f76a92428ded5fdcc42301ef0a Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Mon, 7 Mar 2016 17:03:33 -0500 Subject: [PATCH] Improved write buffering in JSONRPC client --- src/ripple/test/impl/JSONRPCClient.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ripple/test/impl/JSONRPCClient.cpp b/src/ripple/test/impl/JSONRPCClient.cpp index 2137dc218..a8720e540 100644 --- a/src/ripple/test/impl/JSONRPCClient.cpp +++ b/src/ripple/test/impl/JSONRPCClient.cpp @@ -110,16 +110,14 @@ public: using namespace boost::asio; using namespace std::string_literals; - std::string r; - r = + auto const r = "POST / HTTP/1.1\r\n" "Host: me\r\n" "Connection: Keep-Alive\r\n"s + "Content-Type: application/json; charset=UTF-8\r\n"s + "Content-Length: " + std::to_string(s.size()) + "\r\n" - "\r\n"; + "\r\n" + s; write(stream_, buffer(r)); - write(stream_, buffer(s)); read_until(stream_, bin_, "\r\n\r\n"); beast::asio::streambuf body;