summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/Exceptions.h4
-rw-r--r--lib/Exceptions.cc12
-rw-r--r--lib/HttpServ.cc6
-rw-r--r--lib/TaskMan.cc8
-rw-r--r--po/fr.po6
5 files changed, 26 insertions, 10 deletions
diff --git a/include/Exceptions.h b/include/Exceptions.h
index 71e2bac..9c87714 100644
--- a/include/Exceptions.h
+++ b/include/Exceptions.h
@@ -39,6 +39,7 @@ void * xmalloc(size_t) throw (GeneralException);
void xfree(void *&);
void * xrealloc(void *, size_t);
int xpipe(int *, int = 0) throw (GeneralException);
+pid_t xfork() throw (GeneralException);
// On prédéfinit la classe String, pour éviter
// les deadlocks de compilation...
@@ -76,6 +77,9 @@ class Base {
static int pipe(int * p, int flag = 0) {
return xpipe(p, flag);
}
+ static pid_t fork() {
+ return xfork();
+ }
};
class GeneralException : public Base {
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) {
diff --git a/po/fr.po b/po/fr.po
index 203c4d1..044066d 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: Baltisot 1.0.0\n"
-"POT-Creation-Date: 2001-11-28 13:46+0100\n"
+"POT-Creation-Date: 2001-11-29 00:59+0100\n"
"PO-Revision-Date: 2001-10-29 08:26GMT\n"
"Last-Translator: Nicolas Noble <nicolas@nobis-crew.org>\n"
"Language-Team: French <fr@li.org>\n"
@@ -20,8 +20,8 @@ msgid "Failed allocating %ld bytes."
msgstr "N'a pu allouer %ld octets."
#: lib/Exceptions.cc:43
-#, c-format
-msgid "An error has occured while %s %ld bytes from %s: %s"
+#, fuzzy, c-format
+msgid "An error has occured while %s %ld bytes on %s: %s"
msgstr "Une erreur est survenue en %s %ld octets depuis %s: %s"
#: lib/Exceptions.cc:43