]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
[Bug 272] Patch from Vyacheslav Frolov <v.frolov@equant.ru> to remove
authorTim Rice <tim@multitalents.net>
Tue, 28 May 2002 03:27:22 +0000 (03:27 +0000)
committerTim Rice <tim@multitalents.net>
Tue, 28 May 2002 03:27:22 +0000 (03:27 +0000)
goto label so it will compile on SCO

faxd/faxGettyApp.c++

index f6d8e4926380ff8f123d502b3be1becc2b38d1ef..c90206fc98669fd64103b422a57cb67826913742 100644 (file)
@@ -218,26 +218,31 @@ faxGettyApp::listenForRing()
 
     CallerID cid;
     CallType ctype = ClassModem::CALLTYPE_UNKNOWN;
-again:
-    if (modemWaitForRings(1, ctype, cid)) {
-       if (cid.number != "" || cid.name != "") {
-           received_cid = cid; // CNID is only sent once.  Store it
-                               // for answering after later RINGs.
-           traceServer("ANSWER: CID NUMBER \"%s\" NAME \"%s\"",
-               (const char*) received_cid.number, (const char*) received_cid.name);
-           faxApp::sendModemStatus(getModemDeviceID(), "C\"%s\"%s\"",
-               (const char*) received_cid.number, (const char*) received_cid.name);
-       }
-       ++ringsHeard;
-       if (ringsBeforeAnswer && ringsHeard >= ringsBeforeAnswer)
-           answerPhone(ClassModem::ANSTYPE_ANY, ctype, received_cid);
-       else if (isModemInput())
-           goto again;
-       else
-           // NB: 10 second timeout should be plenty
-           Dispatcher::instance().startTimer(10, 0, &answerHandler);
-    } else
-       answerCleanup();
+    bool again;
+
+    do {
+        again = false;
+
+        if (modemWaitForRings(1, ctype, cid)) {
+           if (cid.number != "" || cid.name != "") {
+               received_cid = cid;     // CNID is only sent once.  Store it
+                                   // for answering after later RINGs.
+               traceServer("ANSWER: CID NUMBER \"%s\" NAME \"%s\"",
+                   (const char*) received_cid.number, (const char*) received_cid.name);
+               faxApp::sendModemStatus(getModemDeviceID(), "C\"%s\"%s\"",
+                   (const char*) received_cid.number, (const char*) received_cid.name);
+           }
+           ++ringsHeard;
+           if (ringsBeforeAnswer && ringsHeard >= ringsBeforeAnswer)
+               answerPhone(ClassModem::ANSTYPE_ANY, ctype, received_cid);
+           else if (isModemInput())
+               again = true;
+           else
+               // NB: 10 second timeout should be plenty
+               Dispatcher::instance().startTimer(10, 0, &answerHandler);
+        } else
+           answerCleanup();
+    } while (again);
 }
 
 /*