diff options
author | Pixel <Pixel> | 2001-11-29 00:02:20 +0000 |
---|---|---|
committer | Pixel <Pixel> | 2001-11-29 00:02:20 +0000 |
commit | 775011d8a082368e3a41808c1c03115b6b78921e (patch) | |
tree | 32294d4d3450177bdf27dcddcad8d2d603e106d3 /lib | |
parent | 0a7f6d0b5935f9794dda8935d37d4238bed3d611 (diff) |
More small changes...
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Exceptions.cc | 12 | ||||
-rw-r--r-- | lib/HttpServ.cc | 6 | ||||
-rw-r--r-- | lib/TaskMan.cc | 8 |
3 files changed, 19 insertions, 7 deletions
diff --git a/lib/Exceptions.cc b/lib/Exceptions.cc index 10b82a5..6d24646 100644 --- a/lib/Exceptions.cc +++ b/lib/Exceptions.cc @@ -125,3 +125,15 @@ int xpipe(int * p, int flag) throw (GeneralException) { return p[flag]; } + +pid_t xfork() throw (GeneralException) { + pid_t p; + + p = fork(); + + if (p == -1) { + throw GeneralException("Was not able to fork().\n"); + } + + return p; +} diff --git a/lib/HttpServ.cc b/lib/HttpServ.cc index 14e48e1..3f2e735 100644 --- a/lib/HttpServ.cc +++ b/lib/HttpServ.cc @@ -67,9 +67,9 @@ int ProcessRequest::Do() { len = -1; do { b >> t; - cerr << "Read Request (n): " << t << endl; + // cerr << "Read Request (n): " << t << endl; if ((t.strstr("Content-Length: ") == 0) || (t.strstr("Content-length: ") == 0)) { - cerr << "Saw 'Content-Lenght:', reading length from '" << t.extract(16) << "'\n"; + // cerr << "Saw 'Content-Lenght:', reading length from '" << t.extract(16) << "'\n"; len = t.extract(16).to_int(); } if (t.strstr("Host: ") == 0) { @@ -89,7 +89,7 @@ int ProcessRequest::Do() { bad = true; Vars = new Variables(); } else { - cerr << "Got a POST request. Parsing variables. (len = " << len << ")\n"; + // cerr << "Got a POST request. Parsing variables. (len = " << len << ")\n"; // Les variables seront initialisées ici. hasvars = true; } diff --git a/lib/TaskMan.cc b/lib/TaskMan.cc index cf411cc..60bcdf6 100644 --- a/lib/TaskMan.cc +++ b/lib/TaskMan.cc @@ -140,7 +140,7 @@ void TaskMan::MainLoop() throw (GeneralException) { throw GeneralException("TaskMan: No more task to manage."); } - cerr << "-=- TaskMan: begin main loop with " << number << " task to manage.\n"; +// cerr << "-=- TaskMan: begin main loop with " << number << " task to manage.\n"; no_burst = 0; while (!no_burst) { @@ -150,7 +150,7 @@ void TaskMan::MainLoop() throw (GeneralException) { Task * t = *p; if (t->GetState() == TASK_BURST) { - cerr << "-=- TaskMan: running burning task " << t->GetName() << endl; +// cerr << "-=- TaskMan: running burning task " << t->GetName() << endl; t->Run(); /* if the task added some new tasks, we have to rerun the loop */ no_burst = 0; @@ -267,7 +267,7 @@ void TaskMan::MainLoop() throw (GeneralException) { touched = false; if ((p->ha->GetHandle() == fd) && (!p->T->IsStopped()) && (p->T->GetState() != TASK_DONE) && (!p->dirthy)) { // We've got one, launch it. - cerr << "-=- TaskMan: launching task " << p->T->GetName() << " for handle " << p->ha->GetHandle() << endl; +// cerr << "-=- TaskMan: launching task " << p->T->GetName() << " for handle " << p->ha->GetHandle() << endl; w4ha_t w4 = *p; p->dirthy = true; @@ -313,7 +313,7 @@ void TaskMan::MainLoop() throw (GeneralException) { } if ((o = t->WaitedBy())) { - cerr << "-=- TaskMan: running task " << o->GetName() << " for task " << t->GetName() << endl; +// cerr << "-=- TaskMan: running task " << o->GetName() << " for task " << t->GetName() << endl; o->Run(); if (o->GetState() == TASK_DONE) { |