]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
faxmail-lets loop forever patch - Michael Salzmann(salzmann@schlund.de)
authorRobert Colquhoun <rjc@trump.net.au>
Sat, 2 Jan 1999 05:47:26 +0000 (05:47 +0000)
committerRobert Colquhoun <rjc@trump.net.au>
Sat, 2 Jan 1999 05:47:26 +0000 (05:47 +0000)
Stops faxmail going into an infinite loop with some mime messages

...i am starting to get sick of this...im only a little over half way through
the patches too...might stop soon

faxmail/faxmail.c++

index afe868fa2ee9daac301cdcccc5ee90ce9e3194a9..4e070d16835f2a3feec9e7ccd08b70795724e10b 100644 (file)
@@ -448,7 +448,9 @@ void
 faxMailApp::formatMessage(FILE* fd, MIMEState& mime, MsgFmt& msg)
 {
     if (mime.getSubType() == "rfc822") {       // discard anything else
-       msg.parseHeaders(fd, mime.lineno);      // collect headers
+                                               // 980316 - mic: new MsgFmt 
+       MsgFmt bodyHdrs(msg);            
+       bodyHdrs.parseHeaders(fd, mime.lineno);
        /*
         * Calculate the amount of space required to format
         * the message headers and any required inter-message
@@ -462,11 +464,11 @@ faxMailApp::formatMessage(FILE* fd, MIMEState& mime, MsgFmt& msg)
             * XXX, hack.  Avoid inserting a digest divider when
             * the sub-part is a faxmail prologue or related part.
             */
-           const fxStr* s = msg.findHeader("Content-Type");
+           const fxStr* s = bodyHdrs.findHeader("Content-Type");
            if (!s || !strneq(*s, "application/x-faxmail", 21))
                divider = msgDivider;
        }
-       u_int nl = msg.headerCount()            // header lines
+       u_int nl = bodyHdrs.headerCount()       // header lines
            + (nl > 0)                          // blank line following header
            + (divider != NULL)                 // digest divider
            + 1;                                // 1st text line of message
@@ -477,10 +479,10 @@ faxMailApp::formatMessage(FILE* fd, MIMEState& mime, MsgFmt& msg)
            endLine();
        }
        if (nl > 0)
-           msg.formatHeaders(*this);           // emit formatted headers
+           bodyHdrs.formatHeaders(*this);      // emit formatted headers
 
        MIMEState subMime(mime);
-       formatMIME(fd, subMime, msg);           // format message body
+       formatMIME(fd, subMime, bodyHdrs);      // format message body
     } else {
        discardPart(fd, mime);
        formatDiscarded(mime);