mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
More tie ins.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#include "JobQueue.h"
|
||||
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/thread.hpp>
|
||||
@@ -21,6 +20,8 @@ const char* Job::toString(JobType t)
|
||||
case jtPROPOSAL_t: return "trustedProposal";
|
||||
case jtADMIN: return "administration";
|
||||
case jtDEATH: return "jobOfDeath";
|
||||
case jtCLIENT: return "clientCommand";
|
||||
case jtPEER: return "peerCommand";
|
||||
default: assert(false); return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,8 +31,12 @@ enum JobType
|
||||
jtPROPOSAL_t = 7, // A proposal from a trusted source
|
||||
jtADMIN = 8, // An administrative operation
|
||||
jtDEATH = 9, // job of death, used internally
|
||||
|
||||
// special types not dispatched by the job pool
|
||||
jtCLIENT = 10,
|
||||
jtPEER = 11,
|
||||
};
|
||||
#define NUM_JOB_TYPES 10
|
||||
#define NUM_JOB_TYPES 16
|
||||
|
||||
class Job
|
||||
{
|
||||
@@ -93,6 +97,9 @@ public:
|
||||
void shutdown();
|
||||
void setThreadCount(int c = 0);
|
||||
|
||||
LoadEvent::pointer getLoadEvent(JobType t)
|
||||
{ return boost::make_shared<LoadEvent>(boost::ref(mJobLoads[t]), true, 1); }
|
||||
|
||||
Json::Value getJson(int c = 0);
|
||||
};
|
||||
|
||||
|
||||
@@ -373,8 +373,11 @@ void Peer::processReadBuffer()
|
||||
|
||||
// std::cerr << "Peer::processReadBuffer: " << mIpPort.first << " " << mIpPort.second << std::endl;
|
||||
|
||||
// If connected and get a mtHELLO or if not connected and get a non-mtHELLO, wrong message was sent.
|
||||
LoadEvent::pointer event = theApp->getJobQueue().getLoadEvent(jtPEER);
|
||||
|
||||
boost::recursive_mutex::scoped_lock sl(theApp->getMasterLock());
|
||||
|
||||
// If connected and get a mtHELLO or if not connected and get a non-mtHELLO, wrong message was sent.
|
||||
if (mHelloed == (type == ripple::mtHELLO))
|
||||
{
|
||||
cLog(lsWARNING) << "Wrong message type: " << type;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef __WSHANDLER__
|
||||
#define __WSHANDLER__
|
||||
|
||||
#include "Application.h"
|
||||
|
||||
class WSConnection;
|
||||
|
||||
// A single instance of this object is made.
|
||||
@@ -87,6 +89,7 @@ public:
|
||||
|
||||
void on_message(connection_ptr cpClient, message_ptr mpMessage)
|
||||
{
|
||||
LoadEvent::pointer event = theApp->getJobQueue().getLoadEvent(jtCLIENT);
|
||||
Json::Value jvRequest;
|
||||
Json::Reader jrReader;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user