From daf6897fe24e62ae8cf8e42b151ed565563332fe Mon Sep 17 00:00:00 2001 From: Nicolas Noble Date: Fri, 8 Aug 2014 13:34:23 -0700 Subject: Finalizing cares integration. --- includes/Handle.h | 2 +- includes/HttpServer.h | 2 ++ includes/Socket.h | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) (limited to 'includes') 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 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 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 & 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 -- cgit v1.2.3