mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-23 12:35:50 +00:00
More debugging.
This commit is contained in:
@@ -659,7 +659,12 @@ Json::Value callRPC(const std::string& strIp, const int iPort, const std::string
|
|||||||
{
|
{
|
||||||
// Connect to localhost
|
// Connect to localhost
|
||||||
if (!theConfig.QUIET)
|
if (!theConfig.QUIET)
|
||||||
|
{
|
||||||
std::cerr << "Connecting to: " << strIp << ":" << iPort << std::endl;
|
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
|
boost::asio::ip::tcp::endpoint
|
||||||
endpoint(boost::asio::ip::address::from_string(strIp), iPort);
|
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())
|
if (stream.fail())
|
||||||
throw std::runtime_error("couldn't connect to server");
|
throw std::runtime_error("couldn't connect to server");
|
||||||
|
|
||||||
|
cLog(lsDEBUG) << "connected" << std::endl;
|
||||||
// HTTP basic authentication
|
// HTTP basic authentication
|
||||||
std::string strUserPass64 = EncodeBase64(strUsername + ":" + strPassword);
|
std::string strUserPass64 = EncodeBase64(strUsername + ":" + strPassword);
|
||||||
std::map<std::string, std::string> mapRequestHeaders;
|
std::map<std::string, std::string> mapRequestHeaders;
|
||||||
mapRequestHeaders["Authorization"] = std::string("Basic ") + strUserPass64;
|
mapRequestHeaders["Authorization"] = std::string("Basic ") + strUserPass64;
|
||||||
|
|
||||||
|
cLog(lsDEBUG) << "requesting" << std::endl;
|
||||||
// Send request
|
// Send request
|
||||||
std::string strRequest = JSONRPCRequest(strMethod, params, Json::Value(1));
|
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);
|
std::string strPost = createHTTPPost(strPath, strRequest, mapRequestHeaders);
|
||||||
stream << strPost << std::flush;
|
stream << strPost << std::flush;
|
||||||
|
|
||||||
// std::cerr << "post " << strPost << std::endl;
|
std::cerr << "post " << strPost << std::endl;
|
||||||
|
|
||||||
// Receive reply
|
// Receive reply
|
||||||
std::map<std::string, std::string> mapHeaders;
|
std::map<std::string, std::string> mapHeaders;
|
||||||
|
|||||||
Reference in New Issue
Block a user