From 026f2a7fc738b5291b69c42882f467db9a48b22b Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Mon, 14 Jan 2013 21:45:54 -0800 Subject: [PATCH] More debugging. --- src/cpp/ripple/CallRPC.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/cpp/ripple/CallRPC.cpp b/src/cpp/ripple/CallRPC.cpp index 17fe7cad2..2cf58d8dd 100644 --- a/src/cpp/ripple/CallRPC.cpp +++ b/src/cpp/ripple/CallRPC.cpp @@ -659,7 +659,12 @@ Json::Value callRPC(const std::string& strIp, const int iPort, const std::string { // Connect to localhost if (!theConfig.QUIET) + { std::cerr << "Connecting to: " << strIp << ":" << iPort << std::endl; + std::cerr << "Username: " << strUsername << ":" << strPassword << std::endl; + std::cerr << "Path: " << strPassword << std::endl; + std::cerr << "Method: " << strMethod << std::endl; + } boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::address::from_string(strIp), iPort); @@ -668,18 +673,21 @@ Json::Value callRPC(const std::string& strIp, const int iPort, const std::string if (stream.fail()) throw std::runtime_error("couldn't connect to server"); +cLog(lsDEBUG) << "connected" << std::endl; // HTTP basic authentication std::string strUserPass64 = EncodeBase64(strUsername + ":" + strPassword); std::map mapRequestHeaders; mapRequestHeaders["Authorization"] = std::string("Basic ") + strUserPass64; +cLog(lsDEBUG) << "requesting" << std::endl; // Send request std::string strRequest = JSONRPCRequest(strMethod, params, Json::Value(1)); - cLog(lsDEBUG) << "send request " << strMethod << " : " << strRequest << std::endl; +cLog(lsDEBUG) << "send request " << strMethod << " : " << strRequest << std::endl; + std::string strPost = createHTTPPost(strPath, strRequest, mapRequestHeaders); stream << strPost << std::flush; - // std::cerr << "post " << strPost << std::endl; +std::cerr << "post " << strPost << std::endl; // Receive reply std::map mapHeaders;