summaryrefslogtreecommitdiff
path: root/lib/ReadJob.cc
diff options
context:
space:
mode:
authorPixel <Pixel>2001-11-12 19:49:16 +0000
committerPixel <Pixel>2001-11-12 19:49:16 +0000
commite57c35f00e5eba0ee5199997238cf3179a89c4d2 (patch)
tree6e734a152ec360c42b72e01948eb3e444a77f8bb /lib/ReadJob.cc
parent709543dec3eaa07f7d2d7da2157d1f9159bad5d8 (diff)
Plop
Diffstat (limited to 'lib/ReadJob.cc')
-rw-r--r--lib/ReadJob.cc8
1 files changed, 6 insertions, 2 deletions
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;
}