]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Bug 706: FaxClient doesn't handle 1yz Preliminary results when connecting
authorAidan Van Dyk <aidan@ifax.com>
Tue, 8 Nov 2005 15:40:06 +0000 (15:40 +0000)
committerAidan Van Dyk <aidan@ifax.com>
Tue, 8 Nov 2005 15:40:06 +0000 (15:40 +0000)
    Handle some PRELIM replies.  RFC959 states only 1 PRELIM (1yz) is allowed
    but we are liberaly in what we accept.

util/FaxClient.c++

index 67f821edb0aab5e79129af397c80d1ef188ecd83..315c9d73e95d846cc7aa2739a8f4b3f9d0bc4406 100644 (file)
@@ -321,7 +321,12 @@ FaxClient::callServer(fxStr& emsg)
         * Transport code is expected to call back through
         * setCtrlFds so fdIn should be properly setup...
         */
-       return (fdIn != NULL && getReply(false) == COMPLETE);
+       if (fdIn == NULL)
+           return (false);
+       int rep = PRELIM;
+       for (int i = 0; rep == PRELIM && i < 100; i++)
+           rep = getReply(false);
+       return (rep == COMPLETE);
     } else
        return (false);
 }