summaryrefslogtreecommitdiff
path: root/node/Service.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2014-05-08 21:27:59 +0000
committerAdam Ierymenko <adam.ierymenko@gmail.com>2014-05-08 21:27:59 +0000
commit99c5fae9dae76f260c641bc4411f38aad24f4ae1 (patch)
treed12492f61e461dee998c0ce98a42ad2b6c74d3d5 /node/Service.hpp
parent98f0418fb9362f58485977150c22908135209d74 (diff)
downloadinfinitytier-99c5fae9dae76f260c641bc4411f38aad24f4ae1.tar.gz
infinitytier-99c5fae9dae76f260c641bc4411f38aad24f4ae1.zip
Make Service communicate via empty-line-delimited Dictionary objects instead of the old size prefix way.
Diffstat (limited to 'node/Service.hpp')
-rw-r--r--node/Service.hpp30
1 files changed, 10 insertions, 20 deletions
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__