Enable asynchronous handling of HTTP-RPC (RIPD-390)

* Activate async code path
* Tidy up HTTP server code
* Use shared_ptr in HTTP server
* Remove check for unspecified IP
* Remove hairtrigger
* Fix missing HTTP authorization check
* Fix multisocket flags in RPC-HTTP server
* Fix authorization failure when no credentials required
* Addresses RIPD-159, RIPD-161, RIPD-390
This commit is contained in:
Vinnie Falco
2014-07-23 13:48:50 -07:00
parent 87351c8a0c
commit fa11071443
23 changed files with 889 additions and 849 deletions

View File

@@ -17,6 +17,8 @@
*/
//==============================================================================
#include <ripple/http/impl/ServerImpl.h>
namespace ripple {
namespace HTTP {
@@ -24,7 +26,7 @@ ServerImpl::ServerImpl (Server& server, Handler& handler, beast::Journal journal
: Thread ("HTTP::Server")
, m_server (server)
, m_handler (handler)
, m_journal (journal)
, journal_ (journal)
, m_strand (m_io_service)
, m_work (boost::in_place (std::ref (m_io_service)))
, m_stopped (true)
@@ -37,11 +39,6 @@ ServerImpl::~ServerImpl ()
stopThread ();
}
beast::Journal const& ServerImpl::journal() const
{
return m_journal;
}
Ports const& ServerImpl::getPorts () const
{
SharedState::ConstUnlockedAccess state (m_state);
@@ -129,7 +126,7 @@ int ServerImpl::compare (Port const& lhs, Port const& rhs)
{
if (lhs < rhs)
return -1;
else if (lhs > rhs)
else if (rhs < lhs)
return 1;
return 0;
}