diff options
author | Pixel <Pixel> | 2001-11-14 16:59:02 +0000 |
---|---|---|
committer | Pixel <Pixel> | 2001-11-14 16:59:02 +0000 |
commit | aa92df3c58daefb994da555fb45f2e3ee55f38d5 (patch) | |
tree | 6105f0ced059af0fceb10a29f318d0c13c83d051 /lib/HttpServ.cc | |
parent | 9235fbc2a736da2c68eb2dc0a3c1007b4a202d5e (diff) |
Latest and various changes
Diffstat (limited to 'lib/HttpServ.cc')
-rw-r--r-- | lib/HttpServ.cc | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/HttpServ.cc b/lib/HttpServ.cc index 84078e0..3bec28f 100644 --- a/lib/HttpServ.cc +++ b/lib/HttpServ.cc @@ -7,9 +7,18 @@ String endhl = "\r\n", endnl = "\n"; -HttpServ::HttpServ(int port, const String & nname) : name(nname), localport(port) { - Listener.SetLocal("", port); - Listener.Listen(); +HttpServ::HttpServ(int port, const String & nname) throw (GeneralException) : name(nname), localport(port) { + bool r = true; + + r = Listener.SetLocal("", port); + if (r) { + r = Listener.Listen(); + } + + if (!r) { + throw GeneralException("Initialisation of the Mini HTTP-Server failed."); + } + cerr << "Mini HTTP-Server '" << name << "' ready and listening for port " << port << endl; } @@ -128,7 +137,7 @@ void HttpServ::ParseVars(Handle * s, int len) { s->read(&l, 1); t += l; } - cerr << "Post variables line: '" <<t << "'\n"; + cerr << "Post variables line: '" << t << "'\n"; // Les variables sont sous la forme 'var1=val1&var2=val2&val3=var3'. Donc le nombre d'occurences @@ -180,7 +189,7 @@ void HttpServ::ParseVars(Handle * s, int len) { bool HttpServ::ParseUri(String & file, String & domain, Handle * s) { String t, Uri; bool post = false; - char * p = NULL; + const char * p = NULL; ssize_t sppos; *s >> t; |