summaryrefslogtreecommitdiff
path: root/lib/HttpServ.cc
diff options
context:
space:
mode:
authorPixel <Pixel>2001-11-14 16:59:02 +0000
committerPixel <Pixel>2001-11-14 16:59:02 +0000
commitaa92df3c58daefb994da555fb45f2e3ee55f38d5 (patch)
tree6105f0ced059af0fceb10a29f318d0c13c83d051 /lib/HttpServ.cc
parent9235fbc2a736da2c68eb2dc0a3c1007b4a202d5e (diff)
Latest and various changes
Diffstat (limited to 'lib/HttpServ.cc')
-rw-r--r--lib/HttpServ.cc19
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;