diff options
Diffstat (limited to 'lib/HttpServ.cc')
-rw-r--r-- | lib/HttpServ.cc | 15 |
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); |