summaryrefslogtreecommitdiff
path: root/lib/HttpServ.cc
diff options
context:
space:
mode:
authorPixel <Pixel>2002-06-04 13:42:36 +0000
committerPixel <Pixel>2002-06-04 13:42:36 +0000
commit6cc9c2c329b00c51f399e5b040a4d4a1d1213ecd (patch)
tree43cdef5700f65c9f90165590ef582988bb02ed98 /lib/HttpServ.cc
parent6be21a3b278d3bb3f8ac4176f923d42dfb9b1e12 (diff)
gcc-3.1
Diffstat (limited to 'lib/HttpServ.cc')
-rw-r--r--lib/HttpServ.cc44
1 files changed, 22 insertions, 22 deletions
diff --git a/lib/HttpServ.cc b/lib/HttpServ.cc
index 8824bcc..f649a78 100644
--- a/lib/HttpServ.cc
+++ b/lib/HttpServ.cc
@@ -60,7 +60,7 @@ int ProcessRequest::Do() throw(GeneralException) {
bad = false;
-// cerr << "---- Got a request from handle " << s.GetHandle() << " \n";
+// std::cerr << "---- Got a request from handle " << s.GetHandle() << " \n";
post = ParseUri(file, domain, gvars, &b);
@@ -71,9 +71,9 @@ int ProcessRequest::Do() throw(GeneralException) {
do {
int p;
b >> t;
-// cerr << "Read Request (n): " << t << endl;
+// std::cerr << "Read Request (n): " << t << std::endl;
if ((t.strstr("Content-Length: ") == 0) || (t.strstr("Content-length: ") == 0)) {
-// cerr << "Saw 'Content-Lenght:', reading length from '" << t.extract(16) << "'\n";
+// std::cerr << "Saw 'Content-Lenght:', reading length from '" << t.extract(16) << "'\n";
len = t.extract(16).to_int();
}
if (t.strstr("Host: ") == 0) {
@@ -88,7 +88,7 @@ int ProcessRequest::Do() throw(GeneralException) {
}
} while (t.strlen());
-// cerr << "---- Processing it.\n";
+// std::cerr << "---- Processing it.\n";
hasvars = false;
@@ -96,10 +96,10 @@ int ProcessRequest::Do() throw(GeneralException) {
// On a pas eu de ligne 'Content-Length' mais on a eu une méthode POST.
// Cela est une erreur.
if (len == -1) {
-// cerr << "Error: method POST but no Content-Length\n";
+// std::cerr << "Error: method POST but no Content-Length\n";
bad = true;
} else {
-// cerr << "Got a POST request. Parsing variables. (len = " << len << ")\n";
+// std::cerr << "Got a POST request. Parsing variables. (len = " << len << ")\n";
// Les variables seront initialisées ici.
hasvars = true;
}
@@ -125,7 +125,7 @@ int ProcessRequest::Do() throw(GeneralException) {
ParseVars(&b, len);
}
- cerr << " Domain = '" << domain << "' - File = '" << file << "'\n";
+ std::cerr << " Domain = '" << domain << "' - File = '" << file << "'\n";
if (!bad) {
// Nous vérifions le domaine.
@@ -136,7 +136,7 @@ int ProcessRequest::Do() throw(GeneralException) {
if (domain == "/bin") bad = false;
if (domain == "/") bad = false;
if (bad) {
- cerr << "Error: bad domain.\n";
+ std::cerr << "Error: bad domain.\n";
}
} else {
// L'url sans domaine ni fichier est valide. (cela arrive sur certains navigateurs...)
@@ -170,11 +170,11 @@ int ProcessRequest::Do() throw(GeneralException) {
SendHeads(&b, GetMime(file), String("Accept-Ranges: bytes") + endhl + "Content-Length: " + (unsigned long long int) i->GetSize() + endhl, i->GetModif());
i->SetNonBlock();
a = new CopyJob(i, &s);
- cerr << "File found, dumping.\n";
+ std::cerr << "File found, dumping.\n";
}
catch (IOGeneral e) {
ShowError(&b);
- cerr << "File not found, error showed.\n";
+ std::cerr << "File not found, error showed.\n";
}
}
}
@@ -183,7 +183,7 @@ int ProcessRequest::Do() throw(GeneralException) {
delete Vars;
delete Heads;
-// cerr << "---- Sending header buffer.\n";
+// std::cerr << "---- Sending header buffer.\n";
c = new CopyJob(&b, &s, -1, false);
WaitFor(c);
current = 3;
@@ -193,7 +193,7 @@ int ProcessRequest::Do() throw(GeneralException) {
delete c;
if (a) {
-// cerr << "---- Sending contents.\n";
+// std::cerr << "---- Sending contents.\n";
a->Restart();
WaitFor(a);
current = 4;
@@ -202,7 +202,7 @@ int ProcessRequest::Do() throw(GeneralException) {
case 4:
if (a) delete a;
-// cerr << "---- End of Request.\n";
+// std::cerr << "---- End of Request.\n";
}
return TASK_DONE;
}
@@ -218,7 +218,7 @@ void ProcessRequest::ParseVars(Handle * s, int len) {
s->read(&l, 1);
t += l;
}
-// cerr << "Post variables line: '" << t << "'\n";
+// std::cerr << "Post variables line: '" << t << "'\n";
// Les variables sont sous la forme 'var1=val1&var2=val2&val3=var3'. Donc le nombre d'occurences
@@ -254,7 +254,7 @@ void ProcessRequest::ParseVars(Handle * s, int len) {
v += t[pos++];
}
}
-// cerr << "Pushing HTTP variable: " << v << endl;
+// std::cerr << "Pushing HTTP variable: " << v << std::endl;
Vars->Add(v);
pos++;
}
@@ -274,7 +274,7 @@ bool ProcessRequest::ParseUri(String & file, String & domain, String & gvars, Ha
ssize_t sppos;
*s >> t;
- cerr << "Read Request (1): " << t << endl;
+ std::cerr << "Read Request (1): " << t << std::endl;
int IPos = t.strchr('?');
@@ -288,7 +288,7 @@ bool ProcessRequest::ParseUri(String & file, String & domain, String & gvars, Ha
free(sdup);
}
-// cerr << "New request: " << t << ", gvars = " << gvars << endl;
+// std::cerr << "New request: " << t << ", gvars = " << gvars << std::endl;
bad = false;
@@ -299,7 +299,7 @@ bool ProcessRequest::ParseUri(String & file, String & domain, String & gvars, Ha
p = t.to_charp(5);
post = true;
} else {
-// cerr << "Error: unknow request.\n";
+// std::cerr << "Error: unknow request.\n";
bad = true;
}
break;
@@ -307,12 +307,12 @@ bool ProcessRequest::ParseUri(String & file, String & domain, String & gvars, Ha
if (t.extract(1, 3) == "ET ") {
p = t.to_charp(4);
} else {
-// cerr << "Error: unknow request.\n";
+// std::cerr << "Error: unknow request.\n";
bad = true;
}
break;
default:
-// cerr << "Error: unknow request.\n";
+// std::cerr << "Error: unknow request.\n";
bad = true;
}
@@ -427,7 +427,7 @@ String ProcessRequest::GetMime(const String & f) {
HttpServ::HttpServ(Action * ap, int port, const String & nname) throw (GeneralException) : p(ap), name(nname), localport(port) {
bool r = true;
-// cerr << "Initialising Mini HTTP-Server on port " << localport << endl;
+// std::cerr << "Initialising Mini HTTP-Server on port " << localport << std::endl;
r = Listener.SetLocal("", port);
if (!r) {
@@ -443,7 +443,7 @@ HttpServ::HttpServ(Action * ap, int port, const String & nname) throw (GeneralEx
Listener.SetNonBlock();
WaitFor(&Listener, W4_STICKY | W4_READING);
-// cerr << "Mini HTTP-Server '" << name << "' ready and listening for port " << port << endl;
+// std::cerr << "Mini HTTP-Server '" << name << "' ready and listening for port " << port << std::endl;
}
HttpServ::~HttpServ(void) {