summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorNicolas Noble <nnoble@blizzard.com>2014-08-08 13:34:23 -0700
committerNicolas Noble <nnoble@blizzard.com>2014-08-08 13:34:23 -0700
commitdaf6897fe24e62ae8cf8e42b151ed565563332fe (patch)
treed4f313b369e5b3b873f51c51525ed9816053aaea /includes
parentf67877e10216326b2230cd827d15aab0802d826d (diff)
Finalizing cares integration.
Diffstat (limited to 'includes')
-rw-r--r--includes/Handle.h2
-rw-r--r--includes/HttpServer.h2
-rw-r--r--includes/Socket.h2
3 files changed, 5 insertions, 1 deletions
diff --git a/includes/Handle.h b/includes/Handle.h
index 40e52e5..6a087a7 100644
--- a/includes/Handle.h
+++ b/includes/Handle.h
@@ -160,7 +160,7 @@ class HPrinter : public Handle {
class IOBase {
private:
IOBase() { }
- ~IOBase() { if (m_h) m_h->delRef(); }
+ ~IOBase() { if (m_h) m_h->delRef(); m_h = NULL; }
void setHandle(Handle * h) { m_h = h; if (m_h) m_h->addRef(); }
Handle * m_h = NULL;
template<class T>
diff --git a/includes/HttpServer.h b/includes/HttpServer.h
index 683390c..ac219e1 100644
--- a/includes/HttpServer.h
+++ b/includes/HttpServer.h
@@ -79,6 +79,7 @@ class HttpServer {
};
ActionFound findAction(const char * uri, const char * host);
String getServerName() { return "Balau/1.0"; }
+ bool started();
private:
bool m_started;
void * m_listenerPtr;
@@ -87,6 +88,7 @@ class HttpServer {
typedef std::list<Action *> ActionList;
ActionList m_actions;
RWLock m_actionsLock;
+ Events::TaskEvent m_listenerEvent;
friend class HttpWorker;
diff --git a/includes/Socket.h b/includes/Socket.h
index 0909763..b1e59cb 100644
--- a/includes/Socket.h
+++ b/includes/Socket.h
@@ -62,6 +62,7 @@ class ListenerBase : public StacklessTask {
virtual void Do();
void stop();
virtual const char * getName() const;
+ bool started() { return m_started; }
protected:
ListenerBase(int port, const char * local, void * opaque);
virtual void factory(IO<Socket> & io, void * opaque) = 0;
@@ -74,6 +75,7 @@ class ListenerBase : public StacklessTask {
String m_local;
int m_port = 0;
void * m_opaque = NULL;
+ bool m_started = false;
};
template<class Worker>