summaryrefslogtreecommitdiff
path: root/src/HttpServer.cc
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2012-04-06 10:33:22 -0700
committerPixel <pixel@nobis-crew.org>2012-04-06 10:33:22 -0700
commitd73c68540dcbec2e4c997b940144d9246828439c (patch)
treed3392faac055daca07de789092599c1f820f20b3 /src/HttpServer.cc
parent8755eda4db1e738453d751ef20e24beec27d1820 (diff)
Stopping the http server now will wait for the listener to stop properly.
Diffstat (limited to 'src/HttpServer.cc')
-rw-r--r--src/HttpServer.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/HttpServer.cc b/src/HttpServer.cc
index 9fc48c5..44c794e 100644
--- a/src/HttpServer.cc
+++ b/src/HttpServer.cc
@@ -600,8 +600,14 @@ void Balau::HttpServer::start() {
void Balau::HttpServer::stop() {
AAssert(m_started, "Don't stop an HttpServer that hasn't been started");
- reinterpret_cast<HttpListener *>(m_listenerPtr)->stop();
+ HttpListener * listener = reinterpret_cast<HttpListener *>(m_listenerPtr);
+ Events::TaskEvent event(listener);
+ Task::prepare(&event);
+ listener->stop();
m_started = false;
+ Task::yield(&event);
+ IAssert(event.gotSignal(), "HttpServer::stop didn't actually get the listener to stop");
+ event.ack();
}
void Balau::HttpServer::registerAction(Action * action) {