mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Dispatch all websocket commands to our pool. This should fix the deadlocks.
This commit is contained in:
@@ -21,10 +21,11 @@
|
||||
enum JobType
|
||||
{ // must be in priority order, low to high
|
||||
jtINVALID = -1,
|
||||
jtVALIDATION_ut = 0, // A validation from an untrusted source
|
||||
jtVALIDATION_ut = 1, // A validation from an untrusted source
|
||||
jtPROOFWORK = 2, // A proof of work demand from another server
|
||||
jtTRANSACTION = 3, // A transaction received from the network
|
||||
jtPROPOSAL_ut = 4, // A proposal from an untrusted source
|
||||
jtPROPOSAL_ut = 3, // A proposal from an untrusted source
|
||||
jtCLIENT = 4, // A websocket command from the client
|
||||
jtTRANSACTION = 5, // A transaction received from the network
|
||||
jtVALIDATION_t = 6, // A validation from a trusted source
|
||||
jtTRANSACTION_l = 7, // A local transaction
|
||||
jtPROPOSAL_t = 8, // A proposal from a trusted source
|
||||
@@ -32,7 +33,6 @@ enum JobType
|
||||
jtDEATH = 10, // job of death, used internally
|
||||
|
||||
// special types not dispatched by the job pool
|
||||
jtCLIENT = 16,
|
||||
jtPEER = 17,
|
||||
jtDISK = 18,
|
||||
jtRPC = 19,
|
||||
|
||||
@@ -99,7 +99,12 @@ public:
|
||||
|
||||
void on_message(connection_ptr cpClient, message_ptr mpMessage)
|
||||
{
|
||||
LoadEvent::pointer event = theApp->getJobQueue().getLoadEvent(jtCLIENT);
|
||||
theApp->getJobQueue().addJob(jtCLIENT,
|
||||
boost::bind(&WSServerHandler<endpoint_type>::do_message, this, _1, cpClient, mpMessage));
|
||||
}
|
||||
|
||||
void do_message(Job&, connection_ptr cpClient, message_ptr mpMessage)
|
||||
{
|
||||
Json::Value jvRequest;
|
||||
Json::Reader jrReader;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user