Master Core  v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
rpcprotocol.cpp File Reference
#include "rpcprotocol.h"
#include "util.h"
#include <stdint.h>
#include <boost/algorithm/string.hpp>
#include <boost/asio.hpp>
#include <boost/asio/ssl.hpp>
#include <boost/bind.hpp>
#include <boost/filesystem.hpp>
#include <boost/foreach.hpp>
#include <boost/iostreams/concepts.hpp>
#include <boost/iostreams/stream.hpp>
#include <boost/shared_ptr.hpp>
#include "json/json_spirit_writer_template.h"
+ Include dependency graph for rpcprotocol.cpp:

Go to the source code of this file.

Functions

string HTTPPost (const string &strMsg, const map< string, string > &mapRequestHeaders)
 
static string rfc1123Time ()
 
string HTTPReply (int nStatus, const string &strMsg, bool keepalive)
 
bool ReadHTTPRequestLine (std::basic_istream< char > &stream, int &proto, string &http_method, string &http_uri)
 
int ReadHTTPStatus (std::basic_istream< char > &stream, int &proto)
 
int ReadHTTPHeaders (std::basic_istream< char > &stream, map< string, string > &mapHeadersRet)
 
int ReadHTTPMessage (std::basic_istream< char > &stream, map< string, string > &mapHeadersRet, string &strMessageRet, int nProto)
 
string JSONRPCRequest (const string &strMethod, const Array &params, const Value &id)
 
Object JSONRPCReplyObj (const Value &result, const Value &error, const Value &id)
 
string JSONRPCReply (const Value &result, const Value &error, const Value &id)
 
Object JSONRPCError (int code, const string &message)
 

Function Documentation

string HTTPPost ( const string &  strMsg,
const map< string, string > &  mapRequestHeaders 
)

Definition at line 35 of file rpcprotocol.cpp.

References FormatFullVersion(), and PAIRTYPE.

Referenced by CallRPC().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string HTTPReply ( int  nStatus,
const string &  strMsg,
bool  keepalive 
)

Definition at line 57 of file rpcprotocol.cpp.

References FormatFullVersion(), HTTP_BAD_REQUEST, HTTP_FORBIDDEN, HTTP_INTERNAL_SERVER_ERROR, HTTP_NOT_FOUND, HTTP_OK, HTTP_UNAUTHORIZED, rfc1123Time(), and strprintf.

Referenced by ErrorReply(), RPCAcceptHandler(), and ServiceConnection().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Object JSONRPCError ( int  code,
const string &  message 
)

Definition at line 247 of file rpcprotocol.cpp.

References error().

Referenced by AccountFromValue(), addnode(), AmountFromValue(), backupwallet(), check_prop_valid(), createrawtransaction(), decoderawtransaction(), dumpprivkey(), dumpwallet(), encryptwallet(), EnsureWalletIsUnlocked(), CRPCTable::execute(), getaccount(), GetAccountAddress(), getactivecrowdsales_MP(), getaddednodeinfo(), getallbalancesforaddress_MP(), getallbalancesforid_MP(), getbalance_MP(), getblock(), getblocktemplate(), getcrowdsale_MP(), getgrants_MP(), getinfo_MP(), getnewaddress(), getproperty_MP(), getrawchangeaddress(), getrawtransaction(), getreceivedbyaddress(), getsto_MP(), gettrade_MP(), gettransaction(), gettransaction_MP(), importprivkey(), importwallet(), JSONRPCExecOne(), keypoolrefill(), listblocktransactions_MP(), listsinceblock(), listtransactions(), listtransactions_MP(), lockunspent(), movecmd(), JSONRequest::parse(), ParseHashV(), ParseHexV(), RPCTypeCheck(), send_MP(), sendfrom(), sendmany(), sendrawtransaction(), sendrawtx_MP(), sendtoaddress(), sendtoowners_MP(), ServiceConnection(), setaccount(), signmessage(), signrawtransaction(), submitblock(), verifymessage(), walletlock(), walletpassphrase(), and walletpassphrasechange().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string JSONRPCReply ( const Value &  result,
const Value &  error,
const Value &  id 
)

Definition at line 241 of file rpcprotocol.cpp.

References JSONRPCReplyObj().

Referenced by ErrorReply(), and ServiceConnection().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Object JSONRPCReplyObj ( const Value &  result,
const Value &  error,
const Value &  id 
)

Definition at line 229 of file rpcprotocol.cpp.

Referenced by JSONRPCExecOne(), and JSONRPCReply().

+ Here is the caller graph for this function:

string JSONRPCRequest ( const string &  strMethod,
const Array &  params,
const Value &  id 
)

Definition at line 220 of file rpcprotocol.cpp.

Referenced by CallRPC().

+ Here is the caller graph for this function:

int ReadHTTPHeaders ( std::basic_istream< char > &  stream,
map< string, string > &  mapHeadersRet 
)

Definition at line 151 of file rpcprotocol.cpp.

References atoi().

Referenced by ReadHTTPMessage().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int ReadHTTPMessage ( std::basic_istream< char > &  stream,
map< string, string > &  mapHeadersRet,
string &  strMessageRet,
int  nProto 
)

Definition at line 177 of file rpcprotocol.cpp.

References HTTP_INTERNAL_SERVER_ERROR, HTTP_OK, MAX_SIZE, and ReadHTTPHeaders().

Referenced by CallRPC(), and ServiceConnection().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ReadHTTPRequestLine ( std::basic_istream< char > &  stream,
int proto,
string &  http_method,
string &  http_uri 
)

Definition at line 101 of file rpcprotocol.cpp.

References atoi().

Referenced by ServiceConnection().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int ReadHTTPStatus ( std::basic_istream< char > &  stream,
int proto 
)

Definition at line 136 of file rpcprotocol.cpp.

References atoi(), and HTTP_INTERNAL_SERVER_ERROR.

Referenced by CallRPC().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static string rfc1123Time ( )
static

Definition at line 52 of file rpcprotocol.cpp.

References DateTimeStrFormat(), and GetTime().

Referenced by HTTPReply().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: