summaryrefslogtreecommitdiff
path: root/includes/HttpServer.h
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2011-12-04 01:19:09 -0800
committerPixel <pixel@nobis-crew.org>2011-12-04 01:20:10 -0800
commitd440c3f50a918a932293ad98bcec96eaa4683222 (patch)
tree33e8e42a8e4506ae9da70cdb44dd133bde7f7219 /includes/HttpServer.h
parente5577eb7a643ce7885e5d14660a6d24254161622 (diff)
Reworked some things in the architecture, mainly exceptions and asserts.
-) Removed Assert() -) Added AAssert(), IAssert(), RAssert(), TAssert() and Failure() -) Reworked all asserts in the code, and added meaningful messages to them. -) Changed the way the startup code is generated; BALAU_STARTUP is no longer necessary.
Diffstat (limited to 'includes/HttpServer.h')
-rw-r--r--includes/HttpServer.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/includes/HttpServer.h b/includes/HttpServer.h
index 6c97799..9885d50 100644
--- a/includes/HttpServer.h
+++ b/includes/HttpServer.h
@@ -21,7 +21,7 @@ class HttpServer {
class Action {
public:
Action(const Regex & regex, const Regex & host = Regexes::any) : m_regex(regex), m_host(host), m_refCount(0) { }
- ~Action() { Assert(m_refCount == 0); }
+ ~Action() { AAssert(m_refCount == 0, "Don't delete an Action directl"); }
struct ActionMatch {
Regex::Captures uri, host;
};
@@ -39,8 +39,8 @@ class HttpServer {
~HttpServer() { if (!m_started) stop(); }
void start();
void stop();
- void setPort(int port) { Assert(!m_started); m_port = port; }
- void setLocal(const char * local) { Assert(!m_started); m_local = local; }
+ void setPort(int port) { AAssert(!m_started, "You can't set the HTTP port once the server has started"); m_port = port; }
+ void setLocal(const char * local) { AAssert(!m_started, "You can't set the HTTP IP once the server has started"); m_local = local; }
void registerAction(Action * action);
void flushAllActions();
struct ActionFound {