More tie ins.

This commit is contained in:
JoelKatz
2012-11-19 15:41:45 -08:00
parent 08f271443d
commit 19d73bd477
4 changed files with 18 additions and 4 deletions

View File

@@ -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";
}
}

View File

@@ -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);
};

View File

@@ -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;

View File

@@ -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;