]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Bug 507: fix timeout hang in nested while loop
authorLee Howard <faxguy@howardsilvan.com>
Sat, 30 Jul 2005 16:46:43 +0000 (16:46 +0000)
committerLee Howard <faxguy@howardsilvan.com>
Sat, 30 Jul 2005 16:46:43 +0000 (16:46 +0000)
CHANGES
faxd/ModemServer.c++

diff --git a/CHANGES b/CHANGES
index bbab69fe1e55438a7e119b06630b88c86b7c2082..eacbe85ad52ee34074ac6da521e4a0c2163b10e5 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,7 @@
 
 Changelog for HylaFAX 4.2.2
 
+* fix potential hang on reading data from modem (30 Jul 2005)
 * fix potential hang on detecting an ECM block end (29 Jul 2005)
 * fix job batches to properly release modems (26 Jul 2005)
 * fix build error with Mac OS X 10.4 (26 Jul 2005)
index 9a808070f9b113015eb9714669bb14f86057dd8b..d4d5a96c358c38a4ff99e73e24193e74793ffe06 100644 (file)
@@ -1386,7 +1386,7 @@ ModemServer::getModemLine(char rbuf[], u_int bufSize, long ms)
     u_int cc = 0;
     if (ms) startTimeout(ms);
     do {
-       while ((c = getModemChar(0)) != EOF && c != '\n')
+       while ((c = getModemChar(0)) != EOF && c != '\n' && !timer.wasTimeout())
            if (c != '\0' && c != '\r' && cc < bufSize)
                rbuf[cc++] = c;
     } while (!timer.wasTimeout() && cc == 0 && c != EOF);