From 99c5fae9dae76f260c641bc4411f38aad24f4ae1 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 8 May 2014 21:27:59 +0000 Subject: Make Service communicate via empty-line-delimited Dictionary objects instead of the old size prefix way. --- node/Service.hpp | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) (limited to 'node/Service.hpp') diff --git a/node/Service.hpp b/node/Service.hpp index 64ed108f..6d12cffc 100644 --- a/node/Service.hpp +++ b/node/Service.hpp @@ -34,12 +34,6 @@ #include "Constants.hpp" #include "Dictionary.hpp" #include "Thread.hpp" -#include "Mutex.hpp" - -/** - * Maximum size of a service message in bytes (sanity limit) - */ -#define ZT_SERVICE_MAX_MESSAGE_SIZE 131072 namespace ZeroTier { @@ -91,20 +85,12 @@ public: /** * @return Name of service */ - inline const char *name() const - throw() - { - return _name.c_str(); - } + inline const char *name() const throw() { return _name.c_str(); } /** * @return True if subprocess is running */ - inline bool running() const - throw() - { - return (_pid > 0); - } + inline bool running() const throw() { return (_pid > 0); } /** * Thread main method; do not call elsewhere @@ -114,15 +100,19 @@ public: private: const RuntimeEnvironment *_r; + Thread _thread; + std::string _path; std::string _name; void *_arg; void (*_handler)(void *,Service &,const Dictionary &); - long _pid; - int _childStdin; - int _childStdout; - int _childStderr; + volatile long _pid; + + volatile int _childStdin; + volatile int _childStdout; + volatile int _childStderr; + volatile bool _run; }; #endif // __WINDOWS__ -- cgit v1.2.3