diff options
author | Pixel <Pixel> | 2001-12-12 07:39:41 +0000 |
---|---|---|
committer | Pixel <Pixel> | 2001-12-12 07:39:41 +0000 |
commit | b9c5376bb1b0bf8e9bd0589e192220dfe0892bd5 (patch) | |
tree | bb799f34c2eff21b9577a72998fd3338d27fca0b /lib | |
parent | dfe6f0caffcf811e246c3950623c4a269901b384 (diff) |
Still working on it...
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CopyJob.cc | 3 | ||||
-rw-r--r-- | lib/HttpServ.cc | 20 |
2 files changed, 13 insertions, 10 deletions
diff --git a/lib/CopyJob.cc b/lib/CopyJob.cc index 1e151c3..877b113 100644 --- a/lib/CopyJob.cc +++ b/lib/CopyJob.cc @@ -26,6 +26,9 @@ int CopyJob::Do() throw (GeneralException) { tr = siz >= 0 ? siz - cursiz : COPY_BUFSIZ; try { r = s->read(buffer, MIN(COPY_BUFSIZ, tr)); + cerr << "CopyJob: read " << r << " bytes: " << endl; + buffer[r] = 0; + cerr << buffer << endl; } catch (IOAgain e) { WaitFor(s, W4_READING); diff --git a/lib/HttpServ.cc b/lib/HttpServ.cc index d2c3c02..1e37f94 100644 --- a/lib/HttpServ.cc +++ b/lib/HttpServ.cc @@ -60,7 +60,7 @@ int ProcessRequest::Do() { bad = false; -// cerr << "---- Got a request from handle " << s.GetHandle() << " \n"; + cerr << "---- Got a request from handle " << s.GetHandle() << " \n"; post = ParseUri(file, domain, &b); @@ -70,7 +70,7 @@ int ProcessRequest::Do() { do { int p; 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"; len = t.extract(16).to_int(); @@ -87,7 +87,7 @@ int ProcessRequest::Do() { } } while (t.strlen()); -// cerr << "---- Processing it.\n"; + cerr << "---- Processing it.\n"; hasvars = false; @@ -122,7 +122,7 @@ int ProcessRequest::Do() { ParseVars(&b, len); } -// cerr << " Domain = '" << domain << "' - File = '" << file << "'\n"; + cerr << " Domain = '" << domain << "' - File = '" << file << "'\n"; if (!bad) { // Nous vérifions le domaine. @@ -167,11 +167,11 @@ int ProcessRequest::Do() { 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"; + cerr << "File found, dumping.\n"; } catch (IOGeneral e) { ShowError(&b); -// cerr << "File not found, error showed.\n"; + cerr << "File not found, error showed.\n"; } } } @@ -180,7 +180,7 @@ int ProcessRequest::Do() { delete Vars; delete Heads; -// cerr << "---- Sending header buffer.\n"; + cerr << "---- Sending header buffer.\n"; c = new CopyJob(&b, &s, -1, false); WaitFor(c); current = 3; @@ -190,7 +190,7 @@ int ProcessRequest::Do() { delete c; if (a) { -// cerr << "---- Sending contents.\n"; + cerr << "---- Sending contents.\n"; a->Restart(); WaitFor(a); current = 4; @@ -199,7 +199,7 @@ int ProcessRequest::Do() { case 4: if (a) delete a; -// cerr << "---- End of Request.\n"; + cerr << "---- End of Request.\n"; } return TASK_DONE; } @@ -271,7 +271,7 @@ bool ProcessRequest::ParseUri(String & file, String & domain, Handle * s) { ssize_t sppos; *s >> t; -// cerr << "Read Request (1): " << t << endl; + cerr << "Read Request (1): " << t << endl; bad = false; |