summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-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++;
}