]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
[Bug 378] faxgetty loop due to modem error
authorDarren Nickerson <darren.nickerson@ifax.com>
Wed, 2 Apr 2003 04:27:32 +0000 (04:27 +0000)
committerDarren Nickerson <darren.nickerson@ifax.com>
Wed, 2 Apr 2003 04:27:32 +0000 (04:27 +0000)
A minor issue in Class 1 HDLC frame transmission can cause faxgetty to wait
forever in cases where an unexpected response (not OK or CONNECT) is seen
after transmitting MCF. Lee's fine patch (with tweaking by Patrice) fixes
this issue. Thanks Lee!

faxd/Class1.c++
faxd/ClassModem.c++
faxd/ClassModem.h

index 3cbce24335bd8beecd766f23dc9f4e2d30519bcb..3c089c964e41879a1f3529d412394efec0f460d2 100644 (file)
@@ -787,6 +787,7 @@ Class1Modem::waitFor(ATResponse wanted, long ms)
        case AT_RING:
            modemTrace("MODEM %s", ATresponses[response]);
            /* fall thru... */
+       case AT_OTHER:
        case AT_FCERROR:
            return (false);
        }
index d34ecdbcd4090e231ea355cce59238d68d93e469..3d900fbce6e6745b24d0581a058324da2cf8cae7 100644 (file)
@@ -61,7 +61,7 @@ const char* ClassModem::serviceNames[9] = {
     "",                                // 7
     "\"Voice\"",               // SERVICE_VOICE
 };
-const char* ClassModem::ATresponses[13] = {
+const char* ClassModem::ATresponses[14] = {
     "Nothing",                 // AT_NOTHING
     "OK",                      // AT_OK
     "Connection established",  // AT_CONNECT
@@ -74,6 +74,7 @@ const char* ClassModem::ATresponses[13] = {
     "Command error",           // AT_ERROR
     "<Empty line>",            // AT_EMPTYLINE
     "<Timeout>",               // AT_TIMEOUT
+    "<xonxoff>",               // AT_XONXOFF
     "<Unknown response>"       // AT_OTHER
 };
 const char* ClassModem::callTypes[5] = {
@@ -752,6 +753,10 @@ ClassModem::atResponse(char* buf, long ms)
            if (streq(buf, "RING"))             // NB: avoid match of RINGING
                lastResponse = AT_RING;
            break;
+       case '\020':
+           if (streq(buf, "\020\003"))         // DC1/DC3 (XON/XOFF)
+               lastResponse = AT_XONXOFF;
+           break;
        }
     }
     return lastResponse;
index b224713d21196c83c537f99c5070345d20bcc364..4d959ea993150e1d49bc4c37a899dd08a4c06a8c 100644 (file)
@@ -166,7 +166,8 @@ public:
        AT_ERROR        = 9,    // "ERROR" response
        AT_EMPTYLINE    = 10,   // empty line (0 characters received)
        AT_TIMEOUT      = 11,   // timeout waiting for response
-       AT_OTHER        = 12    // unknown response (not one of above)
+       AT_XONXOFF      = 12,   // xon/xoff characters
+       AT_OTHER        = 13    // unknown response (not one of above)
     };
 private:
     ModemServer& server;       // server for getting to device
@@ -190,7 +191,7 @@ protected:
 
     static const char* serviceNames[9];         // class 2 services
     static const char* callStatus[10];  // printable call status
-    static const char* ATresponses[13];
+    static const char* ATresponses[14];
 
     ClassModem(ModemServer&, const ModemConfig&);