summaryrefslogtreecommitdiff
path: root/lib/ReadJob.cc
diff options
context:
space:
mode:
authorPixel <Pixel>2001-11-25 23:50:14 +0000
committerPixel <Pixel>2001-11-25 23:50:14 +0000
commit9707409e4d15eadac9b3c752c3c6877788943a58 (patch)
tree58a8ef3851967415fd21674648f02c42e8eab4cd /lib/ReadJob.cc
parent8b6b771ca421f4f08f58debbf5459b020cf1bef7 (diff)
Wow, everything almost work!!! Amazing!!!
Diffstat (limited to 'lib/ReadJob.cc')
-rw-r--r--lib/ReadJob.cc11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/ReadJob.cc b/lib/ReadJob.cc
index f2749bb..6fab08b 100644
--- a/lib/ReadJob.cc
+++ b/lib/ReadJob.cc
@@ -2,8 +2,8 @@
#include "HttpServ.h"
ReadJob::ReadJob(Handle * as, Handle * ad) : s(as), d(ad) {
- WaitFor(s, W4_STICKY);
- WaitFor(d, W4_STICKY);
+ WaitFor(s, W4_STICKY | W4_READING);
+ WaitFor(d, W4_STICKY | W4_WRITING);
}
ReadJob::~ReadJob() { }
@@ -11,30 +11,23 @@ ReadJob::~ReadJob() { }
int ReadJob::Do() throw (GeneralException) {
String buff;
- cerr << "ReadJob running...\n";
-
switch (current) {
case 0:
try {
- cerr << "Trying to read...\n";
*s >> buff;
}
catch (IOAgain e) {
- cerr << "Suspending ReadJob to wait for reading...\n";
throw TaskSwitch();
}
- cerr << "Read some bytes...\n";
case 1:
try {
*d << buff << endnl;
}
catch (IOAgain e) {
- cerr << "Suspending ReadJob to wait for writing...\n";
current = 1;
throw TaskSwitch();
}
current = 0;
- cerr << "Wrote some bytes...\n";
if (buff == "") return TASK_DONE;
}