summaryrefslogtreecommitdiff
path: root/lib/HttpServ.cc
diff options
context:
space:
mode:
authorPixel <Pixel>2001-12-08 13:57:52 +0000
committerPixel <Pixel>2001-12-08 13:57:52 +0000
commita83a43e57be59ed407d98f465d02953af5ae0160 (patch)
tree91aa1ea4a24e5b85ef26686828054e858cec21aa /lib/HttpServ.cc
parentc54dfe9b844f6c5d8969669f5144e721e2af82b0 (diff)
*hum* some changes...
Diffstat (limited to 'lib/HttpServ.cc')
-rw-r--r--lib/HttpServ.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/HttpServ.cc b/lib/HttpServ.cc
index c20862a..d2c3c02 100644
--- a/lib/HttpServ.cc
+++ b/lib/HttpServ.cc
@@ -33,7 +33,7 @@ class ProcessRequest : public Task {
Socket s;
String name, host;
- Variables * Vars;
+ Variables * Vars, * Heads;
bool bad, hasvars, post;
};
@@ -63,9 +63,12 @@ int ProcessRequest::Do() {
// cerr << "---- Got a request from handle " << s.GetHandle() << " \n";
post = ParseUri(file, domain, &b);
+
+ Heads = new Variables();
len = -1;
do {
+ int p;
b >> t;
// cerr << "Read Request (n): " << t << endl;
if ((t.strstr("Content-Length: ") == 0) || (t.strstr("Content-length: ") == 0)) {
@@ -75,6 +78,13 @@ int ProcessRequest::Do() {
if (t.strstr("Host: ") == 0) {
host = t.extract(6);
}
+
+ if ((p = t.strchr(':')) >= 0) {
+ String s = t.extract(0, p - 1);
+ s += '=';
+ s += t.extract(p + 2);
+ Heads->Add(s);
+ }
} while (t.strlen());
// cerr << "---- Processing it.\n";
@@ -144,7 +154,7 @@ int ProcessRequest::Do() {
// Le domaine 'bin' est réservé aux actions. On cherche donc l'action à effectuer.
if ((f = p->Look4URL(file))) {
SendHeads(&b, "text/html");
- a = f->Do(Vars, &s);
+ a = f->Do(Vars, Heads, &s);
} else {
ShowError(&b);
}
@@ -169,6 +179,7 @@ int ProcessRequest::Do() {
if (a) a->Stop();
delete Vars;
+ delete Heads;
// cerr << "---- Sending header buffer.\n";
c = new CopyJob(&b, &s, -1, false);
WaitFor(c);