From 9707409e4d15eadac9b3c752c3c6877788943a58 Mon Sep 17 00:00:00 2001 From: Pixel Date: Sun, 25 Nov 2001 23:50:14 +0000 Subject: Wow, everything almost work!!! Amazing!!! --- lib/ReadJob.cc | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'lib/ReadJob.cc') 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; } -- cgit v1.2.3