diff --git a/Builds/VisualStudio2013/RippleD.vcxproj b/Builds/VisualStudio2013/RippleD.vcxproj
index e5d5b1ccc5..7e8561a80f 100644
--- a/Builds/VisualStudio2013/RippleD.vcxproj
+++ b/Builds/VisualStudio2013/RippleD.vcxproj
@@ -1864,10 +1864,12 @@
-
+
+
+
True
-
+
diff --git a/Builds/VisualStudio2013/RippleD.vcxproj.filters b/Builds/VisualStudio2013/RippleD.vcxproj.filters
index cf069d223d..832bb91b87 100644
--- a/Builds/VisualStudio2013/RippleD.vcxproj.filters
+++ b/Builds/VisualStudio2013/RippleD.vcxproj.filters
@@ -2769,10 +2769,13 @@
ripple\app\main
-
+
+ ripple\app\main
+
+
ripple\app\main
-
+
ripple\app\main
diff --git a/src/ripple/app/main/Application.cpp b/src/ripple/app/main/Application.cpp
index b60b953c4f..ccb9749ed2 100644
--- a/src/ripple/app/main/Application.cpp
+++ b/src/ripple/app/main/Application.cpp
@@ -174,7 +174,7 @@ public:
std::unique_ptr m_inboundLedgers;
std::unique_ptr m_networkOPs;
std::unique_ptr m_deprecatedUNL;
- std::unique_ptr m_rpcHTTPServer;
+ std::unique_ptr serverHandler_;
std::unique_ptr m_nodeStore;
std::unique_ptr m_sntpClient;
std::unique_ptr m_txQueue;
@@ -311,7 +311,7 @@ public:
// VFALCO NOTE LocalCredentials starts the deprecated UNL service
, m_deprecatedUNL (make_UniqueNodeList (*m_jobQueue))
- , m_rpcHTTPServer (make_RPCHTTPServer (*m_networkOPs,
+ , serverHandler_ (make_RPCHTTPServer (*m_networkOPs,
*m_jobQueue, *m_networkOPs, *m_resourceManager,
setup_RPC(getConfig()["rpc"])))
@@ -372,7 +372,7 @@ public:
m_nodeStoreScheduler.setJobQueue (*m_jobQueue);
add (m_ledgerMaster->getPropertySource ());
- add (*m_rpcHTTPServer);
+ add (*serverHandler_);
}
//--------------------------------------------------------------------------
@@ -806,7 +806,7 @@ public:
//----------------------------------------------------------------------
- m_rpcHTTPServer->setup (m_journal);
+ serverHandler_->setup (m_journal);
// Begin connecting to network.
if (!getConfig ().RUN_STANDALONE)
diff --git a/src/ripple/app/main/RPCHTTPServer.cpp b/src/ripple/app/main/RPCHTTPServer.cpp
deleted file mode 100644
index 7f810e99eb..0000000000
--- a/src/ripple/app/main/RPCHTTPServer.cpp
+++ /dev/null
@@ -1,304 +0,0 @@
-//------------------------------------------------------------------------------
-/*
- This file is part of rippled: https://github.com/ripple/rippled
- Copyright (c) 2012, 2013 Ripple Labs Inc.
-
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-*/
-//==============================================================================
-
-#include
-#include
-#include
-#include
-
-namespace ripple {
-
-class RPCHTTPServerImp
- : public RPCHTTPServer
- , public beast::LeakChecked
- , public HTTP::Handler
-{
-public:
- Resource::Manager& m_resourceManager;
- beast::Journal m_journal;
- JobQueue& m_jobQueue;
- NetworkOPs& m_networkOPs;
- HTTP::Server m_server;
- std::unique_ptr m_context;
- RPC::Setup setup_;
-
- RPCHTTPServerImp (Stoppable& parent, JobQueue& jobQueue,
- NetworkOPs& networkOPs, Resource::Manager& resourceManager,
- RPC::Setup const& setup)
- : RPCHTTPServer (parent)
- , m_resourceManager (resourceManager)
- , m_journal (deprecatedLogs().journal("HTTP-RPC"))
- , m_jobQueue (jobQueue)
- , m_networkOPs (networkOPs)
- , m_server (*this, deprecatedLogs().journal("HTTP"))
- , setup_ (setup)
- {
- if (setup_.secure)
- m_context.reset (RippleSSLContext::createAuthenticated (
- setup_.ssl_key, setup_.ssl_cert, setup_.ssl_chain));
- else
- m_context.reset (RippleSSLContext::createBare());
- }
-
- ~RPCHTTPServerImp()
- {
- m_server.stop();
- }
-
- void
- setup (beast::Journal journal) override
- {
- if (! setup_.ip.empty() && setup_.port != 0)
- {
- auto ep = beast::IP::Endpoint::from_string (setup_.ip);
-
- // VFALCO TODO IP address should not have an "unspecified" state
- //if (! is_unspecified (ep))
- {
- HTTP::Port port;
-
- if (setup_.secure == 0)
- port.security = HTTP::Port::Security::no_ssl;
- else if (setup_.secure == 1)
- port.security = HTTP::Port::Security::allow_ssl;
- else
- port.security = HTTP::Port::Security::require_ssl;
- port.addr = ep.at_port(0);
- if (setup_.port != 0)
- port.port = setup_.port;
- else
- port.port = ep.port();
- port.context = m_context.get ();
-
- HTTP::Ports ports;
- ports.push_back (port);
- m_server.setPorts (ports);
- }
- }
- else
- {
- journal.info << "RPC interface: disabled";
- }
- }
-
- //--------------------------------------------------------------------------
- //
- // Stoppable
- //
-
- void
- onStop() override
- {
- m_server.stopAsync();
- }
-
- void
- onChildrenStopped() override
- {
- }
-
- //--------------------------------------------------------------------------
- //
- // HTTP::Handler
- //
-
- void
- onAccept (HTTP::Session& session) override
- {
- // Reject non-loopback connections if RPC_ALLOW_REMOTE is not set
- if (! setup_.allow_remote &&
- ! beast::IP::is_loopback (session.remoteAddress()))
- {
- session.close (false);
- }
- }
-
- void
- onRequest (HTTP::Session& session) override
- {
- // Check user/password authorization
- auto const headers (build_map (session.message().headers));
- if (! HTTPAuthorized (headers))
- {
- session.write (HTTPReply (403, "Forbidden"));
- session.close (true);
- return;
- }
-
- session.detach();
-
- m_jobQueue.addJob (jtCLIENT, "RPC-Client", std::bind (
- &RPCHTTPServerImp::processSession, this, std::placeholders::_1,
- std::ref (session)));
- }
-
- void
- onClose (HTTP::Session& session,
- boost::system::error_code const&) override
- {
- }
-
- void
- onStopped (HTTP::Server&) override
- {
- stopped();
- }
-
- //--------------------------------------------------------------------------
-
- // Dispatched on the job queue
- void processSession (Job& job, HTTP::Session& session)
- {
- auto const s (to_string(session.message().body));
- session.write (processRequest (to_string(session.message().body),
- session.remoteAddress().at_port(0)));
-
- if (session.message().keep_alive())
- {
- session.complete();
- }
- else
- {
- session.close (true);
- }
- }
-
- std::string createResponse (
- int statusCode,
- std::string const& description)
- {
- return HTTPReply (statusCode, description);
- }
-
- // Stolen directly from RPCServerHandler
- std::string
- processRequest (std::string const& request,
- beast::IP::Endpoint const& remoteIPAddress)
- {
- Json::Value jvRequest;
- {
- Json::Reader reader;
-
- if ((request.size () > 1000000) ||
- ! reader.parse (request, jvRequest) ||
- jvRequest.isNull () ||
- ! jvRequest.isObject ())
- {
- return createResponse (400, "Unable to parse request");
- }
- }
-
- auto const role = getConfig ().getAdminRole (jvRequest, remoteIPAddress);
-
- Resource::Consumer usage;
-
- if (role == Config::ADMIN)
- usage = m_resourceManager.newAdminEndpoint (remoteIPAddress.to_string());
- else
- usage = m_resourceManager.newInboundEndpoint(remoteIPAddress);
-
- if (usage.disconnect ())
- return createResponse (503, "Server is overloaded");
-
- // Parse id now so errors from here on will have the id
- //
- // VFALCO NOTE Except that "id" isn't included in the following errors.
- //
- Json::Value const id = jvRequest ["id"];
-
- Json::Value const method = jvRequest ["method"];
-
- if (method.isNull ())
- return createResponse (400, "Null method");
-
- if (! method.isString ())
- return createResponse (400, "method is not string");
-
- std::string strMethod = method.asString ();
- if (strMethod.empty())
- return createResponse (400, "method is empty");
-
- // Parse params
- Json::Value params = jvRequest ["params"];
-
- if (params.isNull ())
- params = Json::Value (Json::arrayValue);
-
- else if (!params.isArray ())
- return HTTPReply (400, "params unparseable");
-
- // VFALCO TODO Shouldn't we handle this earlier?
- //
- if (role == Config::FORBID)
- {
- // VFALCO TODO Needs implementing
- // FIXME Needs implementing
- // XXX This needs rate limiting to prevent brute forcing password.
- return HTTPReply (403, "Forbidden");
- }
-
-
- std::string response;
- RPCHandler rpcHandler (m_networkOPs);
- Resource::Charge loadType = Resource::feeReferenceRPC;
-
- m_journal.debug << "Query: " << strMethod << params;
-
- Json::Value const result (rpcHandler.doRpcCommand (
- strMethod, params, role, loadType));
- m_journal.debug << "Reply: " << result;
-
- usage.charge (loadType);
-
- response = JSONRPCReply (result, Json::Value (), id);
-
- return createResponse (200, response);
- }
-
- //
- // PropertyStream
- //
-
- void
- onWrite (beast::PropertyStream::Map& map) override
- {
- m_server.onWrite (map);
- }
-};
-
-//------------------------------------------------------------------------------
-
-RPCHTTPServer::RPCHTTPServer (Stoppable& parent)
- : Stoppable ("RPCHTTPServer", parent)
- , Source ("http")
-{
-}
-
-//------------------------------------------------------------------------------
-
-std::unique_ptr
-make_RPCHTTPServer (beast::Stoppable& parent, JobQueue& jobQueue,
- NetworkOPs& networkOPs, Resource::Manager& resourceManager,
- RPC::Setup const& setup)
-{
- return std::make_unique (
- parent, jobQueue, networkOPs, resourceManager, setup);
-}
-
-}
diff --git a/src/ripple/app/main/RPCHTTPServer.h b/src/ripple/app/main/ServerHandler.h
similarity index 81%
rename from src/ripple/app/main/RPCHTTPServer.h
rename to src/ripple/app/main/ServerHandler.h
index 4e1a66f934..ef2abef0e4 100644
--- a/src/ripple/app/main/RPCHTTPServer.h
+++ b/src/ripple/app/main/ServerHandler.h
@@ -1,4 +1,4 @@
- //------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2012, 2013 Ripple Labs Inc.
@@ -17,8 +17,8 @@
*/
//==============================================================================
-#ifndef RIPPLE_APP_RPCHTTPSERVER_H_INCLUDED
-#define RIPPLE_APP_RPCHTTPSERVER_H_INCLUDED
+#ifndef RIPPLE_APP_MAIN_SERVERHANDLER_H_INCLUDED
+#define RIPPLE_APP_MAIN_SERVERHANDLER_H_INCLUDED
#include
#include
@@ -27,16 +27,16 @@
namespace ripple {
-class RPCHTTPServer
+class ServerHandler
: public beast::Stoppable
, public beast::PropertyStream::Source
{
protected:
- RPCHTTPServer (Stoppable& parent);
+ ServerHandler (Stoppable& parent);
public:
virtual
- ~RPCHTTPServer() = default;
+ ~ServerHandler() = default;
/** Opens listening ports based on the Config settings
This is implemented outside the constructor to support
@@ -47,8 +47,8 @@ public:
setup (beast::Journal journal) = 0;
};
-std::unique_ptr
-make_RPCHTTPServer (beast::Stoppable& parent, JobQueue& jobQueue,
+std::unique_ptr
+make_ServerHandler (beast::Stoppable& parent, JobQueue& jobQueue,
NetworkOPs& networkOPs, Resource::Manager& resourceManager,
RPC::Setup const& setup);
diff --git a/src/ripple/app/main/ServerHandlerImp.cpp b/src/ripple/app/main/ServerHandlerImp.cpp
new file mode 100644
index 0000000000..89a6f41914
--- /dev/null
+++ b/src/ripple/app/main/ServerHandlerImp.cpp
@@ -0,0 +1,274 @@
+//------------------------------------------------------------------------------
+/*
+ This file is part of rippled: https://github.com/ripple/rippled
+ Copyright (c) 2012, 2013 Ripple Labs Inc.
+
+ Permission to use, copy, modify, and/or distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+//==============================================================================
+
+#include
+
+namespace ripple {
+
+ServerHandler::ServerHandler (Stoppable& parent)
+ : Stoppable ("ServerHandler", parent)
+ , Source ("server")
+{
+}
+
+//------------------------------------------------------------------------------
+
+ServerHandlerImp::ServerHandlerImp (Stoppable& parent, JobQueue& jobQueue,
+ NetworkOPs& networkOPs, Resource::Manager& resourceManager,
+ RPC::Setup const& setup)
+ : ServerHandler (parent)
+ , m_resourceManager (resourceManager)
+ , m_journal (deprecatedLogs().journal("Server"))
+ , m_jobQueue (jobQueue)
+ , m_networkOPs (networkOPs)
+ , m_server (*this, deprecatedLogs().journal("Server"))
+ , setup_ (setup)
+{
+ if (setup_.secure)
+ m_context.reset (RippleSSLContext::createAuthenticated (
+ setup_.ssl_key, setup_.ssl_cert, setup_.ssl_chain));
+ else
+ m_context.reset (RippleSSLContext::createBare());
+}
+
+ServerHandlerImp::~ServerHandlerImp()
+{
+ m_server.stop();
+}
+
+void
+ServerHandlerImp::setup (beast::Journal journal)
+{
+ if (! setup_.ip.empty() && setup_.port != 0)
+ {
+ auto ep = beast::IP::Endpoint::from_string (setup_.ip);
+
+ // VFALCO TODO IP address should not have an "unspecified" state
+ //if (! is_unspecified (ep))
+ {
+ HTTP::Port port;
+
+ if (setup_.secure == 0)
+ port.security = HTTP::Port::Security::no_ssl;
+ else if (setup_.secure == 1)
+ port.security = HTTP::Port::Security::allow_ssl;
+ else
+ port.security = HTTP::Port::Security::require_ssl;
+ port.addr = ep.at_port(0);
+ if (setup_.port != 0)
+ port.port = setup_.port;
+ else
+ port.port = ep.port();
+ port.context = m_context.get ();
+
+ HTTP::Ports ports;
+ ports.push_back (port);
+ m_server.setPorts (ports);
+ }
+ }
+ else
+ {
+ journal.info << "RPC interface: disabled";
+ }
+}
+
+//--------------------------------------------------------------------------
+
+void
+ServerHandlerImp::onStop()
+{
+ m_server.stopAsync();
+}
+
+//--------------------------------------------------------------------------
+
+void
+ServerHandlerImp::onAccept (HTTP::Session& session)
+{
+ // Reject non-loopback connections if RPC_ALLOW_REMOTE is not set
+ if (! setup_.allow_remote &&
+ ! beast::IP::is_loopback (session.remoteAddress()))
+ {
+ session.close (false);
+ }
+}
+
+void
+ServerHandlerImp::onRequest (HTTP::Session& session)
+{
+ // Check user/password authorization
+ auto const headers (build_map (session.message().headers));
+ if (! HTTPAuthorized (headers))
+ {
+ session.write (HTTPReply (403, "Forbidden"));
+ session.close (true);
+ return;
+ }
+
+ session.detach();
+
+ m_jobQueue.addJob (jtCLIENT, "RPC-Client", std::bind (
+ &ServerHandlerImp::processSession, this, std::placeholders::_1,
+ std::ref (session)));
+}
+
+void
+ServerHandlerImp::onClose (HTTP::Session& session,
+ boost::system::error_code const&)
+{
+}
+
+void
+ServerHandlerImp::onStopped (HTTP::Server&)
+{
+ stopped();
+}
+
+//--------------------------------------------------------------------------
+
+// Dispatched on the job queue
+void
+ServerHandlerImp::processSession (Job& job, HTTP::Session& session)
+{
+ auto const s (to_string(session.message().body));
+ session.write (processRequest (to_string(session.message().body),
+ session.remoteAddress().at_port(0)));
+
+ if (session.message().keep_alive())
+ {
+ session.complete();
+ }
+ else
+ {
+ session.close (true);
+ }
+}
+
+std::string
+ServerHandlerImp::createResponse (
+ int statusCode,
+ std::string const& description)
+{
+ return HTTPReply (statusCode, description);
+}
+
+// VFALCO ARGH! returning a single std::string for the entire response?
+std::string
+ServerHandlerImp::processRequest (std::string const& request,
+ beast::IP::Endpoint const& remoteIPAddress)
+{
+ Json::Value jvRequest;
+ {
+ Json::Reader reader;
+ if ((request.size () > 1000000) ||
+ ! reader.parse (request, jvRequest) ||
+ jvRequest.isNull () ||
+ ! jvRequest.isObject ())
+ {
+ return createResponse (400, "Unable to parse request");
+ }
+ }
+
+ auto const role = getConfig ().getAdminRole (jvRequest, remoteIPAddress);
+
+ Resource::Consumer usage;
+
+ if (role == Config::ADMIN)
+ usage = m_resourceManager.newAdminEndpoint (remoteIPAddress.to_string());
+ else
+ usage = m_resourceManager.newInboundEndpoint(remoteIPAddress);
+
+ if (usage.disconnect ())
+ return createResponse (503, "Server is overloaded");
+
+ // Parse id now so errors from here on will have the id
+ //
+ // VFALCO NOTE Except that "id" isn't included in the following errors.
+ //
+ Json::Value const id = jvRequest ["id"];
+
+ Json::Value const method = jvRequest ["method"];
+
+ if (method.isNull ())
+ return createResponse (400, "Null method");
+
+ if (! method.isString ())
+ return createResponse (400, "method is not string");
+
+ std::string strMethod = method.asString ();
+ if (strMethod.empty())
+ return createResponse (400, "method is empty");
+
+ // Parse params
+ Json::Value params = jvRequest ["params"];
+
+ if (params.isNull ())
+ params = Json::Value (Json::arrayValue);
+
+ else if (!params.isArray ())
+ return HTTPReply (400, "params unparseable");
+
+ // VFALCO TODO Shouldn't we handle this earlier?
+ //
+ if (role == Config::FORBID)
+ {
+ // VFALCO TODO Needs implementing
+ // FIXME Needs implementing
+ // XXX This needs rate limiting to prevent brute forcing password.
+ return HTTPReply (403, "Forbidden");
+ }
+
+
+ std::string response;
+ RPCHandler rpcHandler (m_networkOPs);
+ Resource::Charge loadType = Resource::feeReferenceRPC;
+
+ m_journal.debug << "Query: " << strMethod << params;
+
+ Json::Value const result (rpcHandler.doRpcCommand (
+ strMethod, params, role, loadType));
+ m_journal.debug << "Reply: " << result;
+
+ usage.charge (loadType);
+
+ response = JSONRPCReply (result, Json::Value (), id);
+
+ return createResponse (200, response);
+}
+
+//------------------------------------------------------------------------------
+
+void
+ServerHandlerImp::onWrite (beast::PropertyStream::Map& map)
+{
+ m_server.onWrite (map);
+}
+
+//------------------------------------------------------------------------------
+
+std::unique_ptr
+make_RPCHTTPServer (beast::Stoppable& parent, JobQueue& jobQueue,
+ NetworkOPs& networkOPs, Resource::Manager& resourceManager,
+ RPC::Setup const& setup)
+{
+ return std::make_unique (
+ parent, jobQueue, networkOPs, resourceManager, setup);
+}
+
+}
diff --git a/src/ripple/app/main/ServerHandlerImp.h b/src/ripple/app/main/ServerHandlerImp.h
new file mode 100644
index 0000000000..b4a72f931f
--- /dev/null
+++ b/src/ripple/app/main/ServerHandlerImp.h
@@ -0,0 +1,109 @@
+//------------------------------------------------------------------------------
+/*
+ This file is part of rippled: https://github.com/ripple/rippled
+ Copyright (c) 2012, 2013 Ripple Labs Inc.
+
+ Permission to use, copy, modify, and/or distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+//==============================================================================
+
+#ifndef RIPPLE_APP_MAIN_SERVERHANDLERIMP_H_INCLUDED
+#define RIPPLE_APP_MAIN_SERVERHANDLERIMP_H_INCLUDED
+
+#include
+#include
+#include
+#include
+
+namespace ripple {
+
+// Private implementation
+class ServerHandlerImp
+ : public ServerHandler
+ , public beast::LeakChecked
+ , public HTTP::Handler
+{
+private:
+ Resource::Manager& m_resourceManager;
+ beast::Journal m_journal;
+ JobQueue& m_jobQueue;
+ NetworkOPs& m_networkOPs;
+ HTTP::Server m_server;
+ std::unique_ptr m_context;
+ RPC::Setup setup_;
+
+public:
+ ServerHandlerImp (Stoppable& parent, JobQueue& jobQueue,
+ NetworkOPs& networkOPs, Resource::Manager& resourceManager,
+ RPC::Setup const& setup);
+
+ ~ServerHandlerImp();
+
+private:
+ void
+ setup (beast::Journal journal) override;
+
+ //
+ // Stoppable
+ //
+
+ void
+ onStop() override;
+
+ //
+ // HTTP::Handler
+ //
+
+ void
+ onAccept (HTTP::Session& session) override;
+
+ void
+ onRequest (HTTP::Session& session) override;
+
+ void
+ onClose (HTTP::Session& session,
+ boost::system::error_code const&) override;
+
+ void
+ onStopped (HTTP::Server&) override;
+
+ //--------------------------------------------------------------------------
+
+ void
+ processSession (Job& job, HTTP::Session& session);
+
+ std::string
+ createResponse (int statusCode, std::string const& description);
+
+ std::string
+ processRequest (std::string const& request,
+ beast::IP::Endpoint const& remoteIPAddress);
+
+ //
+ // PropertyStream
+ //
+
+ void
+ onWrite (beast::PropertyStream::Map& map) override;
+};
+
+//------------------------------------------------------------------------------
+
+std::unique_ptr
+make_RPCHTTPServer (beast::Stoppable& parent, JobQueue& jobQueue,
+ NetworkOPs& networkOPs, Resource::Manager& resourceManager,
+ RPC::Setup const& setup);
+
+}
+
+#endif
diff --git a/src/ripple/rpc/impl/RPCHandler.cpp b/src/ripple/rpc/impl/RPCHandler.cpp
index 7aefae7903..bc724eaec7 100644
--- a/src/ripple/rpc/impl/RPCHandler.cpp
+++ b/src/ripple/rpc/impl/RPCHandler.cpp
@@ -18,7 +18,6 @@
//==============================================================================
#include
-#include
#include
#include
#include
diff --git a/src/ripple/unity/app.cpp b/src/ripple/unity/app.cpp
index bb7bfad52f..e56bcc58a9 100644
--- a/src/ripple/unity/app.cpp
+++ b/src/ripple/unity/app.cpp
@@ -29,7 +29,7 @@
#include
#include
#include
-#include
+#include
#include
#include
#include