From aad4696a46f17c410dba7696a3caefd7ee1ea00b Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Sat, 17 Dec 2011 13:33:32 -0800 Subject: [PATCH] Comment out non-working code. --- CallRPC.cpp | 7 ++----- RPC.h | 5 +++-- RPCServer.cpp | 7 +++---- RPCServer.h | 3 +-- newcoin.vcxproj | 12 ------------ rpc.cpp | 10 +++------- 6 files changed, 12 insertions(+), 32 deletions(-) diff --git a/CallRPC.cpp b/CallRPC.cpp index 65876e45e7..cc72821757 100644 --- a/CallRPC.cpp +++ b/CallRPC.cpp @@ -4,10 +4,6 @@ #include "Config.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 #include #include @@ -54,7 +50,7 @@ string EncodeBase64(string s) return result; } - +#if 0 int commandLineRPC(int argc, char *argv[]) { string strPrint; @@ -171,4 +167,5 @@ json_spirit::Object callRPC(const string& strMethod, const json_spirit::Array& p return reply; } +#endif diff --git a/RPC.h b/RPC.h index e4f0a58bb3..3ef3d91888 100644 --- a/RPC.h +++ b/RPC.h @@ -1,4 +1,3 @@ -#include "json/json_spirit_value.h" enum http_status_type { @@ -20,9 +19,11 @@ enum http_status_type 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 createHTTPPost(const std::string& strMsg, const std::map& mapRequestHeaders); extern int ReadHTTP(std::basic_istream& stream, std::map& mapHeadersRet, std::string& strMessageRet); 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 json_spirit::Object JSONRPCError(int code, const std::string& message); \ No newline at end of file +extern json_spirit::Object JSONRPCError(int code, const std::string& message); +#endif diff --git a/RPCServer.cpp b/RPCServer.cpp index 77d2ac4cf2..d4a8c638f4 100644 --- a/RPCServer.cpp +++ b/RPCServer.cpp @@ -6,13 +6,10 @@ //#include #include "Application.h" #include -#include "json/json_spirit_reader_template.h" -#include "json/json_spirit_writer_template.h" #include "RPC.h" #include "Conversion.h" using namespace std; -using namespace json_spirit; /* 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) { - mReplyStr=handleRequest(mIncomingRequest.mBody); +// mReplyStr=handleRequest(mIncomingRequest.mBody); sendReply(); }else if(!result) { // 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) { cout << "handleRequest " << requestStr << endl; @@ -139,6 +137,7 @@ Value RPCServer::doCommand(std::string& command, Array& params) return "unknown command"; } +#endif void RPCServer::sendReply() { diff --git a/RPCServer.h b/RPCServer.h index 7f1d8b37f7..2ba57a2fc0 100644 --- a/RPCServer.h +++ b/RPCServer.h @@ -4,7 +4,6 @@ #include #include #include -#include "json/json_spirit_utils.h" class RPCServer : public boost::enable_shared_from_this { @@ -25,7 +24,7 @@ class RPCServer : public boost::enable_shared_from_this std::string handleRequest(std::string& requestStr); 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: typedef boost::shared_ptr pointer; diff --git a/newcoin.vcxproj b/newcoin.vcxproj index ed03f0ce12..7a0bae6b6a 100644 --- a/newcoin.vcxproj +++ b/newcoin.vcxproj @@ -96,9 +96,6 @@ - - - @@ -148,15 +145,6 @@ - - - - - - - - - diff --git a/rpc.cpp b/rpc.cpp index fdce30f1a9..ab8cb5fac1 100644 --- a/rpc.cpp +++ b/rpc.cpp @@ -8,22 +8,18 @@ #include #include -#include "json/json_spirit_reader_template.h" -#include "json/json_spirit_writer_template.h" -#include "json/json_spirit_utils.h" #include #include using namespace std; using namespace boost; using namespace boost::asio; -using namespace json_spirit; - +#if 0 Object JSONRPCError(int code, const string& message) { Object error; @@ -33,7 +29,6 @@ Object JSONRPCError(int code, const string& message) } - // // HTTP protocol // @@ -45,7 +40,7 @@ string createHTTPPost(const string& strMsg, const map& mapRequest { ostringstream s; 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" << "Content-Type: application/json\r\n" << "Content-Length: " << strMsg.size() << "\r\n" @@ -278,3 +273,4 @@ void ConvertTo(Value& value) +#endif