From 07447744c6b3455c1703471b249bda89dba333f5 Mon Sep 17 00:00:00 2001 From: Pixel Date: Fri, 21 Dec 2001 12:28:23 +0000 Subject: Handling bug in read!@#!@#!@# --- lib/Handle.cc | 8 ++++++-- lib/HttpServ.cc | 1 + 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++; } -- cgit v1.2.3