summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
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>