summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixel <Pixel>2001-12-21 12:28:23 +0000
committerPixel <Pixel>2001-12-21 12:28:23 +0000
commit07447744c6b3455c1703471b249bda89dba333f5 (patch)
tree59be10e6e9a7dcc9e2e5efb6d4300e355874dad1
parent0562cba38dddc4bbf33b727245f6efab20eb9dac (diff)
Handling bug in read!@#!@#!@#
-rw-r--r--lib/Handle.cc8
-rw-r--r--lib/HttpServ.cc1
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/Handle.cc b/lib/Handle.cc
index 010fce9..e98b2c7 100644
--- a/lib/Handle.cc
+++ b/lib/Handle.cc
@@ -46,6 +46,7 @@ ssize_t Handle::write(const void *buf, size_t count) throw (GeneralException) {
done = false;
full = true;
if (nonblock) {
+ cerr << "write: throwing IOAgain for handle " << GetName() << endl;
throw IOAgain();
} else {
sleep(1);
@@ -68,11 +69,14 @@ ssize_t Handle::read(void *buf, size_t count) throw (GeneralException) {
ssize_t r;
errno = 0;
- if ((r = uread(buf, count)) < 0) {
+ while ((r = uread(buf, count)) < 0) {
if ((!errno) || (errno == EAGAIN) || (errno == EINTR)) {
// Avant de déclarer une erreur, on vérifie si ce n'est pas un
// problème lié au fait qu'il n'y a plus d'octets.
- throw IOAgain();
+ if (nonblock) {
+ cerr << "read: throwing IOAgain for handle " << GetName() << endl;
+ throw IOAgain();
+ }
} else {
throw IOException(GetName(), IO_READ, count);
}
diff --git a/lib/HttpServ.cc b/lib/HttpServ.cc
index 3e75743..1dba18b 100644
--- a/lib/HttpServ.cc
+++ b/lib/HttpServ.cc
@@ -254,6 +254,7 @@ void ProcessRequest::ParseVars(Handle * s, int len) {
v += t[pos++];
}
}
+ cerr << "Pushing HTTP variable: " << v << endl;
Vars->Add(v);
pos++;
}