mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 19:15:54 +00:00
Comment out non-working code.
This commit is contained in:
@@ -4,10 +4,6 @@
|
|||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "BitcoinUtil.h"
|
#include "BitcoinUtil.h"
|
||||||
|
|
||||||
#include "json/json_spirit_utils.h"
|
|
||||||
#include "json/json_spirit_writer_template.h"
|
|
||||||
#include "json/json_spirit_reader_template.h"
|
|
||||||
|
|
||||||
#include <boost/asio.hpp>
|
#include <boost/asio.hpp>
|
||||||
#include <boost/iostreams/concepts.hpp>
|
#include <boost/iostreams/concepts.hpp>
|
||||||
#include <boost/iostreams/stream.hpp>
|
#include <boost/iostreams/stream.hpp>
|
||||||
@@ -54,7 +50,7 @@ string EncodeBase64(string s)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
int commandLineRPC(int argc, char *argv[])
|
int commandLineRPC(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
string strPrint;
|
string strPrint;
|
||||||
@@ -171,4 +167,5 @@ json_spirit::Object callRPC(const string& strMethod, const json_spirit::Array& p
|
|||||||
|
|
||||||
return reply;
|
return reply;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|||||||
3
RPC.h
3
RPC.h
@@ -1,4 +1,3 @@
|
|||||||
#include "json/json_spirit_value.h"
|
|
||||||
|
|
||||||
enum http_status_type
|
enum http_status_type
|
||||||
{
|
{
|
||||||
@@ -20,9 +19,11 @@ enum http_status_type
|
|||||||
service_unavailable = 503
|
service_unavailable = 503
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if 0
|
||||||
extern std::string JSONRPCRequest(const std::string& strMethod, const json_spirit::Array& params, const json_spirit::Value& id);
|
extern std::string JSONRPCRequest(const std::string& strMethod, const json_spirit::Array& params, const json_spirit::Value& id);
|
||||||
extern std::string createHTTPPost(const std::string& strMsg, const std::map<std::string,std::string>& mapRequestHeaders);
|
extern std::string createHTTPPost(const std::string& strMsg, const std::map<std::string,std::string>& mapRequestHeaders);
|
||||||
extern int ReadHTTP(std::basic_istream<char>& stream, std::map<std::string, std::string>& mapHeadersRet, std::string& strMessageRet);
|
extern int ReadHTTP(std::basic_istream<char>& stream, std::map<std::string, std::string>& mapHeadersRet, std::string& strMessageRet);
|
||||||
extern std::string HTTPReply(int nStatus, const std::string& strMsg);
|
extern std::string HTTPReply(int nStatus, const std::string& strMsg);
|
||||||
extern std::string JSONRPCReply(const json_spirit::Value& result, const json_spirit::Value& error, const json_spirit::Value& id);
|
extern std::string JSONRPCReply(const json_spirit::Value& result, const json_spirit::Value& error, const json_spirit::Value& id);
|
||||||
extern json_spirit::Object JSONRPCError(int code, const std::string& message);
|
extern json_spirit::Object JSONRPCError(int code, const std::string& message);
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -6,13 +6,10 @@
|
|||||||
//#include <boost/log/trivial.hpp>
|
//#include <boost/log/trivial.hpp>
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "json/json_spirit_reader_template.h"
|
|
||||||
#include "json/json_spirit_writer_template.h"
|
|
||||||
#include "RPC.h"
|
#include "RPC.h"
|
||||||
#include "Conversion.h"
|
#include "Conversion.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace json_spirit;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Just read from wire until the entire request is in.
|
Just read from wire until the entire request is in.
|
||||||
@@ -45,7 +42,7 @@ void RPCServer::handle_read(const boost::system::error_code& e,
|
|||||||
|
|
||||||
if(result)
|
if(result)
|
||||||
{
|
{
|
||||||
mReplyStr=handleRequest(mIncomingRequest.mBody);
|
// mReplyStr=handleRequest(mIncomingRequest.mBody);
|
||||||
sendReply();
|
sendReply();
|
||||||
}else if(!result)
|
}else if(!result)
|
||||||
{ // bad request
|
{ // bad request
|
||||||
@@ -65,6 +62,7 @@ void RPCServer::handle_read(const boost::system::error_code& e,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
std::string RPCServer::handleRequest(std::string& requestStr)
|
std::string RPCServer::handleRequest(std::string& requestStr)
|
||||||
{
|
{
|
||||||
cout << "handleRequest " << requestStr << endl;
|
cout << "handleRequest " << requestStr << endl;
|
||||||
@@ -139,6 +137,7 @@ Value RPCServer::doCommand(std::string& command, Array& params)
|
|||||||
|
|
||||||
return "unknown command";
|
return "unknown command";
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void RPCServer::sendReply()
|
void RPCServer::sendReply()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
#include <boost/enable_shared_from_this.hpp>
|
#include <boost/enable_shared_from_this.hpp>
|
||||||
#include <boost/asio.hpp>
|
#include <boost/asio.hpp>
|
||||||
#include "json/json_spirit_utils.h"
|
|
||||||
|
|
||||||
class RPCServer : public boost::enable_shared_from_this<RPCServer>
|
class RPCServer : public boost::enable_shared_from_this<RPCServer>
|
||||||
{
|
{
|
||||||
@@ -25,7 +24,7 @@ class RPCServer : public boost::enable_shared_from_this<RPCServer>
|
|||||||
std::string handleRequest(std::string& requestStr);
|
std::string handleRequest(std::string& requestStr);
|
||||||
void sendReply();
|
void sendReply();
|
||||||
|
|
||||||
json_spirit::Value doCommand(std::string& command,json_spirit::Array& params);
|
// json_spirit::Value doCommand(std::string& command,json_spirit::Array& params);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<RPCServer> pointer;
|
typedef boost::shared_ptr<RPCServer> pointer;
|
||||||
|
|||||||
@@ -96,9 +96,6 @@
|
|||||||
<ClCompile Include="database\sqlite3.c" />
|
<ClCompile Include="database\sqlite3.c" />
|
||||||
<ClCompile Include="database\SqliteDatabase.cpp" />
|
<ClCompile Include="database\SqliteDatabase.cpp" />
|
||||||
<ClCompile Include="DeterministicKeys.cpp" />
|
<ClCompile Include="DeterministicKeys.cpp" />
|
||||||
<ClCompile Include="json\json_spirit_reader.cpp" />
|
|
||||||
<ClCompile Include="json\json_spirit_value.cpp" />
|
|
||||||
<ClCompile Include="json\json_spirit_writer.cpp" />
|
|
||||||
<ClCompile Include="KnownNodeList.cpp" />
|
<ClCompile Include="KnownNodeList.cpp" />
|
||||||
<ClCompile Include="Ledger.cpp" />
|
<ClCompile Include="Ledger.cpp" />
|
||||||
<ClCompile Include="LedgerHistory.cpp" />
|
<ClCompile Include="LedgerHistory.cpp" />
|
||||||
@@ -148,15 +145,6 @@
|
|||||||
<ClInclude Include="database\SqliteDatabase.h" />
|
<ClInclude Include="database\SqliteDatabase.h" />
|
||||||
<ClInclude Include="HttpReply.h" />
|
<ClInclude Include="HttpReply.h" />
|
||||||
<ClInclude Include="HttpRequest.h" />
|
<ClInclude Include="HttpRequest.h" />
|
||||||
<ClInclude Include="json\json_spirit.h" />
|
|
||||||
<ClInclude Include="json\json_spirit_error_position.h" />
|
|
||||||
<ClInclude Include="json\json_spirit_reader.h" />
|
|
||||||
<ClInclude Include="json\json_spirit_reader_template.h" />
|
|
||||||
<ClInclude Include="json\json_spirit_stream_reader.h" />
|
|
||||||
<ClInclude Include="json\json_spirit_utils.h" />
|
|
||||||
<ClInclude Include="json\json_spirit_value.h" />
|
|
||||||
<ClInclude Include="json\json_spirit_writer.h" />
|
|
||||||
<ClInclude Include="json\json_spirit_writer_template.h" />
|
|
||||||
<ClInclude Include="key.h" />
|
<ClInclude Include="key.h" />
|
||||||
<ClInclude Include="KnownNodeList.h" />
|
<ClInclude Include="KnownNodeList.h" />
|
||||||
<ClInclude Include="Ledger.h" />
|
<ClInclude Include="Ledger.h" />
|
||||||
|
|||||||
10
rpc.cpp
10
rpc.cpp
@@ -8,22 +8,18 @@
|
|||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
#include <boost/foreach.hpp>
|
#include <boost/foreach.hpp>
|
||||||
|
|
||||||
#include "json/json_spirit_reader_template.h"
|
|
||||||
#include "json/json_spirit_writer_template.h"
|
|
||||||
#include "json/json_spirit_utils.h"
|
|
||||||
#include <openssl/buffer.h>
|
#include <openssl/buffer.h>
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace boost;
|
using namespace boost;
|
||||||
using namespace boost::asio;
|
using namespace boost::asio;
|
||||||
using namespace json_spirit;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
Object JSONRPCError(int code, const string& message)
|
Object JSONRPCError(int code, const string& message)
|
||||||
{
|
{
|
||||||
Object error;
|
Object error;
|
||||||
@@ -33,7 +29,6 @@ Object JSONRPCError(int code, const string& message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// HTTP protocol
|
// HTTP protocol
|
||||||
//
|
//
|
||||||
@@ -45,7 +40,7 @@ string createHTTPPost(const string& strMsg, const map<string,string>& mapRequest
|
|||||||
{
|
{
|
||||||
ostringstream s;
|
ostringstream s;
|
||||||
s << "POST / HTTP/1.1\r\n"
|
s << "POST / HTTP/1.1\r\n"
|
||||||
<< "User-Agent: bitcoin-json-rpc/" << FormatFullVersion() << "\r\n"
|
<< "User-Agent: coin-json-rpc/" << FormatFullVersion() << "\r\n"
|
||||||
<< "Host: 127.0.0.1\r\n"
|
<< "Host: 127.0.0.1\r\n"
|
||||||
<< "Content-Type: application/json\r\n"
|
<< "Content-Type: application/json\r\n"
|
||||||
<< "Content-Length: " << strMsg.size() << "\r\n"
|
<< "Content-Length: " << strMsg.size() << "\r\n"
|
||||||
@@ -278,3 +273,4 @@ void ConvertTo(Value& value)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user