Revision: 7339
          http://mahogany.svn.sourceforge.net/mahogany/?rev=7339&view=rev
Author:   vadz
Date:     2007-08-25 12:34:44 -0700 (Sat, 25 Aug 2007)

Log Message:
-----------
don't give useless debug warnings for empty headers

Modified Paths:
--------------
    trunk/M/src/mail/HeaderIterator.cpp

Modified: trunk/M/src/mail/HeaderIterator.cpp
===================================================================
--- trunk/M/src/mail/HeaderIterator.cpp 2007-08-24 22:36:38 UTC (rev 7338)
+++ trunk/M/src/mail/HeaderIterator.cpp 2007-08-25 19:34:44 UTC (rev 7339)
@@ -106,7 +106,8 @@
                if ( m_str.empty() )
                {
                   // suspicious...
-                  wxLogDebug(_T("Empty header value?"));
+                  wxLogDebug(_T("Empty line in \"%s\" header value?"),
+                             name->c_str());
                }
 
                // this header may continue on the next line if it begins
@@ -145,21 +146,44 @@
             {
                *name = m_str;
 
-               if ( *++m_pcCurrent != ' ' )
+               switch ( *++m_pcCurrent )
                {
-                  // oops... skip back
-                  m_pcCurrent--;
+                  case '\r':
+                     if ( *++m_pcCurrent != '\n' )
+                     {
+                        wxLogDebug(_T("Bare '\\r' in header ignored"));
+                        m_pcCurrent -= 2; // skip back before '\r'
+                        break;
+                     }
 
-                  // although this is allowed by the RFC 822 (but not
-                  // 822bis), it is quite uncommon and so may indicate a
-                  // problem -- log it
-                  wxLogDebug(_T("Header without space after colon?"));
+                     m_pcCurrent++; // skip '\n' too
+
+                     // fall through
+
+                  case '\0':
+                     // empty header, uncommon but valid
+                     if ( value )
+                        value->clear();
+                     return true;
+
+                  case ' ':
+                     // this is the expected case, nothing to do
+                     break;
+
+                  default:
+                     // oops... skip back
+                     m_pcCurrent--;
+
+                     // although this is allowed by the RFC 822 (but not
+                     // 822bis), it is quite uncommon and so may indicate a
+                     // problem -- log it
+                     wxLogDebug(_T("Header without space after colon?"));
                }
 
+               inName = false;
+
                m_str.clear();
 
-               inName = false;
-
                break;
             }
             //else: fall through, this ':' is part of the header value


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to