Revision: 7494
http://mahogany.svn.sourceforge.net/mahogany/?rev=7494&view=rev
Author: vadz
Date: 2008-07-26 18:15:23 +0000 (Sat, 26 Jul 2008)
Log Message:
-----------
make shorter base64-encoded words in EncodeHeader() as c-client inserts EOLs in
base64-encoded text every 60 characters and this is not allowed in headers
Modified Paths:
--------------
trunk/M/src/mail/MimeDecode.cpp
Modified: trunk/M/src/mail/MimeDecode.cpp
===================================================================
--- trunk/M/src/mail/MimeDecode.cpp 2008-07-26 18:14:24 UTC (rev 7493)
+++ trunk/M/src/mail/MimeDecode.cpp 2008-07-26 18:15:23 UTC (rev 7494)
@@ -456,7 +456,7 @@
// encode the given text unconditionally, i.e. without checking if it must be
// encoded (this is supposed to be done in the caller) and using the specified
-// encodings andcharset (which are supposed to be detected by the caller too)
+// encodings and charset (which are supposed to be detected by the caller too)
static String
EncodeText(const String& in,
wxFontEncoding enc,
@@ -512,6 +512,14 @@
}
else // Base64
{
+ // rfc822_binary() splits lines after 60 characters so don't make
+ // chunks longer than this as the base64-encoded headers can't have
+ // EOLs in them
+ static const int CCLIENT_MAX_BASE64_LEN = 60;
+
+ if ( lenRemaining > CCLIENT_MAX_BASE64_LEN )
+ lenRemaining = CCLIENT_MAX_BASE64_LEN;
+
// we can calculate how many characters we may put into lenRemaining
// directly
len = (lenRemaining / 4) * 3 - 2;
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 the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates