From e57c35f00e5eba0ee5199997238cf3179a89c4d2 Mon Sep 17 00:00:00 2001 From: Pixel Date: Mon, 12 Nov 2001 19:49:16 +0000 Subject: Plop --- lib/ReadJob.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/ReadJob.cc') diff --git a/lib/ReadJob.cc b/lib/ReadJob.cc index 3bab150..a63eeca 100644 --- a/lib/ReadJob.cc +++ b/lib/ReadJob.cc @@ -13,23 +13,27 @@ int ReadJob::Do() { while (!s->IsClosed()) { if (!current) { + r = 0; try { cerr << "Trying to read...\n"; *s >> buff; } catch (IOAgain e) { cerr << "Suspending ReadJob to wait for reading...\n"; - Suspend(); + r = 1; } + if (r) Suspend(); cerr << "Read some bytes...\n"; } + r = 0; try { *d << buff << endnl; } catch (IOAgain e) { cerr << "Suspending ReadJob to wait for writing...\n"; - Suspend(); + r = 1; } + if (r) Suspend(); cerr << "Wrote some bytes...\n"; if (buff == "") return TASK_DONE; } -- cgit v1.2.3